What is a Data Stack?
REXX in TSO/E uses an expandable data structure called a data stack to store information. The data stack combines characteristics of a conventional stack and queue.
Stacks and queues are similar types of data structures used to temporarily hold data items (elements) until needed. When elements are needed, they are removed from the top of the data structure. The basic difference between a stack and a queue is where elements are added (as shown in the following figure). Elements are added to the top of a stack and to the bottom of a queue.
Using a stack, the last element added to the stack (elem6) is the first removed. Because elements are placed on the top of a stack and removed from the top, the newest elements on a stack are the ones processed first. The technique is called LIFO (last in first out).