# jCL STON

Updated: 10/23/2020, 1:48:27 PM
Created: 10/23/2020, 1:48:27 PM
Last Updated By: Mike Street
Read Time: 2 minute(s)

Tags: buffer jcl

# Description

This command selects the secondary output buffer as the active output buffer. It takes the general form:

STON
1

or

ST ON
1

The STON command selects the SOB as the active output buffer. With the stack turned on, all data moved to an output buffer with an MV, H or A command will be placed in the secondary output buffer.

Typically, you would create the command necessary to start the external job stream in the primary output buffer. Next you would turn the stack on and store all the necessary responses (or commands) to the external process. When you issue the P command to execute the external program, instead of taking it's input from the terminal, the program will be fed directly from the stack.

# Note

The stack is often used to feed responses to interactive processes. It can also be used to store a series of commands that you might need for example when you are dealing with select lists. For example, do a GET-LIST, followed by a SORT -LIST and then run a jBC  program.

Terminated successive responses in the stack, with a less-than-character (<) to represent a RETURN  key depression. A single response or the last response in the stack does not require the less than character (<) because a RETURN is generated by the P command.

# Example

| Command       |   POB Before   |   POB After    |
| -------       |   ----------   |   ---------    |
| STON          | COPY^SALES^ABC | COPY^SALES^ABC |
| H(SALES.HOLD  |          ^     |          ^     |
|               |                |                |
|               |   SOB Before   |   SOB After    |
|               |   ----------   |   ---------    |
|               |                | (SALES.HOLD<   |
|               | ^              |             ^  |
1
2
3
4
5
6
7
8
9

Back to jCL.