Hi Gurus,
I'm trying to create a server routine in 8.0 with below code.
cmd = "cd /opt/isproj/ctl/ ./ctlAccess 2"
Call DSExecute("UNIX",cmd,Output,SystemReturnCode)
Ans = Output
But I get no output , but return code is 0 which is sure that its getting executing
ctlAccess is a program on DataStage box its a compiled c program which gives the return value on passing of argument i.e. 2 will return MRD
If I go to command line on ds box and browse to directory
cd /opt/isproj/ctl/ and run the command ./ctlAccess 2 it returns MRD but not from DSExecute I'm able to catch the output.
Regards,
DSExecute return code
Moderators: chulett, rschirm, roy
You need a command delimiter between the two, otherwise all that happens in the 'cd' I'd wager. While you could use ";" I'd suggest the much nicer "&&" which tells the second command to execute only if the first is successful:
Code: Select all
cmd = "cd /opt/isproj/ctl/ && ./ctlAccess 2"
Call DSExecute("UNIX",cmd,Output,SystemReturnCode)
Ans = Output
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Thanks a lot it worked.
Regards,
[quote="chulett"]You need a command delimiter between the two, otherwise all that happens in the 'cd' I'd wager. While you could use ";" I'd suggest the much nicer "&&" which tells the second command to execute only if the first is successful:
[code]cmd = "cd /opt/isproj/ctl/ && ./ctlAccess 2"
Call DSExecute("UNIX",cmd,Output,SystemReturnCode)
Ans = Output [/code][/quote]
Regards,
[quote="chulett"]You need a command delimiter between the two, otherwise all that happens in the 'cd' I'd wager. While you could use ";" I'd suggest the much nicer "&&" which tells the second command to execute only if the first is successful:
[code]cmd = "cd /opt/isproj/ctl/ && ./ctlAccess 2"
Call DSExecute("UNIX",cmd,Output,SystemReturnCode)
Ans = Output [/code][/quote]