Data stack routine
- PUSH
- PULL
- QUEUE
- QUEUED()
- MAKEBUF
- DROPBUF
- NEWSTACK
- DELSTACK
- QSTACK
- QBUF
- QELEM
- MARKTERM
- DROPTERM
The name of the system-supplied data stack routine is IRXSTK. If you provide your own data stack routine, your routine can handle all of the data stack requests or your routine can perform pre-processing and then call the system routine, IRXSTK. If your routine handles the data stack requests without calling the system-supplied routine, your routine must manipulate its own data stack.
If your data stack routine performs pre-processing and then calls the system routine IRXSTK, your routine must pass the address of the environment block for the language processor environment to IRXSTK.
An application running in any address space can invoke IRXSTK to operate on the data stack. The only requirement is that a language processor environment has been initialized.
Parameter 1 indicates the type of function to be performed against the data stack. If the data stack routine is called to pull an element off the data stack (PULL function) and the data stack is empty, a return code of 4 indicates an empty data stack. However, you can use the PULLEXTR function to bypass the data stack and read from the input stream (for example, from the terminal in TSO/E foreground).
If the data stack routine is called and a data stack is not available, all services operate as if the data stack were empty. A PUSH or QUEUE will seem to work, but the pushed or queued data is lost. QSTACK returns a 0. NEWSTACK will seem to work, but a new data stack will not be created and any subsequent data stack functions will operate as if the data stack is permanently empty.
The maximum string that can be placed on the data stack is one byte less than 16 MB. REXX does not check the content of the string, so the string can contain any hexadecimal characters.
If multiple data stacks are associated with a single language processor environment, all data stack operations are performed on the last data stack that was created under the environment. If a language processor environment is initialized with the NOSTKFL flag off, a data stack is always available to execs that run in that environment. The language processor environment might not have its own data stack. The environment might share the data stack with its parent environment depending on the setting of the NEWSTKFL flag when the environment is initialized.
If the NEWSTKFL flag is on, a new data stack is initialized for the new environment. If the NEWSTKFL flag is off and a previous environment on the chain of environments was initialized with a data stack, the new environment shares the data stack with the previous environment on the chain. Using the data stack in different environments describes how the data stack is shared between language processor environments.
The name of the data stack replaceable routine is specified in the STACKRT field in the module name table. Module name table describes the format of the module name table.