COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Usage Considerations:
• TRUE Value
The result of the test is TRUE if the switch is set to the position corresponding to the one identified
by the condition-name; otherwise, the result of the test is FALSE.
• Setting External Switches
Set external switch value by using the PARAM command of the command interpreter (see
SPECIAL-NAMES Paragraph (page 105)) or by the SET statement (see SET (page 436)).
Example 69 External Switches
SPECIAL-NAMES.
SWITCH-1 IS IN-SWITCH ON STATUS IS TAPE-INPUT
OFF STATUS IS DISK-INPUT
SWITCH-2 IS OUT-SWITCH ON STATUS IS TAPE-OUTPUT
OFF STATUS IS DISK-OUTPUT.
...
PROCEDURE DIVISION.
...
IF TAPE-INPUT OPEN INPUT TAPE-SOURCE
ELSE OPEN INPUT DISK-SOURCE.
IF TAPE-OUTPUT OPEN OUTPUT TAPE-SINK
ELSE OPEN OUTPUT DISK-SINK.
...
Sign Conditions
The sign condition determines whether the algebraic value of an arithmetic expression is less than,
greater than, or equal to zero.
arithmetic-expression
is an arithmetic expression, as described in Arithmetic Expressions.
Usage Considerations:
• NOT Modifier
When NOT appears, it and the next keyword are considered to form a single sign condition.
For example, NOT ZERO is a truth test that determines if the operand value is nonzero (is
positive or negative).
• Definition
An operand is positive if its value is greater than zero, negative if its value is less than zero,
and zero if its value is equal to zero.
• Expression Cannot Be Composed Entirely of Literals
The arithmetic expression must contain at least one variable operand (at least one operand
that is not a literal).
272 Procedure Division










