level 88 condition with short alphanumeric literal VALUE

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
Posts: 1
Joined: Thu Mar 09, 2017 8:58 pm

level 88 condition with short alphanumeric literal VALUE

Post by mhoward » Thu Mar 09, 2017 9:24 pm

I have a copybook with a fragment using a level 88 conditional flag.
It says:

Code: Select all

        88 HEADER-FLAG  VALUE 'H'.
        88 DETAIL-FLAG  VALUE 'DT'.
        88 TRAILER-FLAG VALUE 'T'.
Note that the RECORD-TYPE-INDICATOR is 2 chars.
Note that the HEADER-FLAG and TRAILER-FLAG literal VALUEs are a single char.

I was surprised to see this, because I assumed that the conditional flag literal would have to be the same length as the associated alphanumeric item.

IBM Enterprise COBOL 4.2 reference manual says
the number of characters in the literal must not exceed the size of the item.
HP COBOL reference manual says:
If you specify a nonnumeric literal value, it must not exceed the size defined by the data item’s PICTURE clause.
I cannot find a definitive description of the behavior when the conditional VALUE literal is shorter than the associated alphanumeric item.

Q: What VALUE(s) in the RECORD-TYPE-INDICATOR will set the HEADER-TYPE condition name?

a. 'HH'
b. anything starting with 'H'.
c. 'H ' ... H followed by a space
d. something else?


Post Reply


Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Mainframe Interview questions

Other References
Mainframe Tools and others