Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RUNRMTCMD

Status
Not open for further replies.

Cairhien

Programmer
Apr 23, 2003
1
GB
I'm trying to issue a call to a CL program on one AS400 from another. The CL program being called however has parameters on the call which are contained as variables in the CL program issuing the RUNRMTCMD.

Is there an easy way to pass these variables through?

Thanks

Mal
 
You have to insert the parameters in the command string being passed over, similar to what you would do with OPNQRYF's QRYSLT parameter. The command string, because it will have blanks, needs to be surrounded by single quotes (&QT in the following example):

[tt]
PGM
DCL VAR(&CMD) TYPE(*CHAR) LEN(2000)
DCL VAR(&LIB) TYPE(*CHAR) LEN(10) value('RMTLIB')
DCL VAR(&FILE) TYPE(*CHAR) LEN(10) VALUE('RMTFILE')
DCL VAR(&QT) TYPE(*CHAR) LEN(1) VALUE('''')
CHGVAR VAR(&CMD) VALUE(&QT *TCAT 'DLTF FILE(' *TCAT +
&LIB *TCAT '/' *TCAT &FILE *TCAT ')' +
*TCAT &QT)
RUNRMTCMD CMD(&CMD) RMTLOCNAME('1.2.3.4' *IP) +
RMTUSER(USER_NAME) RMTPWD(secret)
ENDPGM
[/tt]


"When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for here you have been, and there you will always long to return."

--Leonardo da Vinci

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top