Reade in ile
480 pts.
0
Q:
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?
ASKED: Aug 21 2008  6:57 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
23625 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button

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 Answered: Aug 21 2008  10:14 AM GMT by Gilly400   23625 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0