Defining Work File Records

The File Media field on the Work File Definition form determines how the work file accesses or writes records. In some cases, the media also determines how a file and its records are delimited. For example, a sequential file does not have return characters after each record; the record and each field in the record is a fixed length.

After selecting a File Media type, instructions are provided for further structuring file records and delimiters, where applicable.

Note: If you are defining a sort file (Yes is selected next to Sort File on the Work File Definition form), skip this section.

To define work file records

  1. In the File Media field on the Work File Definition form, press Select (F4).
  2. Choose a File Media type, as described in the following table.
    File media Explanation Index required
    Printer A line sequential file. Each line is delimited with return characters. Only Printer work files appear in Print Manager. No
    Sequential A flat file with fixed-length records. Records are not delimited with return characters. No
    Index Seq Indexed Sequential Access Method (ISAM) file. The program can read and write records sequentially or based on a user-defined index.

    Yes

    For instructions, see Defining a Work File Index.

    Random Random access file. The program can read and write records sequentially or based on a relative record number. No
    Ext Seq

    A flat file with fixed length records.

    All numeric fields are redefined as alphanumeric, with an extra trailing character for sign. Decimal fields are not compressed.

    No
    Ext Seq (continued) Use this file type to import data from an export file; for example, reading a file built by a desktop spreadsheet program.
    Tape

    A line sequential file, with return character delimited, variable-length records.

    Note: A work file with media type Tape is written to or read from a disk; it is not directly written to or read from a tape. The file is formatted for future transfer to tape.
    No
    CSV A CSV file. Press Define (F6) to define the attributes of the CSV file. For more information, see Defining CSV Files. No
  3. In the File Record field, select Yes or No.

    Yes indicates that the work file stores the entire record in one field. You must enter one name, type, and size to define the record.

    No indicates that the work file record is to be broken into separate fields. You can copy a database file definition, select certain elements from database files, or enter your own names, types, and sizes for fields.