cobolmainframecopybook

COBOL copybook blank fields


Simple question that I cannot find an answer to through web-searching.

Is it valid to have a field in a COBOL copybook without a name? i.e. is the following valid?

05  SUMMARY.
    07  DETAILS OCCURS 3 TIMES
                            PIC X(10).
    07                      PIC X(100).

Is this the same as say using FILLER instead of the name? If not, what is the difference between a blank name and using FILLER?


Solution

  • Is this the same as say using FILLER instead of the name?

    Yes it is. The requirement to use FILLER for an unreferenced data item was removed in COBOL85.

    Using one or the other is mostly a "style" issue, commonly there will be a "shop/team rule" about what to use.

    Note: this is not strictly related to a copybook, it is the same when used in any data description entry in the program's source.
    For documentation (I assume you meant an IBM mainframe here) see the appropriate entry in the IBM COBOL Language Reference.