Record format

When you specify R in position 17, the name specified in positions 19 through 28 is a record format name.

Record format for physical files

Only one record format name is allowed for a physical file. Specify the record format name in one of the following two ways:
  • As the name of a new record format with field names specified in this physical file.

    The name of the record format can be the same as the file name specified in the Create Physical File (CRTPF) command. However, a warning message appears if the names are not unique because some high-level language processors do not allow record format and file names to be the same. Report Program Generator (RPG) is such a high-level language. The record format name and field names do not need to be unique to the system; the same names can exist in another file.

  • As the name of a record format previously defined in another physical file.

    The FORMAT keyword must be specified. Field names and attributes are not specified.

Record format for simple- and multiple-format logical files

You can specify more than one record format name. However, each name must be unique within the file. See the appropriate high-level language manual for exceptions.

Specify the record format name in one of the following three ways:
  • As the record format name in the first physical file specified on the PFILE keyword.

    This is required if you do not specify the FORMAT keyword and do not identify individual fields by naming them in this record format.

  • As the name of a new record format with field names specified in this logical file.

    Every field must be identified by name. No unnamed physical file fields are part of this logical file record format. Physical file fields that are parameters of RENAME and CONCAT keywords are part of the logical file record format. Physical file fields that are parameters of SST keywords are not part of the logical file record format unless specified elsewhere.

  • As the name of a record format previously described in a physical or logical file.

    Field names and attributes are not specified and the FORMAT keyword must be specified.

The record format name can be the same as the file name specified in the create file command. However, a warning message is sent if the names are not unique. Some high-level language processors, such as RPG, do not allow record format and file names to be the same.

Use the PFILE keyword in conjunction with the record format name to specify the physical files with which the record format is to be associated. A record format can have more than one physical file specified on the PFILE keyword. If no fields are defined and the FORMAT keyword is not specified, the format of the first file specified in the PFILE keyword is used as the format for all the physical files. (This format is used for field attribute references and attribute and name checking.)

Join logical files

Only one record format name can be specified. Specify the record format name as the name of a new record format with field names specified in this logical file. Every field in the record format for a join logical file must be identified by the name in positions 19 through 28. Physical file fields that are parameters of the RENAME, CONCAT, and SST keywords are part of the logical file record format only if you specify the field names elsewhere in the record format.

The JFILE keyword is required at the record level. It specifies the physical files that the record format joins.