Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Describing the input to sorting or merging

Describe the input file or files for sorting or merging by following the procedure below.

  1. Write one or more SELECT clauses in the FILE-CONTROL paragraph of the ENVIRONMENT DIVISION to name the input files. For example:

    ENVIRONMENT DIVISION.
    INPUT-OUTPUT SECTION.
    FILE-CONTROL.
        SELECT Input-File ASSIGN TO InFile.

    Input-File is the name of the file in your program. Use this name to refer to the file.

  2. Describe the input file (or files when merging) in an FD entry in the FILE SECTION of the DATA DIVISION. For example:

    DATA DIVISION.
    FILE SECTION.
    FD  Input-File 
        RECORD CONTAINS 100 CHARACTERS.
    01  Input-Record   PIC X(100).

related tasks
Coding the input procedure
Requesting the sort or merge

related references
FILE SECTION entries


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)