Run script in DS job n get the script o/p in same DS 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
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Run script in DS job n get the script o/p in same DS job

Post by ady »

I have a script written and i need to run the script in my datastge job and also use the output of the script in the same job for further transformation.

how do i do it?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Use the before job subroutine "Execsh" to fire your script. Redirect your output to a file and then read that file in your datastage job. Make sure you adhere to the strict rules of meta data for the sequential file to read your output file without any fuss.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Another way to implement this is use the Execute stage in the Job sequence to execute yourscript.
Now capture the return value (.$ReturnValue ) or the command output value (.$CommandOutput) in the successive jobs.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

If its a single value then yes, but if its a row then you will need to redirect it to an output file and read that in datastage. If its just one value then you can go with narasimha's suggestion.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply