*Loval Setll positioning to last record

20 pts.
Tags:
LOVAL SETLL
RPG/400
I have a very simple program which is reading records from a work file for writing to a subfile but the *Loval Setll is positioning to the last record in the file instead of the first. When I do my subsequent READ, I am getting %EOF. I have checked %ERROR (0) and %STATUS (0) after the SetLL but still am getting positioned to the last record. The file is not defined with descending keys so I am baffled as to why this is happening. Would someone please help? I am including the Fspec and Cspecs. FARWRKTRN UF A E K Disk UsrOpn prefix(awt) C *Loval SetLL ARWRKTRN Thank you in advance for your assistance!
ASKED: August 22, 2008  4:17 PM
UPDATED: August 25, 2008  12:49 PM

Answer Wiki

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

Hi,

Are you sure that you are looking at the right file? Do you have an override or OPNQRY on the file?

Regards,

Martin Gilbert.

Discuss This Question: 1  Reply

 
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
  • Taborly08
    Thank you for replying, Gilly. Turns out I was doing a Chain before my read and since the SetLL did not populate the key fields, it was failing. What looked like the last record's key was the value from the last write that I did. Thanks again for your reply. It's nice to have a resource like this available.
    20 pointsBadges:
    report

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