OVRDBF AT DIFFERENT CALL LEVELS

Tags:
CL programs
OVRDBF
HI ,
     I am using the command 
ovrdbf file(file1) tofile(file2) in the CL program and i am calling an RPG program again in that i want to override the same file(file2) to different members(using qcmdexe).
how to do that?
 
ASKED: November 15, 2009  1:40 PM
UPDATED: November 16, 2009  1:48 PM

Answer Wiki

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

Two issues
- the ovrdbf must be in effect when the file is open
– since you want to change the ovrride during processing use USROPN keyword on the f-spec
- the member can only be over ridden once…dltovr before the ovrdbf command .. but that also looses the file1 to file2 .. so
the RPG program will
1. Close if file if open
2. Delete the override using qcmdexc
3. OVRDBF to override the file and member using qcmdexc
3. open the file
process….

=====================================================

Why override at all? In recent releases, RPG can name which file and member it wants without any overrides at all. See a <a href=”http://itknowledgeexchange.techtarget.com/itanswers/how-to-access-any-perticular-menber-of-any-pf/”>basic example of specifying file and/or member</a> with a constant literal. You can also use variables. If the file variables is 21 bytes long, you can set the value to “LIBRARY/FILENAME” format.

Your RPG can set the variable values before opening the file if the file is USROPN.

Tom

Discuss This Question:  

 
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

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