I have a bunch of data in a text file , 3rows by 53 spaces per row. I want to read this data into the computer and write it back into a direct access formatted file. The read statement I am using gives me the error message “A direct access READ statement was executed past the end of file”.
The data I am trying to read looks like this:
1 methane CH4 16.043 190.400 46.0000
2 ammonia NH3 17.031 405.500 113.500
3 water H20 18.015 647.300 221.200
The read statement is:
I=2
READ(UNIT=10,FMT=22,REC=I) RECNO(I),COMP(I),FORMULA(I),(D(I,J),J=1,3)
22 FORMAT(I3,A20,A12,3(F6.3))
In the OPEN statement I give a RECL=60. The sum of I3,A20,A12 AND 3(F6.3) = 53
Not sure what the problem is. Anyone can help?
Floyd