| |
 |
|
| |
COBOL TUTORIAL
FOR BCA STUDENTS OF M G UNIVERSITY |
|
| |
|
|
| |
 |
|
| |
|
|
| |
 |
|
| |
The
sign condition determines whether or not the algebraic
value of an operand is positive, negative or zero.
The operand can be either a numeric identifier or
an arithmetic expression.
The format of this condition is as follows:
|
|
| |
 |
|
| |
When arithmetic expression is used, it must contain
at least one identifier. The POSITIVE option determines
the value of the condition to be true only if the
value of the operand strictly positive. This means
that the value zero is not treated as positive.
Example:
|
|
| |
|
| |
It may be noted that the above IF statement is equivalent
to the following statement that makes use of a relational
condition.
|
|
| |
|
| |
Example:
|
|
| |
|
| |
The control is transferred to the paragraph named
CALCULATION if the current value
of DEPOSIT is greater than that of
WITHDRAWAL.
In general, any sign condition can be replaced by
an equivalent relational condition. The use of the
sign condition may perhaps be convenient in certain
cases and its use may also increase the readability
of the statement that uses it.
|
|
| |
|
|
| |
 |
|
| |
|
|
| |
 |
|
| |
|
|