Improving performance using internal expression processing

For simple criteria, File Manager can process the expression internally without needing to invoke REXX. This can result in faster processing of record identification and record selection criteria. If an expression is not eligible for internal processing, File Manager displays the message “REXX required” when you press Enter on the relevant panel. In this case, you can choose to either modify the expression so that REXX is not required, or use the expression with REXX processing instead of internal processing.

For an expression to be eligible for internal processing, it must consist only of:

  • Literal strings: These include ordinary quoted strings as well as binary and hexadecimal strings. For a more detailed description of literal strings, see Overview of REXX expressions.
  • Numerics: Unlike REXX, the internal expression processor distinguishes between character and numeric types. To ensure internal processing uses the correct numeric value, enter numeric data as unquoted strings.

    For example, the internal expression processor treats the string 5 as a number and compares it equal to any other numeric with a value of five. However, it treats the string '5' as character data and compares it equal to a string containing X'F5' (with optional leading and trailing blanks for non-strict comparison). REXX treats both strings the same and handles them as character data, but allows them to behave as numbers in appropriate contexts.

    Non-floating point numerics are limited to 31 decimal digits, and floating point numerics are limited to the range of numbers that can be stored as a double-precision floating point number. See Handling floating point numbers for a more complete discussion of how the internal processor and REXX differ in the way they handle floating point numbers.

  • Comparison operators: The internal expression processor supports all the REXX comparison operators.

    The internal processor performs numeric comparisons when both operands are numeric or contain numeric data (formatted references to numeric fields, or FLD references specifying a numeric formatting type); bit comparisons when both operands are bit fields; otherwise, the internal processor performs character comparisons.

    Where both operands have the same value, numeric comparisons match regardless of the length and type of the data. Bit comparisons match only when both bit fields are the same. Leading zero-bits are ignored in the longer field if the fields are not the same length. Character comparisons match only if the two strings are identical, except that leading and trailing blanks are ignored by the non-strict operators. The internal expression processor compares character strings byte by byte according to the standard EBCDIC collating sequence and, where a shorter string matches a longer string up to the end of its length, the longer string is deemed to be greater.

  • Logical operators: The only logical operators that the internal processor allows are the AND (&), OR (|), exclusive OR (&&) and NOT (¬ or \) operators.
  • Arithmetic prefix operators: You can use the plus (+) and minus (-) operators before decimal numerics (to indicate sign), and before and within floating point numerics as defined by the REXX syntax.
  • File Manager field references: The internal expression processor supports both formatted and unformatted references when evaluating identification or selection criteria. Field references are not supported in FASTREXX procedures.
  • Function invocations: The following functions can be included in an expression that is to be processed internally:
    • CMP_DATE
    • CMP_TIME
    • FLD
    • FLD_CO
    • FLD_TM
    • FLD_TYPE
    • FLDI
    • FLDO
    • I_LENGTH
    • O_LENGTH
    • PRTCOUNT
    • RECSIN
    • RECSOUT
    • SEGCNT
    • SEGNO
    • TESTC
    • TESTN
    • TFLD
  • Parentheses

These rules also apply when creating conditions in an IF-THEN-ELSE statement within a FASTREXX procedure.

Related concepts