FORMAT (Format) keyword for physical and logical files

You can use this record-level keyword to specify that this record format is to share the field specifications for a previously defined record format. The name of the record format you are defining must be the name of the previously defined record format.

The format of the keyword is:
FORMAT([library-name/]database-file-name)

The database-file-name parameter is required. It is the name of the physical or logical file from which the previously defined record format is taken.

The library-name is optional. If you do not specify the library-name, the library list (*LIBL) in effect at file creation time is used.

If you specify the FORMAT keyword, you cannot specify field specifications for this record format. Specify key specifications and, if necessary, select/omit specifications if you want them to be in effect for this file. (They can be the same as or different from the previously defined record format.)

The FORMAT keyword is not valid in join logical files and you cannot specify a join logical file as the parameter value on the FORMAT keyword.

If the database file from which you are using the record format is deleted, the record format remains in existence as long as some file is using the record format. For example, RECORD in FILE2 uses the FORMAT keyword to share the specifications of RECORD in FILE1. Both files have been created. If FILE1 is deleted and then re-created with different DDS, RECORD still exists in FILE2. It can be referred to for the original record format by other files using the FORMAT keyword.

You cannot specify a distributed data management (DDM) file on this keyword.

Example

The following example shows how to specify the FORMAT keyword for a logical file.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R RECORD                    PFILE(FILE2)
00020A                                      FORMAT(FILE1)
     A

The record format for this logical file is the same as the previously specified record format in file FILE1. The name of this record format (RECORD) must be the same as the name of the record format in FILE1.