Hi
I am writing complex nos. to a file using unformatted sequential WRITE. I am writing these in batches of 310 complex nos. in a loop and then 93 complex nos. in the end.
After all of them have been written, I now need to read them back in reverse order, and I was trying to use BACKSPACE. However, on using BACKSPACE and reading the nos. back in, I get the following error: 110: Unformatted record is corrupt
I understand the complex no. storage is 8 bytes. When 310 complex nos. are written in a single record, 5 bytes are added to the start and end (i dont know exactly why 5 bytes are needed), making the record length to 310x8+10=2490. The end record is 93x8+10=754 long.
These nos. are as per the length of the file created. I am using the following to open the file: OPEN(3,FILE='FOO.FIL',FORM='UNFORMATTED',STATUS='REPLACE')
I have tried to do this operation without the end record and adding RECL=2490 to the OPEN Statement. Result is the same error.
Can somebody please throw some light ?
Thanks Abhishek