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 #163 background imageLoading...
Page #163 background image
QBUF returns the total number of buffers created, not just the ones created by a
single exec. Thus if an exec issued two MAKEBUF commands and called a routine
that issued two more, when the routine issues a QBUF command, RC returns the
total number of buffers created, which is four.
Finding the Number of Elements In a Buffer
To find out how many elements are in the most recently created buffer, use the
TSO/E REXX QELEM command. QELEM returns in the REXX special variable RC,
the number of elements in the most recently created buffer.
PUSH A
'MAKEBUF'
PUSH B
PUSH C
'QELEM'
SAY 'The number of elements is' RC /* RC=2*/
QELEM does not return the number of elements on a data stack with no buffers
created by the MAKEBUF command. If QBUF returns 0, no matter how many
elements are on the stack, QELEM also returns 0.
For more information about these stack commands, see z/OS TSO/E REXX
Reference.
Exercises - Creating a Buffer on the Data Stack
1. What are the results of the following instructions?
a. What is item?
QUEUE A
QUEUE B
'MAKEBUF'
QUEUE C
PULL item
b. What is element?
PUSH 'a'
PUSH 'b'
'MAKEBUF'
PUSH 'c'
PUSH 'd'
'DROPBUF'
PARSE PULL element
c. What is stackitem?
QUEUE a
'MAKEBUF'
QUEUE b
'MAKEBUF'
QUEUE c
'DROPBUF'
PULL stackitem
d. What is RC?
PUSH A
'MAKEBUF'
PUSH B
CALL sub1
'QBUF'
SAY RC
EXIT
Creating a Buffer on the Data Stack
Chapter 11. Storing Information in the Data Stack 145

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