COBOL Manual for TNS and TNS/R Programs

Data Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
7-96
Descriptions of Condition-Names for Values
(Level 88)
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
Example 7-22. 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 7-23. 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.
...