Example of Sign condition:
The illustration below describes the use of the sign condition.
Illustration:
77 BALANCE PIC S9 (6) V99.
.
.
IF BALANCE IS ZERO GO TO NIL-BALANCE.
It may be illustrious that the above IF statement is equivalent to the below statement which makes use of the relational condition.
IF BALANCE = 0 GO TO NIL-BALANCE.
Illustration:
02 DEPOSIT PIC 9(4) V99.
02 WITHDRAWAL PIC 9(4) V99.
.
.
.
IF DEPOSIT -WITHDRAWAL IS POSITIVE GO TO CALCULATION.
The control is transferred to the paragraph named the CALCULATION if the present value of the DEPOSIT is greater than that of the WITHDRAWAL.
In normal, any sign condition can be substituted by an equivalent relational condition. Use of the sign condition might perhaps be convenient in many cases and it may also use to increase the readability of the statement which uses it.