How to use a file in a program with 2 key fields so that we can access the file using single key

30 pts.
Tags:
AS400 - COBOL
I am working on a project where I need to delete old transactions from a particular file in a particular library. The file has 2 keys. For deleting the older records, a particular logic flow is followed. The actual delete process is written in a Cobol program. The cobol program is called inside a CL. In the Cobol, the file is referred to as having a single key, however actually it has 2 keys. I tried using OPNQRYF inside the CL, just before calling the Cobol. But still the records are not getting deleted from the file. It appears as if it the OPNQRYF impact is not getting reflected in the Cobol. Can anyone suggest on this?

Software/Hardware used:
IBM AS400

Answer Wiki

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

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
  • philpl1jb

    The CL should also have an ovrdbf for that file with share *yes

    If you're trying to delete from the opnqryf then it needs the open options *INP *DLT

    or Options *ALL

     

     

    49,730 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