Page 1 of 1

How DataStage Perform Interaction with External Scripts

Posted: Thu Jul 15, 2010 11:53 pm
by bhargav_dd
Hi Guys,
I'm wondering that whether there is such stage in DataStage 7.5.x could perform external scripts, shell scripts in Unix I mean, or not.
I wanna perform a shell script before a job running, and also perform 2 shell scripts after a job running successfully or unsuccessfully respectively.
If there is no such stage for using, whether the only way to perform this logic is detecting the return status after starting job by dsjob command within shell script first and then performing different operation according to the return status gotten previously.

Posted: Fri Jul 16, 2010 12:06 am
by Shaanpriya
You can use the "Before Job" , "After job" properties available in the stages.

Posted: Fri Jul 16, 2010 6:29 am
by chulett
All kinds of ways. As noted, both the Before and After Job areas support ExecSH as an action. There is the Execute Command stage in Sequence jobs. There is a DSExecute() function that can be used in BASIC routines or in hand-rolled job control code.

Posted: Fri Jul 16, 2010 10:12 am
by kduke
I never liked using before or after routines. I prefer a separate process within a sequence or whatever scheduling tool you might use. It is a lot more VISIBLE to other developers trying to debug your process later down the line.

Posted: Fri Jul 16, 2010 9:34 pm
by chulett
Well, there's always Annotations on the canvas to address the whole "VISIBLE" aspect. Good, general, "best practice" stuffs. :wink: