EasyManuals Logo

IBM TSO/E REXX User Manual

IBM TSO/E REXX
242 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #153 background imageLoading...
Page #153 background image
Chapter 11. Storing Information in the Data Stack
What is a Data Stack? .....................135
Manipulating the Data Stack ...................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 ..........143
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 ......148
Deleting a Private Stack with the DELSTACK Command ........149
Finding the Number of Stacks ..................149
Additional Examples ....................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

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM TSO/E REXX and is the answer not in the manual?

IBM TSO/E REXX Specifications

General IconGeneral
BrandIBM
ModelTSO/E REXX
CategoryComputer Hardware
LanguageEnglish

Related product manuals