Hi John,
Could you try RUNRMTCMD instead DMSYNCCMD to perform command CHGSVRAUTE on source? I did a quick test with the following CL, it works fine for me.
PGM
DCL VAR(&PWD25) TYPE(*CHAR) LEN(10) VALUE('ABC')
DCL VAR(&RMTCMD) TYPE(*CHAR) LEN(200)
DCL VAR(&RMTPASS) TYPE(*CHAR) LEN(10) VALUE('DEF')
DCL VAR(&RMTMACH) TYPE(*CHAR) LEN(50) VALUE('IBMI74A')
DCL VAR(&DMTHAUSER) TYPE(*CHAR) LEN(10) VALUE('ABC')
CHGVAR VAR(&RMTCMD) VALUE('CHGSVRAUTE USRPRF(ABC) SERVER(QDDMDRDASERVER) +
USRID(ABC) PASSWORD(' *CAT &PWD25 *CAT ')')
RUNRMTCMD CMD(&RMTCMD) RMTLOCNAME(&RMTMACH *IP) RMTUSER(&DMTHAUSER) +
RMTPWD(&RMTPASS)
ENDPGM
------------------------------
Jason Sun
Sr QA Manager
Rocket Internal - All Brands
CN
------------------------------
Original Message:
Sent: 06-06-2022 17:27
From: John Techmeier
Subject: DMSYNCCMD CMD parameter cannot use a parameter
I have a CL program that is used to change the DDM/DRDA user password for iCluster replication processes. I generate a random 25 character password and then use that variable to update the password on the production system, which will replicate over to the target system. I also need to change the server authentication entry, and if the program is run on system A, the CHGSVRAUTE command needs to be run on the target. I tried the following, but it didn't work...
DMSYNCCMD CMD(CHGSVRAUTE USRPRF(user_profile) SERVER(QDDMDRDASERVER) USERID(user_profile) PASSWORD(&PWD25)) GROUP(SYSTEM)
When the &PWD25 variable gets expanded, it gets surrounded by single quotes, and generates the error CPD0020 error...Character 'S' not valid following string '' DMSYNCCM'. (S is the first character of the generated password.)
I updated my CL to construct the entire command into a variable...
CHGVAR VAR(&RMTCMD) VALUE('CHGSVRAUTE USRPRF(user_profile) SERVER(QDDMDRDASERVER) USERID(user_profile) PASSWORD(' *CAT &PWD25 *CAT ')')
but when I change my DMSYNCCMD CMD(&RMTCMD) GROUP(SYSTEM) I get a compiler error...
CPD0033 - String beginning '&RMTCMD ' not valid command name.
Has anyone else experienced this or know of a way around it?
------------------------------
John Techmeier
Infrastructure Engineer Senior - IBM i
Associated Banc-Corp
Green Bay WI US
------------------------------