Chapter 11. Storing Information in the Data Stack
. . . . . . . . . . . . . . . . . . . . . 135
. . . . . . . . . . . . . . . . . . . 136
Adding Elements to the Data Stack . . . . . . . . . . . . . . . . 136
Removing Elements from the Stack . . . . . . . . . . . . . . . . 137
Determining the Number of Elements on the Stack . . . . . . . . . . 137
Exercise - Using the Data Stack . . . . . . . . . . . . . . . . 138
Processing of the Data Stack . . . . . . . . . . . . . . . . . . . 139
Using the Data Stack . . . . . . . . . . . . . . . . . . . . . . 140
Passing Information Between a Routine and the Main Exec . . . . . . . 140
Passing Information to Interactive Commands . . . . . . . . . . . . 142
Issuing Subcommands of TSO/E Commands . . . . . . . . . . . . 142
Creating a Buffer on the Data Stack. . . . . . . . . . . . . . . . . 142
Creating a Buffer with the MAKEBUF Command . . . . . . . . . . . 143
Removing Elements from a Stack with a Buffer
Dropping a Buffer with the DROPBUF Command . . . . . . . . . . . 144
Finding the Number of Buffers with the QBUF Command . . . . . . . . 144
Finding the Number of Elements In a Buffer . . . . . . . . . . . . . 145
Exercises - Creating a Buffer on the Data Stack . . . . . . . . . . 145
Protecting Elements in the Data Stack . . . . . . . . . . . . . . . . 147
Creating a New Data Stack with the NEWSTACK Command
. . . . . . . . . . . . . . . . . . . . 150
This chapter describes how to use the REXX data stack to store information. Also,
this chapter describes how to add a buffer to a data stack and how to create a
private data stack in TSO/E.
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).
Using a
queue
, the first element added to the queue (elem1) is the first removed.
Because elements are placed on the bottom of a queue and removed from the top,
the oldest elements on a queue are the ones processed first. The technique is
called FIFO (first in first out).
© Copyright IBM Corp. 1988, 2001
135
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: ......