Include = sign in Execute Command argument list?

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
jackson.eyton
Premium Member
Premium Member
Posts: 145
Joined: Thu Oct 26, 2017 10:43 am

Include = sign in Execute Command argument list?

Post 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!
-Me
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Perhaps... new rule? No equal signs in passwords! :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
jackson.eyton
Premium Member
Premium Member
Posts: 145
Joined: Thu Oct 26, 2017 10:43 am

Post 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 %*
-Me
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

8)

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

"You can never have too many knives" -- Logan Nine Fingers
Post Reply