COBOL Level Variables
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Application Programming

#1: COBOL Level Variables Author: ramkeyLocation: Chennai PostPosted: Thu Mar 09, 2006 9:11 pm
    —
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

#2:  Author: Ravi PostPosted: Fri Mar 10, 2006 12:55 am
    —
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.

#3:  Author: German CastilloLocation: Caracas, Venezuela PostPosted: Fri Mar 10, 2006 9:25 am
    —
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

#4: Re: COBOL Level Variables Author: neilxt PostPosted: Tue Sep 19, 2006 4:15 pm
    —
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).



MVSFORUMS.com -> Application Programming


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group