Rational Developer for System z
PL/I for Windows, Version 8.0, Programming Guide

TYPE

The TYPE option specifies the format of records in a native file.

Read syntax diagramSkip visual syntax diagram           .-CRLF-----.
>>-TYPE--(-+-LF-------+-)--------------------------------------><
           +-TEXT-----+
           +-FIXED----+
           +-VARLS----+
           +-VARLS4X4-+
           +-VARMS4X4-+
           +-VARMS----+
           +-LL-------+
           +-LLLS-----+
           +-LLZZ-----+
           +-CRLFEOF--+
           '-U--------'
 
CRLF
Specifies that records are delimited by the CR - LF character combination. ('CR' and 'LF' represent the ASCII values of carriage return and line feed, '0D'x and '0A'x, respectively. See restrictions on ***) For an output file, PL/I places the characters at the end of each record; for an input file, PL/I discards the characters. For both input and output, the characters are not counted in consideration for RECSIZE.

The data set must not contain any record that is longer than the value determined for the record length of the data set.

This is the default for ISAM and BTRIEVE.

LF
Specifies that records are delimited by the LF character combination. ('LF' represents the ASCII values of feed or '0A'x. See restrictions on ***) For an output file, PL/I places the characters at the end of each record; for an input file, PL/I discards the characters. For both input and output, the characters are not counted in consideration for RECSIZE.

The data set must not contain any record that is longer than the value determined for the record length of the data set.

TEXT
Equivalent to CRLF.
FIXED
Specifies that each record in the data set has the same length. The length determined for records in the data set is used to recognize record boundaries.

All characters in a TYPE(FIXED) file are considered as data, including control characters if they exist. Make sure the record length you specify reflects the presence of these characters or make sure the record length you specify accounts for all characters in the record.

VARLS|VARMS
Indicates that records have a 2-byte prefix that specifies the number of bytes in the rest of the record.

For VARLS, the length prefix is in little endian format. These records look like NATIVE CHAR VARYING strings.

For VARMS, the length prefix is in big endian format. These records look like NONNATIVE CHAR VARYING strings.

TYPE(VARLS) data sets provide the fastest way to use PL/I to read and write data sets containing records of variable length and arbitrary byte patterns. This is not possible with TYPE(CRLF) data sets because when a record is read that was written containing the bit string '0d0a'b4, a misinterpretation occurs.

TYPE(VARMS) data sets provide a way to read SCALARVARYING files downloaded from the mainframe.

VARLS4X4|VARMS4X4
Indicates that records have a 4-byte prefix and a 4-byte suffix. The prefix and suffix each contain the number of bytes in the rest of the record. This number does not include either the 4 bytes used by the prefix or the 4 bytes used by the suffix.
For VARLS4X4, the data is in little endian format, which is used on a PC.
For VARMS4X4, the data is in big endian format, which is downloaded
from the z/OS or AIX system.

Type(VARLS4X4) and Type(VARMS4X4) data sets provide a way to handle FORTRAN sequential unformatted files.

LL|LLLS
Indicates that records have a 2-byte prefix that specifies the total number of bytes in the record (including the prefix).

TYPE(LL) data sets provide a way to read files downloaded from the mainframe with a tool (see VRECGEN.PLI sample program) that appends 2 bytes. The length is in big endian format.

TYPE(LLLS) data sets provide a way to read files downloaded from the PC. The length is in little endian format.

LLZZ
Specifies that records have a 4-byte prefix held the same way as varying records on S/390.

The LLZZ suboption provides a way to read and write data sets that contain records of variable length and arbitrary byte patterns. This does not apply to TYPE(CRLF) data sets. Under CRLF, a written record containing the bit string '0d0a'b4 is misinterpreted when it is read.

A TYPE(LLZZ) data set must not contain any record that is longer than the value determined for the record length of the data set.

CRLFEOF
Except for output files, this suboption specifies the same information as CRLF. When one of these files is closed for output, an end-of-file marker is appended to the last record.
U
Indicates that records are unformatted. These unformatted files cannot be used by any record or stream I/O statements except OPEN and CLOSE. You can read from a TYPE(U) file only by using the FILEREAD built-in function. You can write to a TYPE(U) file only by using the FILEWRITE built-in function.

The TYPE option applies only to CONSECUTIVE files, except that it is ignored for printer-destined files with ASA(N) applied.

If your program attempts to access an existing data set with TYPE(FIXED) in effect and the length of the data set is not a multiple of the logical record length you specify, PL/I raises the UNDEFINEDFILE condition.

When using non-print files with the TYPE(FIXED) attribute, SKIP is replaced by trailing blanks to the end of the line. If TYPE(CRLF) is being used, SKIP is replaced by CRLF with no trailing blanks.

Rational Developer for System z
PL/I for Windows, Version 8.0, Programming Guide