Ask the Expert

Execute a CL program

I am attempting to execute a CL program on system b from a CL program that resides on system a. The CL on system b has parameters that are variables. The procedure will work with SBMRMTCMD, but when I attempt to execute it with AREXEC or RUNRMTCMD, the error message that I receive states that variables are invalid. If I substitute a literal for the variable, there is not a problem. Do the later two commands actually not accept variables? I found this hard to believe and am hoping that it is user error. Any help would be greatly appreciated.

When passing parameters, what is actually passed is a pointer to the passed parameters. There are a few ways around this. One is to create a CL in QTEMP, which hard-codes the parameters, compiles and calls it. Another is to send a message to the remote user to be retrieved by the called CL. Another (my preference) is to pass the data via a remote data queue. The called program checks the "Hard coded" variables passed. If they are set to a specific value, it reads the data queue (or retrieves the message) and parses the parameters into the variables it had expected the caller to pass.

e.g.
Calling program:
OrdNo = 00012345
CustNo = 000456789
PartNo = "A123456ADFDSFSD "
QtyShip = 0012345.8955
Concat into "00012345000456789A123456ADFDSFSD 0012345.8955"
Send to data queue defined as remote data queue.
Call Program C on remote system, which calls program B passing hard coded value for OrdNo of -1 and all other variables as zeros or blanks.
Called program:
Check to see if OrdNo is -1
If no
Process normally
If Yes
Read data queue and parse values into passed variables
Process normally.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.


This was first published in March 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

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
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: