COBOL level 88 data type

Djentleman picture Djentleman · Sep 1, 2012 · Viewed 19.8k times · Source

Very basic question here.

I have to write out a data glossary for a COBOL program. This data glossary includes the following details about every variable:

  1. Name
  2. Data type
  3. Range of values (if applicable)
  4. Line numbers
  5. Fuller name

I have several variables that include level 88 switches. My question is this: Are these level 88 switches counted as variables, and should I include them in the data glossary? Or, judging by the data glossary structure I have to work with, should they be ignored in this context?

And while I'm here, another simple question. Should fillers be included in data glossaries? This program in particular contains a LOT of filler variables, most being simple "PIC X" variables.

Answer

Derek Schrock picture Derek Schrock · Sep 2, 2012

Assuming I understand the question being asked.

It would help if you could give an example with a COBOL layout and data glossary entry one with and one without an 88 entry. However, I'll do my best to try to answer the question.

No, 88 level entries are not variables and they do not increase or decrease the length of the record. They simply allow you to create a conditional statement.

With that being said should your data glossary only include variables that contribute to the length of the record?

If yes then there shouldn't be a separate data glossary entry per 88 item. However, it might help to explain a given variable's value[s] (3 and maybe 5 or even an extra line for expected values).

01 record-store.
 02 location pic 9(4).
   88 dist-center value 100, 101, 102.
 02 value    pic 9(6).
 02 paid     pic X(1).
   88 yes value 'Y', 'y'.
   88  no value 'N', 'n'.

Your data glossary would/could be:

location

  • Name: location
  • Data Types: integer
  • Range of Value: 0-9999
  • Line Numbers: 20
  • Fuller name: location of the data
  • Expected Values:
    • 100, 101, 102 for distribution centers
    • 1-99 for customers
    • 103-9999 invalid

Now knowing your expected values you might go back and change your 88 values?

...
 02 location pic 9(4).
   88 dist-center value 100, 101, 102.
   88 customers   value 1 thru 99.
   88 invalid     value 0, 103 thru 9999.
...    

If no then:

You could have a separate data glossary entry pre 88 level entry.

Your data glossary would/could be:

location

  • Name: location
  • Data Types: integer
  • Range of Value: 0000-9999
  • Line Numbers: 20
  • Fuller Name: The location of the data

dist-center

  • Name: dist-center
  • Data Types: boolean
  • Range of Value: 100, 101, 102
  • Line Numbers: 5
  • Fuller Name: Is location is a distribution center

customer

  • Name: customer
  • Data Types: boolean
  • Range of Value: 1-99
  • Line Numbers: 5
  • Fuller Name: Is location a customer

invalid

  • Name: invalid
  • Data Types: boolean
  • Range of Value: 0001, 0010, 0100
  • Line Numbers: 5
  • Fuller Name: Is location an invalid value