How to dived the data int diff targets

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
dudam
Participant
Posts: 11
Joined: Sun Feb 27, 2011 9:40 am

How to dived the data int diff targets

Post by dudam »

Hi,
Actually in my source is seq file have a 20 records
those 20 records have to move to two diff targets......
mean 10 records one target another 10 records into other target....
which stages we need to use how to design the job

For Example in source i have a 20 records
in first trg 1,2...10
second tgg 11...20
which stages have to use ..& how plz desing the job


plz help me on this....


Thanks,
DN
Last edited by dudam on Mon Jan 23, 2012 8:34 am, edited 1 time in total.
DN
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Are there criteria that specify which rows go to which targets? The stage that splits the rows might be a Filter stage, a Switch stage or a Transformer stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Maximus_Jack
Premium Member
Premium Member
Posts: 139
Joined: Fri Apr 11, 2008 1:02 pm

Re: How to dived the data int diff targets

Post by Maximus_Jack »

Hi
i have tried this using a transformer it worked..
i used a stage variable

inside the stage variable

svx=1
if svx >20 then svx=1

in the 2 output link section i used the constraints
for records 1..10 .. 21..30 ...
constraint ( svx <11)

for records 11..20 ..31..40
contraints (svx>11)


...it may not be best solution. but it did the work...

cheers
dr
prakashdasika
Premium Member
Premium Member
Posts: 72
Joined: Mon Jul 06, 2009 9:34 pm
Location: Sydney

Post by prakashdasika »

From the logic what i understood is that the value of svx will be added by 1 for every input row. This logic will only work if the config file has only one node. For multiple nodes the stage variable has multiple values on each node and it will add 1 to the current value depending on the partition.
Prakash Dasika
ETL Consultant
Sydney
Australia
Maximus_Jack
Premium Member
Premium Member
Posts: 139
Joined: Fri Apr 11, 2008 1:02 pm

Post by Maximus_Jack »

will keeping the transformer in sequential mode work?? (sorry.. i cant check it right now)

or is there any other better way
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Assuming that you are incrementing svx by 1, which is not shown, then setting the Transformer stage to sequential mode will work, but...

What about the poor records where svx = 11? According to your tests, they are getting left out.
Choose a job you love, and you will never have to work a day in your life. - Confucius
Maximus_Jack
Premium Member
Premium Member
Posts: 139
Joined: Fri Apr 11, 2008 1:02 pm

Post by Maximus_Jack »

finally did some tweaking and it worked..

Transformer in sequential mode

Stage variable
svx=0
Derivation: if svx >19 then "1" else svx+1 = svx

Output link1
Constraint: if svx <=10

Output link2
Constraint: if svx >= 11
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Congrats... you can mark the topic resolved!
Choose a job you love, and you will never have to work a day in your life. - Confucius
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

<cough> hitchhiker </cough>
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Gesundheit!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Craig, how's your cough?
Choose a job you love, and you will never have to work a day in your life. - Confucius
Post Reply