How REXX-enhanced processing works
File Manager defines two special REXX variables, INREC and OUTREC, that you can use in the REXX statements that you supply to perform enhanced processing. When the File Manager function or panel invokes REXX, the contents of each input record selected for processing are passed in both INREC and OUTREC. When REXX is invoked, the contents of INREC and OUTREC are identical, unless you are using the DSC function or the Copy Utility (option 3.3) with an output template that performs field mapping to reformat records. If you are using DSC or the Copy Utility to reformat records then, when REXX is invoked, INREC contains the input record, and OUTREC contains the reformatted output record.
/* Reformat varying length records as fixed
using an arbitrarily located delimiter */
If Substr(inrec,1,2) == '02' Then Do
Parse Var inrec left '/' right
outrec = Left(left,40) || Left(right,40)
End
If the value of the OUTREC variable is longer than the record length allowed in the data set specified by the function or panel you are using, then it is truncated. If the value of OUTREC is shorter than the record length, it is padded using the character specified by the PAD field on the Set Processing Options (option 0) panel (if you are enhancing a panel) or the character specified by the PAD parameter of the SET function (if you are enhancing a function).