MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

COBOL Level Variables

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
ramkey
Beginner


Joined: 09 Mar 2006
Posts: 1
Topics: 1
Location: Chennai

PostPosted: Thu Mar 09, 2006 9:11 pm    Post subject: COBOL Level Variables Reply with quote

Hi All,

May I know what is the significance of having a single Level 1 variables in the working storage section over, having more number of Level 1 variables.

Please come up with ur views.

Thanks,
Ramakrishnan
Back to top
View user's profile Send private message Yahoo Messenger
Ravi
Beginner


Joined: 27 Jun 2005
Posts: 88
Topics: 2

PostPosted: Fri Mar 10, 2006 12:55 am    Post subject: Reply with quote

CASE 1
01 my-var1 ...
01 my-var2 ...

CASE 2
01 variables,
05 my-var1 ...
05 my-var2 ...

In the second case I can initialize both my-var 1 & 2 at a time using INITIALIZE variables statement. Thats one advantage am seeing in CASE 2.
Back to top
View user's profile Send private message
German Castillo
Beginner


Joined: 23 Dec 2005
Posts: 83
Topics: 2
Location: Caracas, Venezuela

PostPosted: Fri Mar 10, 2006 9:25 am    Post subject: Reply with quote

Other Than cosmetics, and the already pointed out advantage, regarding initialization, there is no other advantage.

From a COBOL internal point of view each variable is allocated one after the other, aligning, and maybe formatting them where they should be, some compiling options can twist this behavior somehow. The compiler do not pay any attention to levels at this point, even more it generates at compile time what is know as a 'normalized' level from all the levels it founds on its passes through the source code

On the other hand from an application proggrammer point of view, it makes sense to GROUP variables according to their usage, context or whatever happens to be the reason the analist comes up with.

A word of caution here ... Some 'levels' have a particular usage already defined, for example, Levels 88, levels 66 AND level 77, regarding L 77, they may not be used as grouping levels. some of the others, including L 88 may be part of other group levels
_________________
Best wishes,

German Castillo
Back to top
View user's profile Send private message
neilxt
Beginner


Joined: 01 Mar 2004
Posts: 23
Topics: 1

PostPosted: Tue Sep 19, 2006 4:15 pm    Post subject: Re: COBOL Level Variables Reply with quote

ramkey wrote:
Hi All,

May I know what is the significance of having a single Level 1 variables in the working storage section over, having more number of Level 1 variables.

Please come up with ur views.

Thanks,
Ramakrishnan


See also the discussion on level 77...

Each 01 level is located on a full word boundary. The wasted space may have been a consideration 30 years ago.

Knowing that difference may be important when examining dumps. If anyone still does that. Some people found it easier to scan words byte by byte and others found it easier to skip to the next fullword when encountering the next 01 level.

As is often the case with go-away-spammer-sucker retentive programmers probably someone got promoted to manager and promptly enshrined their own personal preference as law (standard).
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group