## 12.6.27 RECORDTYPE Specifier

The RECORDTYPE specifier indicates the type of records in a file. It takes the following form:

  RECORDTYPE = typ
  typ
  Is a scalar default character expression that evaluates to one of the following values:

  'FIXED' | Indicates fixed-length records.
  'VARIABLE' | Indicates variable-length records.
  'SEGMENTED' | Indicates segmented records.
  'STREAM' | Indicates stream-type variable length records.
  'STREAM_CR' | Indicates stream-type variable length records, terminated with a carriage-return.
  'STREAM_LF' | Indicates stream-type variable length records, terminated with a line feed.

When you open a file, default record types are as follows:

'FIXED' | For relative or indexed files
'FIXED' | For direct access sequential files
'VARIABLE' | For formatted sequential access files
'SEGMENTED' | For unformatted sequential access files

A segmented record is a logical record consisting of one or more variable-length records (segments). The logical record can span several physical records. Only unformatted sequential-access files with sequential organization can have segmented records; 'SEGMENTED' must not be specified for any other file type.

Files containing segmented records can be accessed only by unformatted sequential data transfer statements.

Normally, if you do not use the RECORDTYPE specifier when you are accessing an existing file, the record type of the file is used. However, if the file is an unformatted sequential-access file with sequential organization and variable-length records, the default record type is 'SEGMENTED'.

If you use the RECORDTYPE specifier when you are accessing an existing file, the type that you specify must match the type of the existing file.

If an output statement does not specify a full record for a file containing fixed-length records, the following occurs:

- In formatted files, the record is filled with blanks
- In unformatted files, the record is filled with zeros

For More Information:

For details on record types and file organization, see your user manual.

Previous Page Next Page Table of Contents