Protecting Elements In The Data Stack - IBM TSO/E REXX User Manual

Table of Contents

Advertisement

ANSWERS
1.
2.

Protecting Elements in the Data Stack

In certain environments, particularly MVS, where multiple tasks run at the same
time, it is often important for an exec to isolate stack elements from other execs.
Similarly, an exec in TSO/E might want to protect stack elements from a routine
(subroutine or function) that it calls. For example, if an exec puts elements on the
data stack for its own use and then calls a subroutine that issues an interactive
TSO/E command, such as ALLOCATE, the command goes to the data stack first for
input to the command. Because the stack input is incorrect for the command
prompt, the exec ends in error.
Even though the subroutine in the preceding example starts with the MAKEBUF
command, the stack elements will be used because MAKEBUF does not protect
elements previously placed on the stack.
'DROPBUF 2'
'QBUF'
SAY RC
'QELEM'
SAY RC
SAY QUEUED()
a.
C
b.
b
c.
B (b was changed to uppercase because it was queued without quotes and
pulled without PARSE.)
d.
2
e.
1
f.
0
a.
4
b.
3
c.
0
d.
1, 1, 1
Example of an Interactive Command Error
EXEC1
PUSH prompt1
PUSH prompt2
CALL sub1
7invellip.
EXIT
SUB1:
'MAKEBUF'
'ALLOCATE'
. .
.
Creating a Buffer on the Data Stack
Chapter 11. Storing Information in the Data Stack
147

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents