PSS ID Number: 118393
Article Last Modified on 5/5/2001
11.
***
22.
33.
Normal print after read 1. iostat= 0 data(1): 11.000000 Error from read 2. Normal print after read 3. iostat= 0 data(3): 22.000000 Normal print after read 4. iostat= 0 data(4): 33.000000 Printing out data data( 1) = 11.000000 data( 2) = 99.000000 data( 3) = 22.000000 data( 4) = 33.000000 Stop - Program terminated.Both PowerStation for MS-DOS and PowerStation 32 for Windows NT produce the expected output. However the FORTRAN 5.1 produces the following:
Normal print after read 1. iostat= 0 data(1): 11.000000 Error from read 2. Normal print after read 3. iostat= 0 data(3): 0.000000E+00 Normal print after read 4. iostat= 0 data(4): 22.000000 Printing out data data( 1) = 11.000000 data( 2) = 99.000000 data( 3) = 0.000000E+00 data( 4) = 22.000000 Stop - Program terminated.
C Compile options needed: none
REAL*4 data(4)
DATA data /4*99./
OPEN(15, file="Data")
READ(15, "(f3.0)", ERR=10, END=90, IOSTAT=i) data(1)
PRINT*, "Normal print after read 1. ",
+"iostat=", i, " data(1): ", data(1)
GOTO 15
10 PRINT*, "Error from read 1."
15 READ(15, "(f3.0)", ERR=20, END=90, IOSTAT=i) data(2)
PRINT*, "Normal print after read 2. ",
+"iostat=", i, " data(2): ", data(2)
GOTO 25
20 PRINT*, "Error from read 2."
25 READ(15, "(f3.0)", ERR=30, END=90, IOSTAT=i) data(3)
PRINT*, "Normal print after read 3. ",
+"iostat=", i, " data(3): ", data(3)
GOTO 35
30 PRINT*, "error from read 3"
35 READ(15, "(f3.0)", ERR=40, END=90, IOSTAT=i) data(4)
PRINT*, "Normal print after read 4. ",
+"iostat=", i, " data(4): ", data(4)
goto 999
40 PRINT*, "error from read 4"
GOTO 999
90 PRINT*, "End of file jump."
999 PRINT*, "Printing out data"
DO 1000 i = 1, 4
PRINT*, "data(",i,") = ", data(i)
1000 CONTINUE
STOP
END
Additional query words: 5.10 buglist5.10 fixlist1.00
Keywords: KB118393
Technology: kbAudDeveloper kbFORTRAN510DOS kbFortranSearch kbZNotKeyword3