Passing Information To Interactive Commands; Issuing Subcommands Of Tso/E Commands; Creating A Buffer On The Data Stack - IBM TSO/E REXX User Manual

Table of Contents

Advertisement

Using the Data Stack

Passing Information to Interactive Commands

When your TSO/E profile allows prompting, most TSO/E commands prompt you for
missing operands. For example, the TRANSMIT command prompts you for a node
and user ID when you do not include the destination with the command.
An exec can put responses to command prompts on the data stack. Because of the
information search order, the data stack supplies the necessary information instead
of a user at the terminal.
For example, the following exec puts the TRANSMIT command and its operands on
the data stack. When the exec completes, the TSO/E data stack service continues
to get input from the data stack. Thus the TRANSMIT command is issued after the
exec ends.

Issuing Subcommands of TSO/E Commands

To execute subcommands of a TSO/E command in a REXX exec, you must place
the subcommands onto the data stack before you issue the TSO/E command.

Creating a Buffer on the Data Stack

When an exec calls a routine (subroutine or function) and both the exec and the
routine use the data stack, the stack becomes a way to share information. However,
execs and routines that do not purposely share information from the data stack,
might unintentionally do so and end in error. To help prevent this, TSO/E provides
the MAKEBUF command that creates a buffer, which you can think of as an
extension to the stack, and the DROPBUF command that deletes the buffer and all
elements within it.
142
z/OS V1R1.0 TSO/E REXX User's Guide
Example of Passing Information from the Stack to a Command
/****************************** REXX *******************************/
/* This exec prompts a user for a node and gets the user ID from a */
/* built in function. It then calls an external subroutine to
/* check if the user's job is finished.
/* The TRANSMIT command and its operands, including a message with */
/* the status of the job, are queued on the data stack to run after*/
/* the exec terminates.
/*******************************************************************/
SAY 'What is your node?'
PULL node
id = USERID()
dest = node'.'id
CALL jobcheck userid /* Go to a subroutine that checks job status */
IF RESULT = 'done' THEN
note = 'Your job is finished.'
ELSE
note = 'Your job is not finished.'
QUEUE 'transmit'
QUEUE dest 'line'
/* Specify that the message be in line mode */
QUEUE note
QUEUE ''
/* Insert a null to indicate line mode is over */
*/
*/
*/

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents