Execute Command stage and multiple commands

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
fmou
Participant
Posts: 124
Joined: Sat May 28, 2011 9:48 pm

Execute Command stage and multiple commands

Post by fmou »

Hi,

How to execute multiple commands using a Execute Command stage?

I see the Execute Command stage requires a command and its parameters. For a complicated command like the following,

Code: Select all

tar cf mytar.tar A.txt B.txt C.txt ; mv sample.html public_html ;chmod go-rwx biglist
what shall I do?

Moreover, can I do piping as well? E.g.,

ls file1* file2* | xargs ... | more piping | commands

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can do anything you could do at the operating system shell prompt. Pipelining, redirection... it's all there for you. After all, the stage merely invokes an operating system shell and passes it the command.

Be wary, though, that job parameter references can only appear in the Parameters field, not in the Command field.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
fmou
Participant
Posts: 124
Joined: Sat May 28, 2011 9:48 pm

Post by fmou »

I see the Execute Command stage requires a command and its parameters
I can't view the protected info. Could anyone confirm that I can just put the complicated command in the command entry and leave its parameters blank?

thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Do you need to pass any job parameters to the command? If not, then yes you can leave that part blank. Of course, you could just try it and see what happens.
-craig

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