Page 1 of 1

Include = sign in Execute Command argument list?

Posted: Mon Jun 17, 2019 6:31 pm
by jackson.eyton
Good afternoon everyone, I am having an issue using an Execute Command stage in a sequence job. Scenario is that I have a bat file I need to call and pass a series of arguments to it. The problem child is the password that I have to pass as it contains an = sign. I'm just doing this as plain text for now to try and get it to work (which it does work just fine straight up on the EngineTier server in a command prompt for those inquisitive minds....). Once I can get datastage to be happy with it I hope to use an encrypted parameter in a set to house the password. Below is an example of the Execute Command values:
--Execute Command--
Command: D:\CognosTrigger\trigger.bat
Parameters: "http://my/URL/here" "userName" "pass=Word" "NAMESPACE" "Trigger_Name"

Here is the output from the log:
Trigger_Test..JobControl (@ExecTrigger): Executed: D:\CognosTrigger\trigger.bat "http://my/URL/here" "userName" "pass=Word" "NAMESPACE" "Trigger_Name"
Reply=-2
Output from command ====>
AxisFault
faultCode: Client
faultSubcode:
faultString: CM-REQ-4342 An error occurred with the client.


This fault code is something I did work with IBM on to get this process working directly in CMD on the server, which is where we discovered that each argument was best to wrap in double quotes, due to the = sign in the password.

IBM is currently looking into this as well and provided me the following response, but it has been several days with no response, so I figured I would see if anyone here has run into a similar issue:
"Looks like that there's issue passing "xxx=xxxx" parameter to next command inside .bat file.

I can reproduce the issue with simple bat file."

Thanks in advance!

Posted: Mon Jun 17, 2019 11:11 pm
by chulett
Perhaps... new rule? No equal signs in passwords! :wink:

Posted: Tue Jun 18, 2019 11:23 am
by jackson.eyton
:lol:

As an update, looks like we got it, not sure why it wouldn't work via the Command Execute stage but worked fine in a native command prompt. The fix was to adjust the bat file itself as follows:

Just wonder, can you try to modify your trigger.bat and see how it goes?

Change

Code: Select all

    "%JAVA_HOME%bin/java.exe" -classpath %CLASSPATH% Trigger %1 %2 %3 %4 %5
to:

Code: Select all

   "%JAVA_HOME%bin/java.exe" -classpath %CLASSPATH% Trigger %*

Posted: Tue Jun 18, 2019 12:19 pm
by chulett
8)

I've marked this as Resolved, if that's not true feel free to change it.