Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

reading very long text lines in Fortran

14 views
Skip to first unread message

Lynn McGuire

unread,
Aug 14, 2018, 7:11:05 PM8/14/18
to
I am opening a text file with up to 4,096 characters per line. But a
line length could be zero. I am using the Open Watcom 1.9 Fortran 77
compiler and libraries. I am getting an IO-27 error when trying to read
a line (that is not 4,096 characters).

Here is file opening code:

OPEN (UNIT = infile,
* FILE = INPATH,
* ACTION = 'READ',
* ACCESS = 'SEQUENTIAL',
* STATUS = 'OLD',
* FORM = 'FORMATTED',
* IOSTAT = OPERR,
* ERR = 500)

Here is the code for reading a line (worked fine with 80 characters):

character*1 mm (4096)

READ (INFILE, 11203, END=999) (MM (i), i = 1, inputlinelength4096)
11203 FORMAT(4096A1)

I am getting this error from the Watcom runtime:

*ERR* IO-27 formatted record or format edit descriptor is too large for
record size

The file that I am reading is 1,018 characters long.

What am I screwing up ?

Thanks,
Lynn

Lynn McGuire

unread,
Aug 14, 2018, 7:12:27 PM8/14/18
to
I have also tried using a single character string:

character*4096 oneline

READ (INFILE, 11203, END=999) oneline
11203 FORMAT(A)

I get the same IO-27 runtime error.

Thanks,
Lynn

Lynn McGuire

unread,
Aug 15, 2018, 9:23:12 PM8/15/18
to
On 8/14/2018 6:11 PM, Lynn McGuire wrote:
I found out via experimentation that the internal limit is 1024
characters. So I am working with 1024 characters for now.

Lynn

0 new messages