
As shown in the following figure, the data stack that REXX uses combines the
techniques used in adding elements to stacks and queues. Elements can be placed
on the top or the bottom of a data stack. Removal of elements from the data stack,
however, occurs from the top of the stack only.
Manipulating the Data Stack
There are several REXX instructions that manipulate the data stack. Two
instructions add elements to the data stack and another removes elements from the
data stack.
Adding Elements to the Data Stack
You can store information on the data stack with two instructions, PUSH and
QUEUE.
PUSH - puts one item of data on the top of the data stack. There is virtually no
limit to the length of the data item.
elem1 = 'String 1 for the data stack'
PUSH elem1
QUEUE - puts one item of data on the bottom of the data stack. Again, there is
virtually no limit to the length of the data item.
elemA = 'String A for the data stack'
QUEUE elemA
If the two preceding sets of instructions were in an exec, the data stack would
appear as follows:
What is a Data Stack?
136
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: ......