2

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?

Rick Smith
  • 3,962
  • 6
  • 13
  • 24
Morag Hughson
  • 7,255
  • 15
  • 44
  • 4
    Yes, your code is valid COBOL. FILLER and no name are the same. I'm used to writing and seeing FILLER because I'm an old-school COBOL developer. – Gilbert Le Blanc Feb 06 '21 at 22:45
  • 1
    The usage `no name` instead of `FILLER` was an addition to the Cobol Standard, not sure which version. I prefer it, other don't – Bruce Martin Feb 06 '21 at 23:33

1 Answers1

4

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.

Rick Smith
  • 3,962
  • 6
  • 13
  • 24
Simon Sobisch
  • 6,263
  • 1
  • 18
  • 38