Hi,
I have a requirement where in, I need to execute UNIX command for every input record from a sequential file. The output of this command has to undergo transformation.
This is one of the sample :
I need to generate a sample report of space available and used for Each UNIX directory, list of directories is fed from sequential file. Based on the usage and available space, I need to generate a report as an output file.
Please guide me the feasible options.
Thank You.
Unix Commands in DS for every input record
Moderators: chulett, rschirm, roy
Although I feel pretty strongly that this type of processing is best done outside of DataStage - a script would do this much more efficiently than a DataStage job - the simplest way to do this would be to use a Server job and in the transform stage call up ExecSH() to create a shell and execute your command along with the parameters, which come from the stage's columns.
Note that this will create a shell and close it. For each row in the file.
Note that this will create a shell and close it. For each row in the file.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In a parallel job you should be able to use an External Filter stage. This executes a well-formed UNIX command. Its sdtin is mapped from the stage's input link, and its stdout is mapped to the stage's output link.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.