Page 1 of 1

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

Posted: Tue Nov 21, 2006 10:33 am
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?

Posted: Tue Nov 21, 2006 10:37 am
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.

Posted: Tue Nov 21, 2006 10:40 am
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.

Posted: Tue Nov 21, 2006 10:44 am
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.