Read backword in CL/400

5 pts.
Tags:
CL
CL/400
Physical File
How to read backword a physical file in CL400.

Answer Wiki

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

Hi,

There is no read backward command in CL. You may be able to trick the CL into reading the file in reverse order by using OPNQRYF. If you do this, then you will *only* be able to read the file backwards in your CL.

Regards,

Martin Gilbert.

Or you can create an LF with descending key and use this file in your CL.

Rudolf

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
  • RamvishakRamesh
    OPNQRYF there is a parameter Keyfield order, give *DESCEND in that. 2. First find the total number of records from RTVMBRD and Move that to field RRN. Then OVRDBF filename Pointer = &RRN. RCVF Rcdfmtname. Then RRN = RRN -1 again OVRDBF 3. Use an LF with descending Key and use this LF in the program.
    2,505 pointsBadges:
    report
  • bvining
    Or use the command Read Record using CLF (READRCDCLF), which supports reading the previous record with TYPE(*PRV). The command documentation can be found here. CLF provides a no-charge run-time which includes support for READRCDCLF. Vendor response: Your productivity can be improved by using the optional CLF precompiler, which does have a charge. End of vendor response Bruce Vining
    6,475 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