IF (If)

Free-Form Syntax IF{(MR)} indicator-expression
Code Factor 1 Extended Factor 2
IF (M/R) Blank indicator-expression

The IF operation code allows a series of operation codes to be processed if a condition is met. Its function is similar to that of the IFxx operation code. It differs in that the logical condition is expressed by an indicator valued expression (indicator-expression). The operations controlled by the IF operation are performed when the expression in the indicator-expression operand is true. For information on how operation extenders M and R are used, see Precision Rules for Numeric Operations.

For more information, see Structured Programming Operations.

Figure 325. IF Operation

CL0N01Factor1+++++++Opcode(E)+Extended-factor2+++++++++++++++++++++++++++..
C                             Extended-factor2-continuation+++++++++++++++
 * The operations controlled by the IF operation are performed
 * when the expression is true.  That is A is greater than 10 and
 * indicator 20 is on.
C
C                   IF        A>10 AND *IN(20)
C                   :
C                   ENDIF
 *
 * The operations controlled by the IF operation are performed
 * when Date1 represents a later date then Date2
C
C                   IF        Date1 > Date2
C                   :
C                   ENDIF
 *


[ Top of Page | Previous Page | Next Page | Contents | Index ]