Where allowed to run:
|
Parameters Examples Error messages |
The Send File (SNDF) command is used by a CL procedure to send a record to a display device that is being used by an interactive user. The device can be any display station, including the console. The command sends the data from the program's CL variables to the display's device file in the specified record format. These variables were automatically declared in the program (one for each field in the record format) when the CL source program was compiled and a Declare File (DCLF) command was processed as part of the source.
Of the record formats specified in the DCLF command, only one can be specified in each SNDF command. If the device file has not been opened, it is opened by this command. The file and record format specified in this command can be overridden by an Override with Display File (OVRDSPF) command if it is entered before the file is opened. However, care should be taken that the fields in the overriding record format correspond to the CL variables declared in the program.
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
DEV | Display device | Name, *FILE | Optional, Positional 1 |
RCDFMT | Record format | Name, *FILE | Optional, Positional 2 |
OPNID | Open file identifier | Simple name, *NONE | Optional |
Top |
Specifies the name of the display device to which the data in the CL variables for the specified record format is to be sent.
Top |
Specifies the name of the record format that is to be used to send data to the file. The format contains all the fields in the record. This parameter must be coded with a record format name if there is more than one record format name in the device file; *FILE cannot be coded if there is more than one. If the record format contains the INVITE DDS keyword (optioned on), the SNDF functions as if SNDRCVF WAIT(*NO) had been coded.
Top |
Specifies the open file identifier that was declared on a preceding Declare File (DCLF) command in the same CL procedure. A CL variable cannot be specified for this parameter value.
Top |
Example 1: Using Display File with One Record Format
DCLF FILE(MENU1) : SNDF
The record format in the device file MENU1 is sent to the device specified in the file. There is only one record format in the file.
Example 2: Using Display File with Multiple Record Formats
DCLF FILE(SCREEN1) RCDFMT(REC1 REC2) : SNDF DEV(DISP3) RCDFMT(REC1)
The device file named SCREEN1 causes the display station named DISP3 to display the data sent by the CL procedure. The data is shown in the format specified by the REC1 record format.
Example 3: Using Open File Identifier
DCLF FILE(SCREEN1) RCDFMT(REC1 REC2) OPNID(OUTDSP1) DCLF FILE(SCREEN2) RCDFMT(REC3 REC4) OPNID(OUTDSP2) : SNDF DEV(*FILE) RCDFMT(REC2) OPNID(OUTDSP1)
The device file named SCREEN1 is used to send data to the display device named in the same device file. The data is presented to the user in the format specified by record format REC2. The SNDF command is associated with device file SCREEN1 because the open file identifier specified on the SNDF command matches the open file identifier specified on the DCLF command for display file SCREEN1.
Top |
*ESCAPE Messages
Top |