H,
What is the use of level number 88 in COBOL? What are the different ways we can use it in programs? Give some examples.
To this my answer was, level number 88 in COBOL is used for condition names . Any level number except 66 and 77 can be a CONDITION VARIABLE. But interviewer asked further and I could not satisfy him better. Could anyone explain this question more in detail.
What is the use of level number 88 in COBOL?
-
- New Member
- Posts: 3
- Joined: Wed Aug 13, 2014 7:38 pm
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: What is the use of level number 88 in COBOL?
The 88 level can be used to define groupings of a variable. For example:could be used to define groups of US states. It is easier to understand than and if the IF statements are used extensively, they are easier to code and maintain (if New Jersey is moved from Mid-Atlantic states to the Northeast states, you can move the one state code from MA-STATES to NE-STATES, rather than having to locate EVERY IF statement in the program that references NJ and changing it.).
Code: Select all
88 NE-STATES VALUE 'ME', 'MA', 'NH', 'VT', 'RI', 'CT', 'NY'.
88 SE-STATES VALUE 'FL', 'GA', 'SC', 'NC', 'TN', 'AL', 'MS'.
etc
Code: Select all
IF NE-STATES
Code: Select all
IF STATE-CODE = 'ME' OR 'MA' OR ...
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute