IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Disadvantages of using 77 Level variable


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Souparno

New User


Joined: 09 Sep 2008
Posts: 7
Location: India

PostPosted: Wed Sep 24, 2008 9:31 am
Reply with quote

Can you please help me in knowing the disadvantages of using 77 level variables in COBOL ?

Is / are there similar concern(s) with using 66 level as well ?

Thanks in advance for your time and help.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Sep 24, 2008 10:46 am
Reply with quote

Hello,

Quote:
Can you please help me in knowing the disadvantages of using 77 level variables in COBOL ?
I know of no disadvantages with 77s. Use of them would be contorlled by standards (if any apply for your organization) and personal preference. My preference is to make "one of a kind" fields 77 level entries.

Quote:
Is / are there similar concern(s) with using 66 level as well ?
Other than local standards, none that i know. More often redefines is used, but there may be situations where a renames is just what you want.
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Wed Sep 24, 2008 11:07 am
Reply with quote

If you declare a variable in 77 level, you cannot declare any elementary items for that particular variable if you want to do so in future. But note that this is not a disadvantage, just difference from other levels e.g., 01,02,... etc.
Back to top
View user's profile Send private message
Souparno

New User


Joined: 09 Sep 2008
Posts: 7
Location: India

PostPosted: Wed Sep 24, 2008 11:43 am
Reply with quote

Thanks for the replies.. Just to elaborate on my question.. I am aware of the differences between 01 and 77 level variables, in fact as per my knowledge 77 might help reduce usage of memory during runtime with no extra byte being used to store the memory requirement of underlying variables if any.

But having said that I am not able to appreciate why many of the shops as standard practice prefer not use in 77 level variables in COBOL programs.

Not sure, it might just be more to do with software maintenance advantages rather than pure technical.

Can you please help me in understanding the rationale behind.
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Wed Sep 24, 2008 12:04 pm
Reply with quote

From google I found the following points.

Code:

Level 77's can only be used to define individual elementary items. The use of 77's is banned in some shops who take the view that instead of declaring large numbers of indistinguishable 77's it is better to collect the individual items into groups.

Level 66's (RENAMES clause) are used to apply a new name to an identifier or group of identifiers. It is not generally used in modern COBOL programs
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Sep 24, 2008 2:12 pm
Reply with quote

back in the days when everything numeric had to mod4/mod8 bounded, 77 levels were the answer. nowadays the machines are fast enough that if an element must be bounded, the internal code will perform the function.

nowadays the machines are fast enough, that the simplest common denominator is usually a shop standard, since so many coders have no idea what is happening in the machine when they code an instruction.

a display comp or comp-3 variable will now be converted to usage display before the data is actually sent to the output. used to be, you had to convert it your self or hope your spool display allowed hex display options.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Sep 24, 2008 3:32 pm
Reply with quote

They are aligned on a doubleword boundary.

Regards,

Bill
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts How to load to DB2 with column level ... DB2 6
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
Search our Forums:

Back to Top