z/OS TSO/E REXX User's Guide
|
Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Using the OUTTRAP Function z/OS TSO/E REXX User's Guide SA32-0982-00 |
|
|
The OUTTRAP function puts lines of command output into a series
of numbered variables, each with the same prefix. These variables
save the command output and allow an exec to process the output.
Specify the variable name in parentheses following the function call.
In this example, the variable var becomes the
prefix for the numbered series of variables. Var1, var2, var3, and
so on, receive a line of output each. If you do not set a limit to
the number of output lines, the numbering of variables continues as
long as there is output. Output from the most recent command is placed
after the previous command's output. The total number of lines trapped
is stored in var0.
To limit the number of lines of output saved, you can specify a
limit, for example 5, after the variable name.
This results in up to 5 lines of command output stored in var1, var2, var3, var4, var5; and var0 contains the number 5. Subsequent lines of command output are not saved. The following example traps output from two commands and then displays
the member names from a partitioned data set named MYNEW.EXEC. The
stem variable includes a period, which causes the lines of output
to be stored in a series of compound variables. For more information
about compound variables, see Using Compound Variables and Stems.
To turn trapping off, reissue the OUTTRAP function with the word
"OFF".
The OUTTRAP function can be used only in REXX execs that run in the TSO/E address space. The OUTTRAP function does not trap all lines of command output from all TSO/E commands. For more information, see z/OS TSO/E REXX Reference.
|
Copyright IBM Corporation 1990, 2014 |