× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Jim Wiant wrote:
It's not unusual (unfortunately) that much of our legacy code
will use CPYF like this: (usually to save copies of data before
program execution).
CPYF FROMFILE(file) TOFILE(library/file)
This obviously makes controlled testing difficult. I would like
the target library to be elsewhere.

My constraints are that :
1) I cannot change the code
2) I must run the complete job stream - I can't choose the bits
and pieces I want and customize the rest.

I'm trying to find a way to control this somehow. OVRDBF doesn't help because the file names are the same. I thought of a DDMF in the target library & pointing elsewhere, but of course that's a duplicate file name in that library so I'm stuck again. There is
no OVRLIB (override library) command that I'm away of.

Does anyone have an idea how I could execute some function prior
to calling the offending program that would let me 'override' the
target library?


If all invocations of the CPYF are not library qualified, as shown, then the command can be intercepted with an alternate; i.e. the command will be located in *LIBL. The function to perform before each time the /offending program/ will be called, would be CHGSYSLIB to add the library with the alternate version of CPYF, above the library QSYS. The following two steps would be required as setup:

- CRTCMD ALTSYS/CPYF PGM(somelib/RplCpyFcmd) /* all parameters defined in the source, which are utilized on the *LIBL/CPYF requests in the /legacy/ code. */

- CRTCLPGM somelib/RplCpyFcmd /* CLP source would be as CPP for the version of the CPYF command created in the ALTSYS library. The CLP parses the command parameter values and issues the desired CPYF, but explicitly qualified with the library QSYS; e.g. something like: QSYS/CPYF FROMFILE(&file) TOFILE(NEWLITERAL/&file) */

Note: If SBMJOB is used, SYSLIBL(*CURRENT) should be ensured to be defaulted or specified, if the above method is used.

If the command strings for the CPYF invocations are sufficiently complex, such that creating the CPP is not a desirable approach, then the QIBM_QCA_CHG_COMMAND exit point might be easier to effect replacement of the 'TOFILE(library/' with 'TOFILE(newlibrary/' in a replacement command string.

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.