AS/400: Use of OVRDBR command

450 pts.
Tags:
AS 400
CL Program
What is the use of OVRDBF command and when can I use it in CL program?

Answer Wiki

Thanks. We'll let you know when a new response is added.
Enter the command in a CL program and prompt it. Then do an F1 for additional help and view the explanation.

Discuss This Question: 14  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.
  • TheRealRaven
    This reads like a quiz question. Since help text and system documentation provide the answer, please post your understanding, and we'll try to guide past misconceptions.
    28,445 pointsBadges:
    report
  • vivekntt21
    Through my understanding is it like Copying records from one file to another file is that correct?
    450 pointsBadges:
    report
  • Splat
    vivekntt21, that would not be correct.
    12,650 pointsBadges:
    report
  • GregManzo
    Not even close. A better equivalent would be pipe-redirection, but it does so much more. eg: with the INHWRT() parameter you can run an update program and the OS will catch the updates and prevent them from reaching disk.
    And if all you want is to redirect your I/O to a different file, you don't even need OVRDBF any more - you can get the same result from F-specs in your RPG program. Your course material may be somewhat dated...
    2,845 pointsBadges:
    report
  • vivekntt21
    Sorry I didn't get your explanation, could you please explain with example how OVRDBF command is used?
    450 pointsBadges:
    report
  • GregManzo
    1) If we just give you all the answers to your homework you won't learn anything and we will have done you a disservice, so no example. You'll just have to try it out for yourself. Prompt the command and read the help text for each parameter to see what they will do. The more mistakes you make, the faster you will learn.
    2) If you use something like this in RPG you don't even need an OVRDBF:
    FBaseFile  IF   E           K DISK    EXTFILE('QTEMP/MYFILE')  
    3) You can use an OVRDBF at any time in your CL and it wont have any noticeable effect, all it does is leave an entry in an internal space that gets checked whenever any program in your job opens a file. At that point it will take effect if appropriate. Because every open checks this space the open interface is a little faster if the space is empty, so for improved performance try to avoid using OVRxxx if possible, and use DLTOVR as soon as practicable afterwards.
    2,845 pointsBadges:
    report
  • Subhendu Sen
    This command helps to use some other file for the one actually named to be used in the program, while it also can override the attribute of a physical file. Please look at this link for better concepts: https://www.ibm.com/support/knowledgecenter/en/ssw_i5_54/cl/ovrdbf.htm

    118,540 pointsBadges:
    report
  • GregManzo
    If we just give you all the answers to your homework you won't learn anything and we will have done you a disservice, so no example. Follow the link above or prompt the command and read the help text for each parameter to see what they will do. The more mistakes you make, the faster you will learn.
    2,845 pointsBadges:
    report
  • GregManzo
    If you use something like this in RPG you don't even need an OVRDBF:
    FBaseFile  IF   E           K DISK    EXTFILE('QTEMP/MYFILE')  
    2,845 pointsBadges:
    report
  • GregManzo
    You can use an OVRDBF at any time in your CL and it wont have any noticeable effect, all it does is leave an entry in an internal space that gets checked whenever any program in your job opens a file. At that point it will take effect if appropriate. Because every open checks this space the open interface is a little faster if the space is empty, so for improved performance try to avoid using OVRxxx if possible, and use DLTOVR as soon as practicable afterwards.
    2,845 pointsBadges:
    report
  • TheRealRaven
    The RPG example above will work, though it doesn't quite address what OVRDBF will do. Use of a variable rather than the literal constant 'QTEMP/MYFILE' would be one small step closer. Of course, it doesn't apply to C, COBOL, CL, REXX nor SQL, nor does it touch on the effect of overrides on other programs in the same activation group or job. (Nor does touch on when overrides are not effective.)

    That all gets to why trying to tutor in an on-line forum can be difficult. The question is too broad. The subject is too large.
    28,445 pointsBadges:
    report
  • ToddN2000
    It can come in handy when you want to use a program that uses multiple file using the same EXACT format and not have to create and maintain separate programs. As an example I worked for a company a while back that had the same similar file and sometime in different libraries. We had just one program the we maintained and through user menu options we used the OVRDBF to point to the correct file/library.
    113,660 pointsBadges:
    report
  • TheRealRaven
    Exact match in format, nor even similar match, is not required. Generic processing of dissimilar files has been one somewhat common use of OVRDBF.

    And that gets into another area that illustrates why this isn't very appropriate for this forum.
    28,445 pointsBadges:
    report
  • WoodEngineer
    Be aware of the Override Scope parm on the OVRDBF command.  Unpredictable results may occur if this is incorrect for your environment.
    8,140 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.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: