EasyManuals Logo
Home>IBM>Computer Hardware>TSO/E REXX

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 #162 background imageLoading...
Page #162 background image
To prevent a routine from accessing elements below the buffer, you can use the
QUEUED built-in function as follows:
olditems = QUEUED()
'MAKEBUF'
PUSH ...
QUEUE ...
DO WHILE QUEUED() > olditems /* total items > old number of items */
PULL ....
...
END
'DROPBUF'
Dropping a Buffer with the DROPBUF Command
When an exec has no more need for a buffer on the data stack, it can use the
TSO/E REXX DROPBUF command to remove the buffer (and its contents). The
DROPBUF command removes the most recently created buffer.
To drop a specific buffer on the data stack and all buffers created after it, issue the
DROPBUF command with the number of the buffer. The first MAKEBUF creates
buffer 1, the second creates buffer 2, and so on. For example, if an exec issued
three MAKEBUF commands that created three buffers, when you issue DROPBUF
2, the second and third buffers and all elements within them are removed.
To remove all elements from the entire data stack including elements placed on the
data stack before buffers were added, issue DROPBUF 0. DROPBUF 0 creates an
empty data stack and should be used with caution.
Note: When an element is removed below a buffer, the buffer disappears. Thus
when elements are unintentionally removed below a buffer, the
corresponding DROPBUF command might remove the incorrect buffer and
its elements. To prevent an exec from removing elements below a buffer, use
the QUEUED built-in function or use the NEWSTACK command as
described in Protecting Elements in the Data Stack on page 147.
Finding the Number of Buffers with the QBUF Command
To find out how many buffers were created with the MAKEBUF command, use the
TSO/E REXX QBUF command. QBUF returns in the REXX special variable RC, the
number of buffers created.
'MAKEBUF'
.
.
.
'MAKEBUF'
.
.
.
'QBUF'
SAY 'The number of buffers is' RC /* RC=2*/
Creating a Buffer on the Data Stack
144
z/OS V1R1.0 TSO/E REXX Users Guide

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