What is the usage of OVRDBF in CLP?

150 pts.
Tags:
AS/400
CLP
OVRDBF
In below example whether FILE need to defined. OVRDBF FILE(INPUT) TOFILE(xxxx/QRPGSRC) MBR(XXX). What would be the result of the command?

Answer Wiki

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

In the example you listed , INPUT is the actual file named in the program. The to file attribute would be the LIBRARY/NEWFILE and MBR is the member of that new file.

We use this for setting up things like our FTP process
OVRDBF     FILE(INPUT) TOFILE(MYSRC022/QCLSRC) MBR(FTPOHIO)

For more info on the command read the IBM documentation here

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.
  • Anshan

    Dear Todd, Thank you very much for your reply. Yes, I have found this in FTP file download program which I mentioned below. Can you Please explain how this program works.

    CLRPFM     FILE(A/B) MBR(C)

    this will clear the member C


    OVRDBF     FILE(INPUT) TOFILE(A/B)   
               MBR(D)

    Is this statement create new file INPUT with A/B file D member's record ?                                   

    OVRDBF     FILE(OUTPUT) TOFILE(A/B) +         
               MBR(C)

    since member C cleared at 1st statement, what is the purpose of this Statement?

                                      
    STRTCPFTP  RMTSYS('1.1.1.61')

    How ftp command trigger in this statement?

                               
    RCLRSC

    Is this statement clear the allocated memory space?

    Thanking you in Advance                                                    

    150 pointsBadges:
    report
  • ToddN2000
    The INPUT file contains the FTP commands, something like this.

    open SYSTEM                     
    user testuser  mypwd              
    bin                               
    PUT qgpl/ourdta033   qgpl/newdta033
    close                             
    QUIT                              

    The other file OUTPUT is for catching the FTP log of the steps and any errors that may have occurred.
    105,630 pointsBadges:
    report
  • azohawk
    OVRDBF     FILE(INPUT) TOFILE(A/B)   
               MBR(D)

    Is this statement create new file INPUT with A/B file D member's record ?     File B in Library A and Member D must already exist. This command will use this member D in place of File "input" whenever file File "input" is requested (read, update, write, etc.)                              

    OVRDBF     FILE(OUTPUT) TOFILE(A/B) +         
               MBR(C)

    since member C cleared at 1st statement, what is the purpose of this Statement?  This will not use member C instead of file "output" as I stated above.  The CLRPFM command, cleared the contents of member C, but did not delete member C.  

    It would appear (presuming that both statements are in the same program) that another probram is populating member D with data. There is likely a call in the program (not shown) that is pulling data from member D, doing something with that data and writing it to member C. Some other program is utilizing the data in member C. But everytime this program runs, the data in member C is deleted (not the member C) and repopulated.

                                      
    STRTCPFTP  RMTSYS('1.1.1.61')

    How ftp command trigger in this statement?

    This is starting the an FTP call to system 1.1.1.61  (simimilar to a PC DOS command FTP 1.1.1.61

    RCLRSC

    Is this statement clear the allocated memory space? Partially.  See https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_73/cl/rclrsc.htm

    "(RCLRSC) command is intended for use by the controlling program in an application to free resources that were allocated by programs that have finished running and returned control to the controlling program."

    When Programs run, they put a (what I call a) softlock on the file, if you utilize the *INLR consitantly in your RPG programs, this may not be needed. But it does make sure that any resources used by called programs are freed up. I find that sometimes when I run a program that blows up, when I try to rerun it there are errors indicating that a file or other object is locked by my previous program run. RCLRSC will free up those resources so I can rerun the program.

    3,515 pointsBadges:
    report
  • GregManzo
    The OVRDBF command doesn't do much of anything of itself right away, but it leaves an entry in the File Override list that will be respected by subsequent OPEN instructions.
    The nearest equivalent I can think of in a Windows (tm) environment would be using pipelines to redirect standard input or output to a specific file.
    The OVRxxx command itself wont create or change the file in any way, but later when the program code tries to open "INPUT", it will actually open file A/B member D.
    Yes, it slows down the OPEN a little bit - the price of flexibility - but you can minimise the impact by cleaning up overrides (DLTOVR), not after the file is closed, but after it is opened. Once the file is open the OVRxxx is no longer needed.
    2,650 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: