Override to a Logical File

35 pts.
Tags:
CL programming
Logical Files
PF
hi, I am trying to create an override to a logical file. I have a PF File A which has a logical AL1. My CL program can run in a build/copy mode where Build would just build the work file and copy would build & copy the workfile etc. The CL has an override to A called B and then calls the RPGLE program. The RPGLE program prepares the workfiles and does updates/deletes on A & AL1 but since A has been overrided to B it looks at B but still deletes/updates logical AL1. I have tried creating a LF and overriding this or using CRTDUPOBJ but data still gets deleted from logical. Can someone please help

Answer Wiki

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

Hi Ninoo

Here’s my final answer.
1. Create file B
2. ADDLFM (add logical file member )to file AL1 named BL1 target file B
3. OVRDBF A to B
4. OVRDBF AL1 to AL1 member BL1
5. Call RPG program
6. DLTOVR A, AL1
6. RMVM BL1 from file AL1
7. DLTF B

Phil

//////////////////////
Ninoo

Use CHGLF AL1 to set max number of members to 2 or more
then do these instructions. Working with two physical files B and B2 isn’t right.

Phil

Discuss This Question: 4  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
  • Ninoo
    hi Phil thanks for the answer. So can i create a logical file member in the CL using ADDLFM?
    35 pointsBadges:
    report
  • Ninoo
    hi Phil I tried that but the logical fie AL1 is a single member file so cant add a logical file to it. Would CRTDUPOBJ help here?
    35 pointsBadges:
    report
  • Ninoo
    hi phil I finally copied Logical AL1 to PF B2 and then did an override of AL1 to B2 which seems to work since the deletes & updates have occurred on my override B2 and A1 & A remain unchanged but I would have preferred to use the ADDLFM . thanks for your help & any advice would really be appreciated. thanks !!!!!!! Ninooo
    35 pointsBadges:
    report
  • Gilly400
    Hi, If you have a logical file AL1 which is based on physical file A and you then delete records from A, then you also delete records from AL1. A logical file is only another "view" of the data in th physical file. Regards, Martin Gilbert.
    23,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