DSExecute fail on special character

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
tang
Participant
Posts: 14
Joined: Tue Jun 01, 2004 3:47 am
Location: Malaysia

DSExecute fail on special character

Post by tang »

Hi, all

i'm trying to write a routine which will output some of the values to a file in sun solaris system.

At command prompt i've tested echo "(" >> test2.sh successfully append into test2.sh
but it fails if i use DSExecute.

The first command in my code suceed but the 2nd one failed.

Code: Select all

command = " echo set heading off >" :ScriptF
Call DSExecute("UNIX", command, Output, SystemReturnCode)

command = "echo exec DATASTAGE_TEST_SP " :'"' : "(" :  "'": '"':Trim(Param1) : '"': "'": '" ,:x "' : ")" : '">>' :ScriptF

Call DSExecute("UNIX", command, Output, SystemReturnCode)
Is there anyone faced the same problem that can advise?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

From what I recall, DataStage is stripping part of your command out before it actually executes it... the single quotes, I believe. :?

You'd be much better off if you wrote a script that does the commands you are executing and instead use DSExecute to simply run the script, passing it the parameters you may need to do so.
-craig

"You can never have too many knives" -- Logan Nine Fingers
tang
Participant
Posts: 14
Joined: Tue Jun 01, 2004 3:47 am
Location: Malaysia

Post by tang »

thx guys
I've write a script and run it with DSExecute. It succeed.

Anyhow i still need to do some char parsing in the script coz DSExecute to unix strip all the " ' eventhough i put an escape infront of the special char in DS routines.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

"(" has special meaning to the shell. What if you "escape" the character (precede it with a backslash), for example

Code: Select all

echo \( >> ScriptF
?
This is what you would do in UNIX if you wanted to avoid messy quote characters (for example cd \&PH\&)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply