Link to home
Start Free TrialLog in
Avatar of Tyecom
TyecomFlag for United States of America

asked on

How To Call A Program From AS400

I have a call program...example: CALL PGM (DELTE/RECV)...that I want to run in two different environments...Production (PROD2) and Test (TEST2).  My question is...how can I specifically run the program separately in both environments.  In other words, I want to run it in test, then run it in production.  Thank you in advance for your assistance!
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

For interactive programs, typically you would just manipulate the library list before running the program to contain either the production libraries or the test libraries:  EDTLIBL / CHGLIBL.

If it is a batch program, you might have different job descriptions containing different library lists that you would yse when submitting jobs.

Some shops may have custom CL commands or CL programs set up that you can use to switch between environments.

Best thing to do is ask another developer familiar with the environment, or inspect the Initial Program setup for various production and dev users for clues.

Inspect jobds.

Unfortunately, there is no "one way".
Or create your own CL something like:

PGM PARM(&ENV)

DCL VAR &ENV *CHAR (10)
Addlible &ENV *FIRST

CALL PGM (DELTE/RECV)

Rmvlible &ENV  

ENDPGM

Open in new window


and start with  CALL MYCLPGM PARM ('TEST2')
Avatar of Member_2_276102
Member_2_276102

What's the problem with calling it in different environments? Are PROD2 and TEST2 two physically separate systems? Two LPARS in a single machine? Two different libraries? Does the program qualify data references?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.