Writes (or sends) data to a terminal.
Syntax

SEND (terminal)
>>-SEND--FROM(data-area)--+-LENGTH(data-value)--+--+------+----->
'-FLENGTH(data-value)-' '-WAIT-'
>--+-------+--+---------------------+--------------------------><
'-ERASE-' '-CTLCHAR(data-value)-'
Conditions: INVREQ, LENGERR, NOTALLOC, TERMERR
Description
SEND sends data either to a terminal,
or on an advanced program-to-program communications
(APPC) mapped
conversation. The form of SEND command that is described here is used for
sending data to a terminal. For details of the SEND command for use on APPC
mapped conversations, see SEND (APPC).
(An APPC conversation allows a program to send data to, and receive data
from, a program that is running in a remote system. Programming that uses
APPC conversations is called Distributed Transaction Programming (DTP). For
guidance information about DTP, see Distributed transaction processing (DTP).)
Options
- CTLCHAR(data-value)
- Specifies
a one-byte Write Control Character (WCC) that controls the SEND command. A
COBOL user must specify a data area that contains this character. If the option
is omitted from the SEND command, all Modified Data Tags are reset to zero
and the keyboard is restored.
- ERASE
- Specifies
that the screen is to be erased and the cursor returned to the upper left
corner of the screen before writing occurs. ERASE should be specified in the
first output command of a transaction or in a series of pseudoconversational
transactions. This clears the screen ready for the new output data.
- FLENGTH(data-value)
- A
32-bit alternative to LENGTH(data-value).
- FROM(data-area)
- Specifies
the data that is to be written to the terminal.
- LENGTH(data-value)
- Specifies,
as a 16-bit binary value, the length of the data that is to be written. For
more information about using this option, see LENGTH.
- WAIT
- Specifies
that processing of the command must be completed before any subsequent processing
is attempted.
If the WAIT option is not specified, control is returned
to the application program after processing of the command has started. A
subsequent input or output request (terminal control or Basic Mapping Support
(BMS)) to the terminal that is associated with the task causes the application
program to wait until the previous request has been completed.
Conditions
- INVREQ
- Occurs
for the following conditions, depending on the options that are specified
on the SEND command:
- Any of the terminal-related SEND options (ERASE or CTLCHAR) has been specified,
but the principal facility for the task is not a terminal (that is, it is
an APPC conversation).
- An attempt is made to issue a SEND command with terminal-related options
from a remotely linked-to program.
- A remotely linked-to program attempted to execute a SEND command that
refers to the principal facility.
Default action: Terminates the task abnormally.
- LENGERR
- Occurs
if an out-of-range value is supplied in the LENGTH or FLENGTH option (zero
is acceptable).
Default action: Terminates the task abnormally.
- NOTALLOC
- Occurs
if this command is issued in a task that is not associated with a terminal.
Default action: Terminates the task abnormally.
- TERMERR
- Occurs
if a terminal-related error occurs.
Default action: Terminate the task
abnormally (with abend code ATNI).