FD

Define the file descriptions for input and output files, including report files.
Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.

Syntax: for Format 1

 FD     inputfilename|outputfilename
        [Applicable COBOL FD clauses]

Syntax: for Format 2

 FD     filename
        [Applicable COBOL FD clauses]
        REPORT IS|REPORTS ARE reportname1 [... reportname15]

Comments:

  • Use one FD keyword per file description.
  • In Format 1, follow each file description with the file record description, using the 01, DS, or REC keywords.
  • In Format 2
    • Reportnames may be in any order.
    • Each Reportname must have a corresponding RED statement. Reportnames in both statements must be identical.
    • The RED statement for each report replaces the file record description entry required for Format 1.
    • The default size for a report record is 133. To define a different report record size in your FD statement, calculate the size as follows, and code it in a RECORD CONTAINS clause.

      Record Size = Report mock-up size (maximum 247 characters) + 1 byte for carriage control + 2 bytes for the CODE clause, if used.

    • If you define the report record in the WRITE ROUTINE clause, the default size is either 248 or 250. See WRITE ROUTINE.
    • AMB generates the file description 01-level identifier(s) for each report output file(s); you need not code them.
    • If reportname exceeds 20 characters, Report Writer creates an abbreviated record name, as follows: The first character of each hyphenated word in the data name (except the last word), a hyphen, the last word, a hyphen, and RECORD. For example,
      Input REALLY-LONG-REPORT-NAME
      Output RLR-NAME-RECORD 

Example:

 FD     INPUT-FILE
        LABEL RECORDS ARE STANDARD
        BLOCK CONTAINS 0 RECORDS.
 01     PART-STOCK-REC             PIC X(80).
 FD     REPORT-OUTPUT-FILE
        LABEL RECORDS ARE STANDARD
        REPORT IS STOCK-REPORT.