Page 1 of 1

Looping in DataStage Job

Posted: Thu Jul 13, 2006 12:45 pm
by skrakesh
I need to loop 'x' times for a functionality. 'x' is a variable and can be passed as an environment variable to the job.

if x=4; I need to loop for a particular logic (coded within shared container) 4 times.

How can I handle looping in DataStage PX job?

Posted: Thu Jul 13, 2006 1:14 pm
by DSguru2B
Look into the Loop start and loop end activity stages in the sequence jobs.
If your control is at the unix level, you can code to run that particular job x number of times.

Posted: Thu Jul 13, 2006 1:31 pm
by skrakesh
Thanks DSGuru!

The problem is the environment being used here doesnot support sequencer. I need to loop within DataStage job.

Posted: Thu Jul 13, 2006 1:33 pm
by Krazykoolrohit
why dont u use "do while" in Unix scripting?

Posted: Thu Jul 13, 2006 1:49 pm
by skrakesh
Krazykoolrohit wrote:why dont u use "do while" in Unix scripting?
The job flow design contains lot of other stuff within the job itself. The looping required is for different file merge with different schema and I am using Generic Stage to provide the dynamic expression files to merge operator.

This merge operator needs to be looped.

Posted: Thu Jul 13, 2006 1:57 pm
by skrakesh
Thanks Everyone! I figured the answer out.

I need to create a buidop which will do the branching for me to divert to appropriate output link and select from appropriate input link.

Posted: Thu Jul 13, 2006 5:08 pm
by ray.wurlod
skrakesh wrote:The problem is the environment being used here doesnot support sequencer. I need to loop within DataStage job.
All DataStage environments except mainframe support job sequences. :!: