1,025 pts.
 Reade in ile
DEmpnoo S 2 0 Inz(12) C *Loval Setll Emplf C Empnoo Reade Emplf C Dow Not %Eof(Emplf) C Empno Dsply C Empnoo Reade Emplf C Enddo Here emplf is logical file keyed with emp no Data in emplf EMPNO EMPNAME 11 test11 12 test12 13 test14 14 test14 15 test15 setll *loval points first record of the file Then I am trying to read empno 12 After reade statement It reaches end of file REDAE fails here. What is the reason for that?

Software/Hardware used:
ASKED: August 21, 2008  6:57 AM
UPDATED: August 21, 2008  12:46 PM

Answer Wiki:
Hi, You need to SETLL with the same value that you READE with. In your example the SETLL points to the beginning of the file, then the READE tries to read the NEXT record with a key equal to the factor 1 value, but the next record doesn't have 12 as a key, therefore it fails. Typically, If you have multiple keys, you would have a longer key for your SETLL to get an accurate start position, then a shorter key for your READE. Regards, Martin Gilbert.
Last Wiki Answer Submitted:  August 21, 2008  10:14 am  by  Gilly400   23,625 pts.
All Answer Wiki Contributors:  Gilly400   23,625 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _