Looping Construct in datastage

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

Post by ray.wurlod »

Add a new column to your input. This column has the same value, say "X", in every row. A Column Generator stage would be ideal.

Create a Data Set containing pairs of values, "X" and a value, for example X,100; X,125; X,150 and so on up to the largest possible value. Permit duplicates.

Effect a join between this data set and your input stream.

Filter the result on Amt <= Value.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nishadkapadia
Charter Member
Charter Member
Posts: 47
Joined: Fri Mar 18, 2005 5:59 am

Re: Looping Construct in datastage

Post by nishadkapadia »

There could be more simpler & smarter solutions suggested further .
One of the naive possibilities include 2-3 jobs.

Counter Initialization based on keys could be 1 DS job or could be merged.
Subsequently,have a single DS job which does this validation , sorted on ascending counter for the keys.
Have this DS Job created in step 2 be executed through sequencer based on the check whether the Indicator is N for any records sorted on Keys and counter.

Partitioning will still be on keys and counter, with same sorting option

Hoping this helps.
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

Maybe... but Ray's solution is pretty darn simple already.

Mike
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Or build an operator
Post Reply