Command reference / CL
SNDF
Send File
Used by a CL program or ILE CL procedure to send a record to a display device used by an interactive user. The data comes from the program's CL variables, which DCLF declares automatically, one per field in the record format. Only one record format from the DCLF can be used per SNDF. 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 the 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.
- Valid only for display files.
- Cannot be used with database files.
Parameters
DEV
Display device
Specifies the display device that receives the program's data for the record format. A CL variable holding the device name can be used. *FILE cannot be used if the device file names more than one device.
Suggested / special values:
*FILE
*FILE- Sends data to the device associated with the device file declared in the DCLF FILE parameter.
RCDFMT
Record format
Specifies the record format used to send the data. It must be coded if the device file has more than one record format. If the format contains the INVITE DDS keyword on, SNDF acts like SNDRCVF WAIT(*NO).
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.
Examples
SNDF DEV(DISP3) RCDFMT(REC1)
With DCLF FILE(SCREEN1) RCDFMT(REC1 REC2) declared earlier, displays data in format REC1 on the display station named DISP3.
Generated from os/cl/catalog/SNDF.json and os/cl/help/SNDF.json.