Work with files in CL procedures

Two types of files are supported in CL procedures and programs: display files and database files.

You can send a display to a workstation and receive input from the workstation for use in the procedure or program, or you can read data from a database file for use in the procedure or program.

Note: Database files are made available for use within the CL procedure or program through the DCLF and Receive File (RCVF) commands.

To use a file in a CL procedure or program, you must:

Up to five display or database files can be referred to in a CL procedure. The support for database files and display files is similar as the same commands are used. However, there are a few differences, which are described here.

Note: The open does not occur for both types of files until the first send or receive occurs. Because of this, the file to be used can be created during the procedure or program and an override can be performed before the first send or receive. However, the file must exist before the module or program is compiled.

The format for the display is identified as a record format in DDS. Each record format may contain fields (input, output, and input/output), conditions/indicators, and constants. Several record formats can be entered in one display file. The display file name, record format name, and field names should be unique, because other HLLs may require it, even though CL procedures and programs do not.


The format for the display is identified as a record format in DDS. Each record format may contain fields (input, output, and input/output), conditions/indicators, and constants. Several record formats can be entered in one display file. The display file name, record format name, and field names should be unique, because other HLLs may require it, even though CL procedures and programs do not.
Related concepts
Parts of a CL procedure
Related tasks
Access files
Related information
CL command finder
Application Display Programming