Combining DFSORT and REXX statements in a procedure

When you want your procedure to contain both DFSORT and REXX statements, then you must code the DFSORT statements before the REXX statements, and the REXX statements must be separated from the DFSORT statements by a line containing the string *REXXPROC or one of the *FASTREXX statements coded in column one. For more information about how enhanced processing interacts with DFSORT and REXX, see How enhanced processing works.

While the DFSORT *FASTPROC statements must be placed before the REXX statements, when a combination of DFSORT and REXX statements are used, the order of execution is:

  1. DFSORT OMIT or INCLUDE statements, INREC statements and OUTREC statements, in that order.
  2. REXX statements
  3. DFSORT OUTFIL statements
Example
This example combines DFSORT and REXX statements in one procedure to change all records, where columns one and two contain '01', into upper case and discard all other records:
*FASTPROC
 INCLUDE COND=(1,2,CH,EQ,C'01')
*REXXPROC
 Upper OUTREC