COBOL level 88 data type
Asked Answered
P

3

2

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.

Phyletic answered 1/9, 2012 at 1:39 Comment(0)
Y
7

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
Yellowgreen answered 2/9, 2012 at 7:24 Comment(1)
Fantastic answer, thanks so much. Sorry it took so long to reply, I had forgotten that I had an answer to this.Phyletic
L
1

As usual, it depends. :-)

The level 88 values seem to belong under part 3 "Range of values", especially if they document the only values allowed for some variable.

The FILLER fields are of course important if the documentation is used to reconstruct the records. If you just want to document the usage of the other fields, they are not very interesting.

Lavatory answered 1/9, 2012 at 12:16 Comment(0)
O
1

The 'PIC X' FILLER variables are probably flags in working storage with 88 levels, and therefore quite important.

For instance, we use this type of construct a lot:

01 FILLER                     PIC X.
    88 OPTION-IS-ON        VALUE 'Y', FALSE 'N'.
    88 OPTION-IS-OFF       VALUE 'N'.

This defines a flag which we only reference using it's conditions. For example we might use it like this:

SET OPTION-IS-ON TO TRUE.     | This puts a 'Y' in the PIC X
   .
   .
   .
IF OPTION-IS-ON
   do something
END-IF

In this case we never need to refer to the actual flag value itself, and hence you do not need to give it a name.

The 'FALSE' in the 88 level just allows you to specify what is stored when you use the statement:

SET OPTION-IS-ON TO FALSE     | This puts an 'N' in the PIC X

which of course is the same as saying:

SET OPTION-IS-OFF TO TRUE     | This also puts an 'N' in the PIC X

It all depends what is more readable at the time.

Occultism answered 10/10, 2012 at 23:42 Comment(1)
A bit on the late side, but still a useful answer. Thanks!Phyletic

© 2022 - 2024 — McMap. All rights reserved.