Reading a file twice in a CL program

20 pts.
Tags:
AS/400
CL400.CL
In a certain CL program, in the first part, I've read the total file and reached EOF, in the second part of the same program I want to traverse the file again for some reason. How can I do that?

Answer Wiki

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

Have you tried the POSDBF command?

After your reach EOF use CLOSE CL command. The next RCVF command to the file will cause it to be re-opened at the start.
Bruce Vining

Discuss This Question: 2  Replies

 
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
  • ToddN2000
    Never tried it but have you tried opening with (OPNQRYF)  then close with (CLOF). Do your other tasks then reopen with (OPNQRYF) and (CLOF) when done?
    11,790 pointsBadges:
    report
  • abhisheka1
    Create two members of the file with same no of records.read Member1 CLOF, Override member2 then read file again have not checked in system but ideally it should work...

    385 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