Reg Data extraction from one environment to another

pts.
Tags:
Application development
AS/400
CLP
RPGLE
Hi Consider i have testing library and development library in my library list. Say for eg, given a shipment ID i need to copy all the relevant data from testing enviroment to development environment. Since the file objects reside in testing and dev environment how will i be able to fetch data from particular environment. Can this be done in rpgle or clle.

Answer Wiki

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

You can create a CL program with a parm of shipping ID. If you want to copy from test to prod or prod to test, pass another parm saying which way. The “CPYF” has the library fields on it so you can specify which library the file is in.

Discuss This Question: 5  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
  • RonKoontz
    Generate n SQL statement inside the CL. You can do the same thing with CPYF also. No sure if this is more than what I think it is. It sounds pretty basic.
    1,780 pointsBadges:
    report
  • Xasanchez
    Indeed this sounds very basic. It looks like you may want to manage record-level update or adding to you dev environment from your testing environment. If so, you can write an rpgle program. Say FILEA exists in both libraries. Declare FILEA twice in your F sheet, like FFILEA1, for input, prefix it with tst_, then FFILEA2, for update and add, prefix it with dev_. Write your calculation operations on the target file with the criteria met for your shipment ID. Then do an OVRDBF to FILEA1 to point to FILEA in library testing, with SHARE(*YES). Then OVRDBF FILEA2 to point to FILEA in library development, with SHARE(*YES). Compile your rpgle having these two overrides active in your interactive session. Delete your overrides now. Then write a CL program having these same overrides, and just after that, call your rpgle program. Whe the rpgle ends, DLTOVR your overrides. Voila!
    0 pointsBadges:
    report
  • Xasanchez
    And a small correction. SHARE(*YES) does not have to go in this case. Just do not include it. I just realized that it is not necessary, and actually, it ensures that two open data paths are opened, one for each file. SHARE(*YES) is mostly recommended when you use OPNQRYF to select records from a file that will be processed by an rpgle program.
    0 pointsBadges:
    report
  • JDWWms
    Or in the CL you just need to decide which one your doing and do an OVRDBF to the file you need before openning the RPG. You really shouldn't want/need to copy the file as user A may need the one in production while user B needs the one in test at the same time. Also sounds pretty weird if the data in a test environment is required for a production job. Production should be able to stand alone.
    0 pointsBadges:
    report
  • Senator46058
    You could just use an sqlrpgle program to insert records from one file to the other based on selection criteria within the sql statements in the pgm. Just need to reference the libraries correctly. example: C/Exec SQL C+ Insert Into Testlib/ClDeptP C+ Select * C+ From Prodlib/ClDeptP C+ Where DiCli# = :Client# With NC C/End-Exec No overrides needed etc.
    0 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