EasyManuals Logo

IBM TSO/E REXX User Manual

IBM TSO/E REXX
242 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #142 background imageLoading...
Page #142 background image
long as there is output. Output from the most recent command is placed after the
previous commands output. The total number of lines trapped is stored in var0.
x = OUTTRAP('var')
"LISTC"
SAY 'The number of lines trapped is' var0
To limit the number of lines of output saved, you can specify a limit, for example 5,
after the variable name.
x = OUTTRAP('var',5)
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 on page 85.
x = OUTTRAP('var.')
"LISTC"
SAY 'The number of lines trapped is' var.0 /* could display 205 */
lines = var.0 + 1
"LISTDS mynew.exec MEMBERS"
SAY 'The number of lines trapped is' var.0 /* could display 210 */
DO i = lines TO var.0
SAY var.i /* displays 5 members */
END
To turn trapping off, reissue the OUTTRAP function with the word "OFF".
x = OUTTRAP('OFF') /* turns trapping 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.
Using the PROMPT Function
When your profile allows for prompting, the PROMPT function can set the
prompting option on or off for interactive TSO/E commands, or it can return the type
of prompting previously set. When prompting is on, execs can issue TSO/E
commands that prompt the user for missing operands.
The PROMPT function can be used only in REXX execs that run in the TSO/E
address space.
To set the prompting option on, use the PROMPT function followed by the word
"ON" enclosed within parentheses.
x = PROMPT('ON') /* x is set to the previous setting of prompt */
/* and sets the current setting to ON */
To set prompting off, substitute the word "OFF" for "ON".
To find out if prompting is available for TSO/E interactive commands, use the
PROMPT function followed by empty parentheses.
TSO/E External Functions
124
z/OS V1R1.0 TSO/E REXX Users Guide

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM TSO/E REXX and is the answer not in the manual?

IBM TSO/E REXX Specifications

General IconGeneral
BrandIBM
ModelTSO/E REXX
CategoryComputer Hardware
LanguageEnglish

Related product manuals