Setting lower limits In CL

1,780 pts.
Tags:
CL
CL Commands
RPG
SETLL
I know how to declare a file and read through the data in CL....but how can you reset it? Like setll in CL. I have searched and searched but nothing works. I have closed opend...etc.. Any ideas? Example: PGM DCLF FILEA Loop: RCVF FILEA If %EOF ne '0' DO Goto Loop: Enddo. Now I want to read through it again for something else here... ???????? ENDPGM
ASKED: March 17, 2009  3:32 PM
UPDATED: March 19, 2009  1:21 AM

Answer Wiki

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

Hi,

Have you tried POSDBF?

Regards,

Martin Gilbert.

Yes I have. That does not work either. Its like once its at end of file there is no way to reset it.

Thanks
Ron

There is another suggestion as per one of the forums. Try this and see.

1. Use the Number of current records (NBRCURRCD) parameter of the Retrieve Member Description (RTVMBRDR) command to determine the number of active records in the member.

2. Override the database file to SHARE(*YES). This establishes an open data path (ODP) and allows the Position Database File (POSDBF) command to function properly.

3. Use the Open Database File (OPNDBF) to establish a file ID link that can be referenced by POSDBF.

4. Count the records as you process them.
5. When the record counter matches the number of active records, you have processed the last record. Use the POSDBF command to reset the file pointer to the first record.

Be aware that this technique won’t work correctly if other jobs are adding records to the file, or deleting records from the file, at the same time

Regards,

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
  • graybeard52
    Another workaround that works in some cases is to declare a second file and point it to the same file. Since you can only declare 5 files in CL, this works for up to 5 reads. For more than 5 reads, you probably will want to re-write the applicaton using either RPG or another way . CL is not really designed for reading files.
    3,115 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