Reade in ile

1215 pts.
Tags:
Read Equal Key
READE
RPG
RPG 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?

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following