
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
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
Содержание TSO/E REXX
Страница 1: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 2: ......
Страница 3: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 10: ...viii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 12: ...x z OS V1R1 0 TSO E REXX User s Guide ...
Страница 14: ...xii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 18: ...xvi z OS V1R1 0 TSO E REXX User s Guide ...
Страница 20: ...2 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 58: ...Tracing Expressions with the TRACE Instruction 40 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 78: ...60 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 86: ...Built In Functions 68 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 128: ...Issuing Other Types of Commands from an Exec 110 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 136: ...Debugging Execs 118 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 170: ...Protecting Elements in the Data Stack 152 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 201: ...Part 3 Appendixes Copyright IBM Corp 1988 2001 183 ...
Страница 202: ...184 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 222: ...Using Variables 204 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 226: ...208 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 238: ...220 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 241: ......