Application programs should be consistent in their use of 32-bit and 16-bit options on terminal control commands.
The maximum value that can be specified as an argument on any LENGTH or FLENGTH option is 32767, but see
LENGTH for some general advice.
The RECEIVE command is used to read data from a terminal or logical unit.
The INTO option is used to specify the area into which the data is to be placed.
Alternatively, a pointer reference can be specified in the SET option.
CICS acquires an area that is large enough to hold the data, and sets the pointer reference to the address of that data.
The contents of this area are available to the task until the next terminal I/O command.
However, the area does not belong to the task, and is released by CICS while processing the next request.
Therefore, this area cannot be passed back to CICS for further processing.
The application can use MAXLENGTH to specify the maximum length of data that the program accepts.
If the MAXLENGTH option is omitted on a RECEIVE command for which the INTO option is specified, the maximum length of
data the program accepts can be specified in the LENGTH option.
If the MAXLENGTH option is omitted on a RECEIVE command for which the SET option is specified, CICS acquires enough storage to hold all the available data.
If the data exceeds the specified maximum length and the NOTRUNCATE option is specified, the remaining data is made available to satisfy subsequent
RECEIVE commands.
If NOTRUNCATE is not specified, the data is truncated and the LENGERR condition occurs.
In this event, if the LENGTH option is specified, the named data area is set to the actual data length (before
truncation occurs) when data has been received.
The first RECEIVE command in a task that is started by a terminal if no SEND operation has occurred does not issue a terminal control read, but simply
copies the input buffer, even if the data length is zero.
A second RECEIVE command must be issued to cause a terminal control read.
For further information, see RECEIVE (terminal).
The SEND command is used to write data to a terminal or logical unit.
The options FROM and LENGTH specify respectively the data area from which the data is to be taken and the length (in bytes) of the data.
For a transaction that is started by Automatic Transaction Initiation (ATI), a SEND command should always precede the first RECEIVE in a transaction.
For further information, see SEND (terminal).
Unless the WAIT option is specified also, the transmission of the data that is associated with the SEND command is deferred until a later event, such as a
syncpoint, occurs.
This deferred transmission reduces the flows of data by allowing data-flow controls to be transmitted with the data.
This command is used to ensure that a terminal operation has completed before further processing occurs in a task under which more than one terminal or
logical unit operation is performed.
Alternatively, the WAIT option can be specified in a SEND command.
A WAIT is always carried out for a RECEIVE command.
Either method can cause execution of a task to be suspended.
If suspension is necessary, control is returned to CICS.
Execution of the task is resumed when the operation is completed.
Even if the WAIT option is not specified in a SEND command, CICS ensures that the operation is completed before issuing a subsequent RECEIVE or SEND
command.
For most terminals or logical unit types, a conversational mode of communication can be used.
The CONVERSE command is used for this purpose.
In general, the CONVERSE command can be considered as a combination of a SEND command followed immediately by a WAIT TERMINAL command,
then by a RECEIVE command.
However, not all options of the SEND and RECEIVE commands are valid for the CONVERSE command. The TOLENGTH option is equivalent to the
LENGTH option of a RECEIVE command, and the FROMLENGTH option is equivalent to the LENGTH option of a SEND command.
For further information, see CONVERSE (terminal).
This command is used, in a transaction in receive mode, to signal to the sending transaction that a mode change is needed.
The execution of the command raises the SIGNAL condition on the next SEND or RECEIVE command that is executed in the sending transaction,
and a previously executed HANDLE CONDITION command for this condition can be used either to action the request, or to ignore it.
For further information, see ISSUE SIGNAL.
© Copyright IBM Corp.