VMS Help  —  COBOL  DATA_DIVISION, FD file-description-entry
  A file description entry describes the physical structure,
  identification, record names, and names for sequential, relative,
  indexed, and report files.  It also specifies: (1) the internal or
  external attributes of a file connector, and (2) the local or global
  attributes of a file-name.

1  –  sequential FD

  A file description entry describes the physical structure,
  identification, record names, and names for sequential, relative,
  indexed, and report files.  It also specifies: (1) the internal or
  external attributes of a file connector, and (2) the local or global
  attributes of a file-name.

  Format 1 - Sequential File

  FD file-name
    [IS EXTERNAL]
    [IS GLOBAL]

  [BLOCK CONTAINS [smallest-block TO] blocksize { RECORDS    }]
  [                                             { CHARACTERS }]

  [RECORD { CONTAINS [shortest-rec TO] longest-rec CHARACTERS          }]
  [       { IS VARYING IN SIZE [FROM shortest-rec]
                                       [ TO longest-rec ]  CHARACTERS
                                       [ DEPENDING ON depending-item ] }]

  [LABEL { RECORDS ARE } { STANDARD } ]
  [      { RECORD IS   } { OMITTED  } ]

  [VALUE OF ID IS file-spec]

  [DATA { RECORDS ARE } {rec-name} ... ]
  [     { RECORD IS   }                ]

  [ LINAGE IS page-size LINES [ WITH FOOTING AT footing-line ]
          [ LINES AT TOP top-lines ] [ LINES AT BOTTOM bottom-lines ] ]

  [CODE-SET IS alphabet-name]

  [ [ ACCESS MODE IS ] SEQUENTIAL ]

  [FILE STATUS IS file-stat] .

2  –  relative FD

  A file description entry describes the physical structure,
  identification, record names, and names for sequential, relative,
  indexed, and report files.  It also specifies: (1) the internal or
  external attributes of a file connector, and (2) the local or global
  attributes of a file-name.

  Format 2 - Relative File

  FD file-name
    [IS EXTERNAL]
    [IS GLOBAL]

  [BLOCK CONTAINS [smallest-block TO] blocksize { RECORDS    }]
  [                                             { CHARACTERS }]

  [RECORD { CONTAINS [shortest-rec TO] longest-rec CHARACTERS          }]
  [       { IS VARYING IN SIZE [FROM shortest-rec]
                                       [ TO longest-rec ]  CHARACTERS
                                       [ DEPENDING ON depending-item ] }]

  [LABEL { RECORDS ARE } { STANDARD } ]
  [      { RECORD IS   } { OMITTED  } ]

  [VALUE OF ID IS file-spec]

  [DATA { RECORDS ARE } {rec-name} ... ]
  [     { RECORD IS   }                ]

  [               { SEQUENTIAL [ RELATIVE KEY IS rel-key ] }]
  [ACCESS MODE IS { { RANDOM  }  RELATIVE KEY IS rel-key   }]
  [               { { DYNAMIC }                            }]

  [FILE STATUS IS file-stat] .

3  –  indexed FD

  A file description entry describes the physical structure,
  identification, record names, and names for sequential, relative,
  indexed, and report files.  It also specifies: (1) the internal or
  external attributes of a file connector, and (2) the local or global
  attributes of a file-name.

  Format 3 - Indexed File

  FD file-name
    [IS EXTERNAL]
    [IS GLOBAL]

  [BLOCK CONTAINS [smallest-block TO] blocksize { RECORDS    }]
  [                                             { CHARACTERS }]

  [RECORD { CONTAINS [shortest-rec TO] longest-rec CHARACTERS          }]
  [       { IS VARYING IN SIZE [FROM shortest-rec]
                                       [ TO longest-rec ]  CHARACTERS
                                       [ DEPENDING ON depending-item ] }]

  [LABEL { RECORDS ARE } { STANDARD } ]
  [      { RECORD IS   } { OMITTED  } ]

  [VALUE OF ID IS file-spec]

  [DATA { RECORDS ARE } {rec-name} ... ]
  [     { RECORD IS   }                ]

  [               { SEQUENTIAL }]
  [ACCESS MODE IS { RANDOM     }]
  [               { DYNAMIC    }]

  [RECORD KEY IS { rec-key | seg-key = {seg}... }               ]
  [                              [WITH DUPLICATES] [ASCENDING ] ]
  [                                                [DESCENDING] ]

  [ALTERNATE RECORD KEY IS { alt-key | seg-key = {seg}... }     ]
  [                              [WITH DUPLICATES] [ASCENDING ] ]
  [                                                [DESCENDING] ] ...

  [FILE STATUS IS file-stat] .

4  –  report FD

  A file description entry describes the physical structure,
  identification, record names, and names for sequential, relative,
  indexed, and report files.  It also specifies: (1) the internal or
  external attributes of a file connector, and (2) the local or global
  attributes of a file-name.

  Format 4 - Report File

   FD file-name
     [IS EXTERNAL]
     [IS GLOBAL]

  [BLOCK CONTAINS [smallest-block TO] blocksize { RECORDS    }]
  [                                             { CHARACTERS }]

  [RECORD { CONTAINS [shortest-rec TO] longest-rec CHARACTERS          }]
  [       { IS VARYING IN SIZE [FROM shortest-rec]
                                       [ TO longest-rec ]  CHARACTERS
                                       [ DEPENDING ON depending-item ] }]

  [LABEL { RECORDS ARE } { STANDARD } ]
  [      { RECORD IS   } { OMITTED  } ]

  [VALUE OF ID IS file-spec]

  [ [ACCESS MODE IS] SEQUENTIAL]

  { REPORT IS   } {report-name} ...
  { REPORTS ARE }

  [CODE-SET IS alphabet-name]

  [FILE STATUS IS file-stat] .
Close Help