CL Programming


Working 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 work station and receive input from the work station 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 RCVF commands.

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

Only one display or database file 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.

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.

You can use the methods discussed in the Application Display Programming Link to PDF book or the Screen Design Aid (SDA) to enter DDS source for records and fields in the display file. See the

A CL procedure or program can use several commands, called data manipulation commands. These commands let you refer to a display file to send data to and receive data from device displays. These commands also allows you to refer to a database file to read records from a database file. These commands are:

These commands let a running program communicate with a device display using the display functions provided by DDS, and to read records from a database file. DDS provides functions for writing menus and performing basic application-oriented data requests that are characteristic of many CL applications.
These commands let a running program communicate with a device display using the display functions provided by DDS, and to read records from a database file. DDS provides functions for writing menus and performing basic application-oriented data requests that are characteristic of many CL applications.

The fields on the display or in the record are identified in the DDS for the file. In order for the CL procedure or program to use the fields, the file must be referred to in the CL procedure or program by the DCLF command. This reference causes the fields and indicators in the file to be declared automatically in your procedure or program as variables. You can use these variables in any way in CL commands; however, their primary purpose is to send information to and receive information from a display. The DCLF command is not used at run time.

The format of the display and the options for the fields are specified in the device file and controlled through the use of indicators. Up to 99 indicator values can be used with DDS and CL support. Indicator variables are declared in your CL procedure or program in the form of logical variables with names &IN01 through &IN99 for each indicator that appears in the device file record formats referred to on the DCLF command. Indicators let you display fields and control data management display functions, and provide response information to your procedure or program from the device display. Indicators are not used with database files.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]