Fortran User's Guide

I/O Error Messages (f77)

The error messages in this section are generated by the Fortran 77 I/O library. The error numbers are returned in the IOSTAT variable if the ERR return is taken.

For example, the following program tries to do an unformatted write to a file opened for formatted output:


      WRITE( 6 ) 1 
      END

and produces error messages like the following:


sue: [1003] unformatted io not allowed
logical unit 6, named 'stdout'
lately: writing sequential unformatted external IO

The following error messages are generated. These same messages are also documented at the end of the man page perror(3F).

If the error number is less than 1000, then it is a system error. See intro (2).

Table A-1 f77 Runtime I/O Messages

Error 

Message 

1000

error in format

Read the error message output for the location of the error in the format. It can be caused by more than 10 levels of nested parentheses or an extremely long format statement. 

1001

illegal unit number

It is illegal to close logical unit 0. Negative unit numbers are not allowed. The upper limit is 231 - 1.

1002

formatted io not allowed

The logical unit was opened for unformatted I/O. 

1003

unformatted io not allowed

The logical unit was opened for formatted I/O. 

1004

direct io not allowed

The logical unit was opened for sequential access, or the logical record length was specified as 0. 

1005

sequential io not allowed

The logical unit was opened for direct access I/O. 

1006

can't backspace file

You cannot do a seek on the file associated with the logical unit; therefore, you cannot backspace. The file may be a tty device or a pipe.

1007

off beginning of record

You tried to do a left tab to a position before the beginning of an internal input record. 

1008

can't stat file

The system cannot return status information about the file. Perhaps the directory is unreadable. 

1009

no * after repeat count

Repeat counts in list-directed I/O must be followed by an * with no blank spaces.

1010 

off end of record

A formatted write tried to go beyond the logical end-of-record. An unformatted read or write also causes this 

1011 

<Not used>

1012 

incomprehensible list input

List input has to be as specified in the declaration. 

1013 

out of free space

The library dynamically creates buffers for internal use. You ran out of memory for them; that is, your program is too big. 

1014 

unit not connected

The logical unit was not open. 

1015 

read unexpected character

Certain format conversions cannot tolerate nonnumeric data. 

1016 

illegal logical input field

logical data must be T or F. 

1017 

'new' file exists

You tried to open an existing file with status='new'. 

1018 

can't find 'old' file

You tried to open a nonexistent file with status='old'. 

1019 

unknown system error

This error should not happen, but.. 

1020 

requires seek ability

Attempted a seek on a file that does not allow it. I/O operation requiring a seek are direct access, sequential unformatted I/O, and tabbing left.

1021 

illegal argument

Certain arguments to open and related functions are checked for legitimacy. Often only nondefault forms are checked 

1022 

negative repeat count

The repeat count for list-directed input must be a positive integer. 

1023 

illegal operation for unit

Attempted an I/O operation that is not possible for the device associated with the logical unit. You get this error if you try to read past end-of-tape, or end-of-file. 

1024 

<Not used>

1025 

incompatible specifiers in open

Attempted to open a file with the 'new' option and the access='append' option, or some other invalid combination. 

1026 

illegal input for namelist

A namelist read encountered an invalid data item. 

1027 

error in FILEOPT parameter

The FILEOPT string in an OPEN statement has bad syntax.

1028 

WRITE to readonly file

Attempt to write on a unit that was opened for reading only. 

1029 

READ from writeonly file

Attempt to read from a unit that was opened for writing only. 

 1030

overflow converting numeric input

Integer input data is too large for the corresponding input variable 

 1032

exponent overflow on numeric input

The floating-point input data is too large to be represented by the corresponding input variable.