Using The Prompt Function - IBM TSO/E REXX User Manual

Table of Contents

Advertisement

TSO/E External Functions
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.
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
lines = var.0 + 1
"LISTDS mynew.exec MEMBERS"
SAY 'The number of lines trapped is' var.0
DO i = lines TO var.0
END
To turn trapping off, reissue the OUTTRAP function with the word "OFF".
x = OUTTRAP('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')
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.
124
z/OS V1R1.0 TSO/E REXX User's Guide
SAY var.i
/* turns trapping OFF */
/* x is set to the previous setting of prompt */
/*
/* could display 205 */
/* could display 210 */
/* displays 5 members */
and sets the current setting to ON
*/

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents