ILE COBOL Programmer's Guide


Types of File Descriptions

The key element for all I/O operations on the iSeries server is the file. The operating system maintains a description of each file that is used by a program. The description of the file to the operating system includes information about the type of file, such as database or a device, the length of the records in the file, and a description of each field and its attributes. The file is described at the field level to the operating system through IDDU, SQL/400(R) commands, or DDS. If you create a file (for instance, by using the CRTPF command) without specifying DDS for it, the file still has a field description. The single field has the same name as the file, and has the record length you specified in the create command.

You can define a file in two ways:

Both externally described files and program-described files must be defined in the ILE COBOL program within the INPUT-OUTPUT SECTION and the FILE SECTION. Record descriptions in the FILE SECTION for externally described files are defined with the Format 2 COPY statement. Only field-level descriptions are extracted. When EXTERNALLY-DESCRIBED-KEY is specified as RECORD KEY, the fields that make up RECORD KEY are also extracted from DDS. For more information on the Format 2 COPY statement, see WebSphere Development Studio: ILE COBOL Reference.

Actual file processing within the Procedure Division is the same, if the file is externally described or program-described.


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