What is the use of level number 88 in COBOL?

All sort of Mainframes Interview Questions.
Post Reply
Anand Bharti
New Member
Posts: 3
Joined: Wed Aug 13, 2014 7:38 pm

What is the use of level number 88 in COBOL?

Post by Anand Bharti »

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.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: What is the use of level number 88 in COBOL?

Post by Robert Sample »

The 88 level can be used to define groupings of a variable. For example:

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
could be used to define groups of US states. It is easier to understand

Code: Select all

IF NE-STATES
than

Code: Select all

IF STATE-CODE = 'ME' OR 'MA' OR ...
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.).
Post Reply

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

Register

Sign in

Return to “Interview Questions.”