Previous Topic: REXX-defined Stacks

Next Topic: ISERVE Stack Extensions and Functions

TSO/E Stack Emulation

In addition to the stack instructions defined by the language (such as PULL and QUEUE), TSO/E provides additional commands. The following list shows the ISERVE extensions that emulate these commands.

Important! Although ISERVE supports these extensions, it is recommended that you do not use them. Instead, use the ISERVE stack functions such as SWAPSTAK() and PUBSTACK(),which are easier to use.

DELSTACK

Deletes all records in the current stack and removes the last added NEWSTACK barrier. Records that existed on the stack before the last issuance of the NEWSTACK command are accessible again.

DROPBUF

Deletes all records in the current stack buffer, as well as the buffer itself. With the DROPBUF command, you can specify a single numeric value that deletes all buffers up to and including the buffer identified by that number. For example, you can enter DROPBUF 0 to delete all records and all buffers. (DROPBUF 0 is equivalent to DELSTACK.)

MAKEBUF

Divides a stack into buffers. MAKEBUF places a barrier on top of the current stack. The PUSH and QUEUE commands operate as if nothing exists below this barrier. However, both the QUEUED() function and the PULL command ignore buffer barriers. When a PULL crosses a buffer barrier, the buffer count is reduced by one and the buffer is discarded.

NEWSTACK

Constructs a barrier at the top of the stack. Records below this barrier cannot be accessed until a corresponding DELSTACK is issued. In essence, NEWSTACK hides the existing stack and starts a new one.

QBUF

Returns the current buffer number in the RC special variable. The lowest buffer number is zero.

QELEM

Returns the total number of stack elements in the current buffer. The value is returned in the RC special variable.

QSTACK

Returns the current stack number (as determined by the nesting level of NEWSTACK and DELSTACK operations) in the RC special variable. The lowest stack number is zero. An RC value equal to zero indicates that you are currently processing the only stack left.