Example 2 Part 2 - Using the OUTTRAP Function
/*******************************************************************/
/* When SYSPROC is found, loop through data sets until another file*/
/* name is encountered or until all lines are processed. Append */
/* data set names to the one in variable "concat". */
/*******************************************************************/
IF found = 'YES' THEN
DO WHILE (i + 3) <= name.0
i=i+3
IF SUBSTR(name.i,1,3) = ' ' THEN
DO
i=i-1
concat = concat",'"name.i"'"
END
ELSE
i = name.0
END
ELSE NOP
/* Allocate the new concatenation to SYSPROC */
"ALLOC F(sysproc) DA('"addname"',"concat") SHR REUSE"
Additional Examples
132
z/OS V1R1.0 TSO/E REXX User’s Guide