REXX examples
Here are examples of REXX comparison expressions:
- Example 1
- Select segments in which the transaction date (field #14)
is any date in July 2000,
or the transaction value (field #27)
is greater than $100,000.00
(#14 >= 20000701 & #14 < 20000801) | #27 > 100000.00
- Example 2
- Select segments in which the count of credit notes (field #62)
is greater than 10% of the count of invoices (field #61)
#62 > #61/10
- Example 3
- Select segments in which the employee identifier (field #17)
starts with any of the letters A, C, or E.
CO(SUBSTR(#17,1,1),'A','C','E')
- Example 4
- Select segments in which the supplier number (field #23)
is 997644 or 997645, and the item description (field #33)
contains the word 'CABINET'
NCO(#23,997644,997645) & CO(#33,'CABINET')
- Example 5
- Select segments in which the 4-byte packed decimal field starting
at position 17 in the segment contains a negative value
FLD(17,4,P) < 0
- Example 6
- Select segments in which either the transaction value (field #27)
is greater than $50,000.00 and the purchase order number (field #25)
starts with characters other than 'TX', or the transaction value is
greater than $70,000 and the supplier number (field #23) is 984545, but
not if both sets of conditions are true
(#27 > 50000.00 & SUBSTR(#25,1,2) ¬= 'TX') && (#27 > 70000.00 & #23 = 984545)