z/OS TSO/E REXX User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Creating a New Data Stack with the NEWSTACK Command

z/OS TSO/E REXX User's Guide
SA32-0982-00

The TSO/E REXX NEWSTACK command creates a private data stack that is completely isolated from the original data stack. The elements on the original data stack cannot be accessed by an exec or the routines that it calls until a DELSTACK command is issued. When there are no more elements in the new data stack, information is taken from the terminal.

Note: When you issue the NEWSTACK, it is your responsibility to issue a corresponding DELSTACK command.
All elements added to the data stack after the NEWSTACK command are placed in the new data stack. The original stack contains the elements placed on the stack before the NEWSTACK command.
IKJC3X09
Instructions that could be used to create the illustrated new stack are as follows:
PUSH 'oldA'
PUSH 'old1'
'NEWSTACK'
QUEUE 'newY'
PUSH 'newX'

In the Example of an Interactive Command Error, the MAKEBUF command did not protect the elements in the stack. If you substitute the NEWSTACK command for the MAKEBUF command, the elements become inaccessible.

Example of using NEWSTACK with an Interactive Command

EXEC1

PUSH prompt1
PUSH prompt2
CALL sub1
⋮
EXIT

SUB1:

'NEWSTACK'
'ALLOCATE'
⋮
Note: To have an interactive command prompt the user for input from the terminal, run an exec explicitly with the EXEC command and specify prompt or include the PROMPT(on) function within the exec. For more information, see Causing Interactive Commands to Prompt the User.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014