
To protect elements on the data stack, you can create a new data stack with the
TSO/E REXX NEWSTACK command. Read the next section to see how the exec in
the previous example can safely issue an interactive TSO/E command.
To delete the new data stack and all elements in it, use the TSO/E REXX
DELSTACK command. Execs can create multiple stacks before deleting them.
Note:
Before an exec returns to its caller, the called exec should issue a
DELSTACK command for each NEWSTACK command it issued, unless the
called exec intends for the caller to also use the new data stack.
Creating a New Data Stack with the NEWSTACK Command
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.
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.
Protecting Elements in the Data Stack
148
z/OS V1R1.0 TSO/E REXX User’s Guide
Summary of Contents for TSO/E REXX
Page 1: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Page 2: ......
Page 3: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Page 10: ...viii z OS V1R1 0 TSO E REXX User s Guide ...
Page 12: ...x z OS V1R1 0 TSO E REXX User s Guide ...
Page 14: ...xii z OS V1R1 0 TSO E REXX User s Guide ...
Page 18: ...xvi z OS V1R1 0 TSO E REXX User s Guide ...
Page 20: ...2 z OS V1R1 0 TSO E REXX User s Guide ...
Page 58: ...Tracing Expressions with the TRACE Instruction 40 z OS V1R1 0 TSO E REXX User s Guide ...
Page 78: ...60 z OS V1R1 0 TSO E REXX User s Guide ...
Page 86: ...Built In Functions 68 z OS V1R1 0 TSO E REXX User s Guide ...
Page 128: ...Issuing Other Types of Commands from an Exec 110 z OS V1R1 0 TSO E REXX User s Guide ...
Page 136: ...Debugging Execs 118 z OS V1R1 0 TSO E REXX User s Guide ...
Page 170: ...Protecting Elements in the Data Stack 152 z OS V1R1 0 TSO E REXX User s Guide ...
Page 201: ...Part 3 Appendixes Copyright IBM Corp 1988 2001 183 ...
Page 202: ...184 z OS V1R1 0 TSO E REXX User s Guide ...
Page 222: ...Using Variables 204 z OS V1R1 0 TSO E REXX User s Guide ...
Page 226: ...208 z OS V1R1 0 TSO E REXX User s Guide ...
Page 238: ...220 z OS V1R1 0 TSO E REXX User s Guide ...
Page 241: ......