88-Level and display.
Posted: Fri Jul 19, 2013 12:04 pm
Hi,
Can we display the value of 88-level variables?
Can we display the value of 88-level variables?
Code: Select all
05 WS-VAR PIC X(01).
88 COND-A VALUE 'A'.
88 COND-B VALUE 'B'.
IF COND-A
DISPLAY 'COND-A ' WS-VAR
ELSE
IF COND-B
DISPLAY 'COND-B' WS-VAR
END-IF
END-IF.So is it always wrong to mention them as "variables"?Robert Sample wrote:1. There is no such thing as an 88-level variable.
and the various places in the manual will refer to "condition-name" or "entry" for 88-levels.88 Identifies any condition-name entry that is associated with a particular value of a conditional variable. (For details, see "VALUE clause" in topic 5.3.18.)
The variable is called the conditional variable while the associated 88-levels are condition names -- so it is NOT correct to refer to 88-levels as "variables".A condition-name is used in conditions as an abbreviation for the relation condition. The rules for comparing a conditional variable with a condition-name value are the same as those specified for relation conditions. If condition-name-1 has been associated with a range of values (or with several ranges of values), the conditional variable is tested to determine whether its value falls within the ranges, including the end values. The result of the test is true if one of the values that corresponds to the condition-name equals the value of its associated conditional variable. | Condition-names are allowed for alphanumeric, DBCS, national, and | floating-point data items, as well as others, as defined for the | condition-name format of the VALUE clause. The following example illustrates the use of conditional variables and condition-names:
01 AGE-GROUP PIC 99.
88 INFANT VALUE 0.
88 BABY VALUE 1, 2.
88 CHILD VALUE 3 THRU 12.
88 TEENAGER VALUE 13 THRU 19.
AGE-GROUP is the conditional variable; INFANT, BABY, CHILD, and TEENAGER are condition-names. For individual records in the file, only one of the values specified in the condition-name entries can be present.