COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Example 55 Condition-Names for Values (Level 88)
Declaration:
05 RETURN-CODE PIC 99.
88 END-OF-FILE VALUE 01.
88 ERROR-ON-READ VALUE 02.
88 PERMANENT-ERROR VALUE 03.
88 ERROR-ON-WRITE VALUE 04.
Statement using one of the condition-names:
IF END-OF-FILE
PERFORM END-UP-OPERATION
CLOSE FILE-IN
END-IF
Definition of an item that has a range of values:
05 tax-code PIC 99.
88 tax-range VALUES ARE 00, 03, 07 THROUGH 11.
Statement testing if tax-code is 00, 03, 07, 08, 09, 10, or 11:
IF NOT TAX-RANGE
PERFORM TAX-ERROR-ROUTINE.
Example 56 VALUE Clauses for a Level-88 Data Item
01 ZIP-CODE.
03 ZIP-FIRST-3 PICTURE 999.
...
88 NEW-YORK VALUE IS 090 THRU 098,
100 THRU 149.
88 PENNSYLVANIA VALUE IS 150 THRU 196.
...
Usage Considerations:
• Condition-Name Description Location
All condition-name entries for a particular conditional variable must immediately follow the
entry describing that variable.
• Cannot Use With Certain Descriptions
A condition-name can be associated with any data description entry, even if specified explicitly
or implicitly as FILLER, with these exceptions:
◦ Level-66 items
◦ Level-88 items
◦ Index data item
◦ Data structure having any subordinate item described with the JUSTIFIED or
SYNCHRONIZED clause, or which are not USAGE DISPLAY
As the syntax presentation shows, the only clause permitted in a condition-name entry is the
VALUE clause containing the value, values, or range of values associated with the
condition-name; therefore, the characteristics of the condition-name are implicitly those of the
condition variable.
• Setting a Condition-Name to TRUE
You can set the value of a condition-name to TRUE with the SET TO statement. See Nonpointer
Data Items (page 441).
Descriptions of Condition-Names for Values (Level 88) 225










