Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Formats of the file description entry

Format 1 for sequential file organization


FD file-name

[BLOCK CONTAINS clause]
[CODE-SET clause]
[DATA RECORDS clause]
[EXTERNAL clause]
[GLOBAL clause]
[LABEL RECORDS clause]
[LINAGE clause]
[RECORD clause]
[RECORDING MODE clause]
[VALUE OF clause].


Format 2 for relative file organization


FD file-name

[BLOCK CONTAINS clause]
[DATA RECORDS clause]
[EXTERNAL clause]
[GLOBAL clause]
[LABEL RECORDS clause]
[RECORD clause]
[VALUE OF clause].


Format 3 for indexed file organization


FD file-name

[BLOCK CONTAINS clause]
[DATA RECORDS clause]
[EXTERNAL clause]
[GLOBAL clause]
[LABEL RECORDS clause]
[RECORD clause]
[VALUE OF clause].


Format 4 for sort files


SD sort-file-name

[DATA RECORDS clause]
[LABEL RECORDS clause]
[RECORD clause]
[RECORDING MODE clause]


Syntax rules for format 1, 2 and 3

  1. The level indicator FD identifies the beginning of a file description entry.

  2. file-name must be identical to the file-name given in a SELECT clause.

  3. Clauses that follow the file-name may appear in any order.

  4. The file description entry must be followed by one or more record description entries.

  5. The associated record description entries must be of the category alphabetic, alphanumeric, national or numeric.

  6. If the GLOBAL clause is specified in the file description entry, the data items referenced in the clauses of the file description entry may not be defined in a LOCAL-STORAGE SECTION.

General rules for formats 1, 2 and 3

  1. The following Table provides a summary of the functions of clauses used in file description entries.

    ClauseFunction
    BLOCK CONTAINSSpecifies physical block length
    CODE-SETSpecifies the character code set used to represent data on the extern media
    DATA RECORDSSpecifies the names of the records in the file
    EXTERNALDeclares a file as external
    GLOBALDeclares a file as global
    LABEL RECORDSGives the names and values of the label records contained in the file
    LINAGESpecifies the size of the logical page. It can also be use to specify a page body and a page footer.
    RECORDSpecifies the logical record size.
    RECORDING MODESpecifies the format of the logical records.
    VALUE OFSpecifies the values of some data items of a label.

    Table 9: Functions of file description clauses

  2. The CODE-SET clause applies only to sequential file organization.

Syntax rules for format 4

  1. The level indicator SD identifies the beginning of the sort-file description entry and must precede the file-name.

  2. The clauses following the name of the file are optional and may appear in any order.

  3. One or more record description entries for data-name-1,... must follow the sort-file description entry.

  4. The associated record description entries must be of the category alphabetic, alphanumeric, national or numeric.

  5. If the GLOBAL clause is specified in the file description entry, the data items referenced in the clauses of the sort description entry may not be defined in a LOCAL-STORAGE SECTION.

General rules for format 4

  1. sort-file-name indicates the sort-file.

  2. data-name-1... in the DATA RECORDS clause refer to records described in the record description entries associated with this sort-file description (SD) entry.

  3. The FILE SECTION must contain a sort-file description entry for each sort-file, i.e. for each file that is supplied as the first operand within a SORT or MERGE statement.

  4. The RECORDING MODE clause specifies the organization format of data on external devices.

  5. The LABEL RECORDS clause is optional; however, if it is not specified LABEL RECORDS ARE OMITTED is assumed. This means that existing labels will be overwritten.

  6. When the LABEL RECORDS ARE STANDARD clause is specified, the work tapes must have standard labels for sorting purposes; however, label handling is not performed. In this case, the labels are retained intact.

  7. The DATA RECORDS clause specifies the names of the records on the file to be sorted.

  8. If more than one data-name is present, the file contains two or more types of records. These records may differ in length, format etc. They may be listed in any order.

  9. If more than one record description is specified for the logical record of a file, these records automatically occupy the same internal storage area; this is equivalent to an implicit redefinition of the area.

  10. The RECORDING MODE, DATA RECORDS and RECORD CONTAINS clauses are optional, as the compiler can determine the modes, names and sizes of the records from the associated record descriptions.

  11. If any of the record descriptions associated with the sort-file description contains an OCCURS clause with the DEPENDING ON phrase, variable-length records are assumed (for further information on assumptions made by the compiler when the RECORDING MODE clause is omitted, see "RECORDING MODE clause" ).

  12. Sort-file-names may only be used in the SORT, MERGE and RETURN statements.