The formatted lengths of the output from list-directed formatting for the various data types is listed in “WRITE Statement — List-Directed I/O to External Devices” in VS FORTRAN Version 2 Language and Library Reference. For namelist formatting, the lengths of the data are the same.
The maximum length of a record that can be written on a particular file depends on the values of certain specifiers given on the OPEN statement and on various file characteristics managed by the underlying operating system's access methods. Length is taken from one or more of the following:
When the record format is one of the variable-length formats: (variable (V), variable blocked (VB), variable spanned (VS), or variable blocked spanned (VBS), the maximum length of the data that can be written is four bytes less than the LRECL value.
In certain cases, this value must be consistent with the record length specified previously:
With the maximum record length given as the second sub-parameter of the RECORDSIZE parameter of the Access Method Services DEFINE command that was used to define the cluster.
With the record length given in the RECL specifier on the OPEN statement that was used to create the file.
From the maximum record length given as the second sub-parameter of the RECORDSIZE parameter of the Access Method Services DEFINE command that was used to define the cluster.
From the length of the record or records that comprise the internal file. This is the length of the character variable, of the character substring, or of the character array element that comprises the internal file. For an internal file that is a character array, this is the length of the corresponding character array element.
If either the ERR or the IOSTAT specifier is present on the I/O statement, then before control returns to the program, the record described for the action RN is written.
If neither the ERR nor the IOSTAT specifier is present on the I/O statement, the condition is signaled. If the condition either is unhandled or is handled by moving the resume cursor and resuming, then the record described for the action RN is written. If the condition is unhandled, the enclave stops executing after the record has been written.
Qualifying Data: The basic set of four qualifying data for I/O conditions as shown in Table 1. Within this basic set, statement has a value of READ, and parm_count has a value of 10. In addition, there are these qualifying data:
No. | Name | Input/ Output | Data Type and Length | Value |
---|---|---|---|---|
5 | access | Input | CHARACTER*10 | For an external file, the value SEQUENTIAL, DIRECT, or KEYED, depending on if the file is connected for sequential, direct, or keyed access, respectively. For an internal file, this qualifying datum contains the value SEQUENTIAL. |
6 | fmt-type | Input | CHARACTER*8 | One of the following values to indicate the type of formatting
indicated by the FMT specifier (or its absence) on the WRITE or REWRITE
statement:
|
7 | data_len | Input | INTEGER*4 | Maximum length of the data that can be written into the records in the file during this connection. If this length is controlled by a RECL specifier on the OPEN statement, this qualifying datum has that value given by that RECL specifier. Otherwise, this is the maximum amount of data that can be written in the records in the file. When the record format is one of the variable-length formats, that is, variable (V), variable blocked (VB), variable spanned (VS), or variable blocked spanned (VBS), the length given here is the LRECL value less 4 (unless the RECL specifier had a smaller value). |
Name | Action Taken after Resumption |
---|---|
RN | A record is written, but its length does not exceed the maximum
length allowed for the file, and no additional record is written.
Formatted and unformatted output are handled slightly differently:
Formatted output:
Unformatted output:
In either case, execution then continues. |
RF | This action depends on several factors:
For output using a format specification:
|
RF (cont.) | For list-directed and namelist output:
For unformatted output:
|
For any of the variable-length record formats, that is, for variable (V), variable blocked (VB), variable spanned (VS), or variable blocked spanned (VBS), the length given as LRECL includes a 4-byte record descriptor word. Therefore, the LRECL value must be four bytes larger than the largest amount of data that you want to write in a single record.
If you are writing on an existing file whose previous contents you want to retain, then you generally cannot increase the record length without recreating the file.
The person at your installation who gives system support for Language Environment can change your installation's default values for record format, record length, and block size for various units. This is done by customizing the the Unit Attribute Table. As part of this process, the SFLRECL or SULRECL parameters on the AFHODCBM macro instructions can specify larger default values for formatted or unformatted I/O. Each unit (other than the error message unit) can be given different default values.
FOR1001