View previous topic :: View next topic
|
Author |
Message |
Souparno
New User
Joined: 09 Sep 2008 Posts: 7 Location: India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
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 |
|
|
Souparno
New User
Joined: 09 Sep 2008 Posts: 7 Location: India
|
|
|
|
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 |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
They are aligned on a doubleword boundary.
Regards,
Bill |
|
Back to top |
|
|
|