IF output values—Data extract expressions


The most common use for the IF statement is in determining which of two values should be copied to the output record depending upon which of the two clauses is executed: the THEN or the ELSE.

If the expression in the executed clause is simply a field name or segment name (including any cast specification), the specified value is copied to the output record. If the executed clause contains an arithmetic or relational expression, the expression will be evaluated and that result will be copied to the output record.

Information
Example
IF (CREDIT LE LIMIT) THEN (C'Accepted') ELSE (C'Rejected')

If CREDIT is less than or equal to LIMIT, Accepted is copied to the output record; otherwise, Rejected is copied.

Information
Example
IF (PROFIT-LOSS LT 0 AND INVEST EQ 0) THEN(100000)
ELSE(PROFIT-LOSS+INVEST)

If the loss was more than the profit and the investment is 0, output 100000 (in packed decimal); otherwise, output the true worth.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Online Reorg for IMS 5.2