Command reference / CL
SNDRCVF
Send/Receive File
Used by a CL program or ILE CL procedure to send data to and receive data from a display device used interactively. Each send/receive passes one record in a format named by RCDFMT, defined in DDS. The CL variables for the fields, including DDS indicators, are declared implicitly. Only one record format from the DCLF can be used per command. If the device file is not yet open, this command opens it. An OVRDSPF entered before the file is opened can override the file or record format, and overriding fields should match the CL variables.
Allowed environments: *BPGM, *IPGM.
Use within a CL program.
Positional parameters: 2.
Restrictions
- Valid only within a CL program or ILE CL procedure and only for display files. Cannot be used with database files.
Parameters
DEV
Display device
Specifies the display device that data is sent to and received from. A CL variable holding the device name can be used, so one SNDRCVF can serve several devices. *FILE cannot be used if the device file names more than one device.
Suggested / special values:
*FILE
*FILE- Uses the device associated with the device file declared in the DCLF FILE parameter.
RCDFMT
Record format
Specifies the record format used to pass data between the program and the user. Must be coded when the device file has more than one record format. SNDRCVF ignores the INVITE DDS keyword.
Suggested / special values:
*FILE
*FILE- Used when the device file has only one record format.
OPNID
Open file identifier
Specifies the open file identifier from a preceding DCLF in the same program. A CL variable cannot be used for this value.
Suggested / special values:
*NONE
*NONE- No open file identifier is given; the command uses the file from the DCLF that specified *NONE.
WAIT
Wait
Specifies whether the program waits for input from the user's device or continues to the following commands. If *NO, a WAIT command later in the program must complete the input. A CL variable cannot be used for this parameter.
Allowed values:
*YES, *NO
*YES- The program waits, and the next command is not processed until the input completes.
*NO- The program does not wait for input and continues until a WAIT command is reached later.
Examples
SNDRCVF RCDFMT(REC8)
With DCLF FILE(SCR) RCDFMT(REC8) declared earlier, sends data to the user at the device in SCR in format REC8 and waits for the user's input.
Generated from os/cl/catalog/SNDRCVF.json and os/cl/help/SNDRCVF.json.