Using unix command output in Job

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
saikrishna
Participant
Posts: 158
Joined: Tue Mar 15, 2005 3:16 am

Using unix command output in Job

Post by saikrishna »

Hi

How would I use the output of Unix command (for example, wc -l filename.txt) in the job?

I tried using the following options to do this work
1. We can only call the unix command in before/after job.. in which case, we cant use the return value from the output of this command...

2. One more way is using this command at sequence level, and passing the result to underlined job.. But I could not use the direct unix command in this way..
What I would like to know in this case is, is there any way to call unix command from DataStage routines...if any, please suggest me..

If you have any other approach ...please give me the suggetion.

Thanks
Sai
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

hai sai,

there are several more ways to use UNIX command within DataStage. Best to get them known is to go to a training.

Have you tried to use a UNIX-command within a Routine?
Wolfgang Hürter
Amsterdam
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

An Execute Command activity in a job sequence will execute an operating system command directly, and make its output and exit status available as activity variables that you can use to control Triggers or access in downstream activities.

Beware that the command output is converted to a single string, in particular that line terminators are converted to field marks (@FM).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
saikrishna
Participant
Posts: 158
Joined: Tue Mar 15, 2005 3:16 am

Post by saikrishna »

Thanks Ray....
Post Reply