Using internal (FASTREXX) processing

File Manager attempts to use FASTREXX or REXX processing, depending upon the first *REXXPROC or *FASTREXX statement found in the procedure.

If no *REXXPROC or *FASTREXX statement is found, the REXX statements are processed as if they were preceded by a *REXXPROC statement.

Note:
  1. FASTREXX processing is supported for the DSEB function as long as it adheres to the following rules.
  2. Default length for packed fields: If you omit the length for a function that refers to a packed field processing, the length is re-calculated for each record processed.
*REXXPROC
The *REXXPROC statement indicates that the subsequent procedure statements are REXX statements (separating them from any preceding DFSORT statements). The statements are processed internally (using FASTREXX) if possible. If FASTREXX processing is not possible, the REXX statements are processed by invoking REXX.
*FASTREXX (ON)
The *FASTREXX (or *FASTREXX ON) statement indicates that the subsequent procedure statements are REXX statements (separating them from any preceding DFSORT statements), and should be processed internally if possible. If FASTREXX processing is not possible, the File Manager function terminates, indicating FASTREXX processing was not possible.
*FASTREXX OFF
The *FASTREXX OFF statement indicates that the subsequent procedure statements are REXX statements (separating them from any preceding DFSORT statements), and should be processed by invoking REXX.
*FASTREXX CHECK
The *FASTREXX CHECK statement indicates that the subsequent procedure statements are REXX statements (separating them from any preceding DFSORT statements), and should be processed by invoking REXX. However, File Manager indicates whether FASTREXX processing was possible for the procedure.
*FASTREXX NORUN
The *FASTREXX NORUN statement indicates that the subsequent procedure statements are REXX statements (separating them from any preceding DFSORT statements), and should be checked to determine whether FASTREXX processing is possible for the procedure. The File Manager function does not run, but File Manager indicates whether FASTREXX processing is possible for the procedure.

For a procedure to be eligible for FASTREXX processing, it must consist only of:

  • Null clauses. Null clauses consist only of blanks or comments. They are ignored when REXX statements are processed internally.
  • DO-END, DO WHILE-END, DO UNTIL-END, DO FOREVER-END ITERATE LEAVE
  • SELECT-WHEN-OTHERWISE-END clauses
  • LABEL and SIGNAL label clause support
  • IF-THEN-ELSE instruction clauses whose condition expressions are valid for internal processing. These clauses are supported if the condition expression is valid for internal processing, and the THEN and ELSE clauses are also valid for internal processing. 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
    • I_LENGTH
    • O_LENGTH
    • PRTCOUNT
    • RECSIN
    • RECSOUT
    • RECCUR
    • TFLD
    • FLDI
    • FLDO
    • TESTC
    • TESTN
    • DOWN
    • UP
    • FINDNEXT
    • FINDPREV

    Refer to About expression processing for more information about the eligibility of condition expressions for internal processing.

  • NOP instruction clauses (these are ignored).
  • RETURN instruction clauses.
  • Command clauses consisting only of an invocation of one of a limited set of functions. These are:
    • CHG_OUT
    • CHG_VAR
    • FLD_OUT
    • VAR_OUT
    • OVLY_OUT
    • OVLY_VAR
    • PRT_IN
    • PRT_OUT
    • PRT_VAR
    • SET_OLEN
    • TALLY
    • WRITE
    • SETC
    • SETN
    • TOP
    • BOT
    • DOWN
    • UP
    • RECCUR
    • FINDPREV
    • FINDNEXT
    • UPDATE

    The function performs the requested action, and returns a single blank as the command, which is ignored by the File Manager host command environment.

    To be eligible for internal (FASTREXX) processing, all of the arguments passed to a command function must be literals or unassigned symbols. Specifically:

    • Nested function invocations are not supported.
    • Field reference symbols (#ref) are not supported.
    • Assignment clauses are not supported.
    • Label clauses are not supported.
    • The following symbols are not supported, as they involve implicit assignment:
      • INREC and OUTREC

        (Instead, you must use the set of functions that act directly on the input and output record.

        )
      • RC
      • RESULT
      • SIGL

The following examples illustrate some simple FASTREXX-eligible statements:

FASTREXX example 1
To change the first byte in every record to a blank:
    OVLY_OUT(' ',1,1)
FASTREXX example 2
To pad every record to a length of 100 with blanks (records longer than 100 bytes would remain unchanged):
    OVLY_OUT(' ',1,100,'C',' ')
    FLD_OUT(1,,1)
FASTREXX example 3
This example invokes the CHG_OUT function provided by File Manager to change the first occurrence of a pair of slash characters (/) to a pair of question marks (?), but only if the first two characters of the record contain '01'. Otherwise, it changes the first pair of slashes to exclamation marks(!):
    If FLD(1,2) == '01' Then
      CHG_OUT('//','??')
    Else
      CHG_OUT('//','!!')