Create a Record Layout File

If it knows the layout of the fields, the Data File Editor can display file contents formatted. You create a record layout file from the Data Division of a COBOL program that uses the file. The program must be compiled for the Data File Editor to access the necessary information, which is why it was necessary to compile the demo application at the start of this tutorial.

Our data file, staff.dat, contains three record types: employee, manager, and executive. To differentiate between the types, you define the layout of each type of record, and how to identify the type. Of the three record types, you can define one type as the default; all others are defined as conditional.

  1. In Classic Data File Tools, click File > New.
  2. Select Record Layout; then click OK.
  3. Navigate to the \bin\x86\Debug project subfolder.
  4. Select dfdstaff.idy; then click Open.

    The Record Layout Editor window opens, showing a tree view of the Data Division of dfdstaff.cbl.