Looping in DataStage Job

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
skrakesh
Participant
Posts: 7
Joined: Wed Mar 17, 2004 3:53 am
Contact:

Looping in DataStage Job

Post 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?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
skrakesh
Participant
Posts: 7
Joined: Wed Mar 17, 2004 3:53 am
Contact:

Post by skrakesh »

Thanks DSGuru!

The problem is the environment being used here doesnot support sequencer. I need to loop within DataStage job.
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

why dont u use "do while" in Unix scripting?
skrakesh
Participant
Posts: 7
Joined: Wed Mar 17, 2004 3:53 am
Contact:

Post 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.
skrakesh
Participant
Posts: 7
Joined: Wed Mar 17, 2004 3:53 am
Contact:

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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. :!:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply