How DataStage Perform Interaction with External Scripts

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
bhargav_dd
Premium Member
Premium Member
Posts: 57
Joined: Tue Jun 30, 2009 9:38 am

How DataStage Perform Interaction with External Scripts

Post 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.
Shaanpriya
Participant
Posts: 22
Joined: Thu Sep 11, 2008 11:47 pm
Location: Bangalore

Post by Shaanpriya »

You can use the "Before Job" , "After job" properties available in the stages.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post 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.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well, there's always Annotations on the canvas to address the whole "VISIBLE" aspect. Good, general, "best practice" stuffs. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply