The TYPE option specifies the format of records in a native file.
.-CRLF-----. >>-TYPE--(-+-LF-------+-)-------------------------------------->< +-TEXT-----+ +-FIXED----+ +-VARLS----+ +-VARLS4X4-+ +-VARMS4X4-+ +-VARMS----+ +-LL-------+ +-LLLS-----+ +-LLZZ-----+ +-CRLFEOF--+ '-U--------'
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.
The data set must not contain any record that is longer than the value determined for the record length of the data set.
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.
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.
Type(VARLS4X4) and Type(VARMS4X4) data sets provide a way to handle FORTRAN sequential unformatted files.
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.
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.
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.