A SERVICE OF

logo

292 Chapter 4
Command Definition F-K
IF
IF
Used to control the execution sequence of a job, UDC, or command file. (Native Mode)
Syntax
IF expression[ THEN]
Parameters
expression Logical expression, consisting of operands and relational operators. The
operators listed in Table 4-1 may be incorporated in expression.
Table 4-1 Logical Operators - The IF Command
The allowed operands are any variable, integer, string, or Boolean constants, and the
MPE/iX reserved words are WARN, FATAL, SYSTEM, and OK.
Compound logical expressions can be formed using the AND, NOT, XOR, and OR logical
operators, and nested within parentheses.
The THEN keyword is optional. It may be used or omitted and has no effect on the results.
Logical operators: AND, OR, XOR, NOT
Boolean functions and values: BOUND, TRUE, FALSE, ALPHA, ALPHANUM,
NUMERIC, ODD
Comparison operators: =, <>, <, >, <=, >=
Bit manipulation operators: LSL, LSR, CSR, CSL, BAND, BOR, BXOR, BNOT
Arithmetic operators: MOD, ABS, * , / , + , -, ^ (exponentiation)
Functions returning strings: CHR, DWNS, UPS, HEX, OCTAL, INPUT, LFT, RHT, RPT,
LTRIM, RTRIM, STS
Functions returning integers: ABS, LEN, MAX, MIN, ORD, POS, TYPEOF
Other functions: FINFO, SETVAR