Page 1 of 1

How to dived the data int diff targets

Posted: Sun Jan 22, 2012 10:26 am
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

Posted: Sun Jan 22, 2012 12:23 pm
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.

Re: How to dived the data int diff targets

Posted: Wed Jan 25, 2012 10:12 am
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

Posted: Thu Jan 26, 2012 6:43 am
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.

Posted: Thu Jan 26, 2012 11:21 am
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

Posted: Fri Jan 27, 2012 12:40 am
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.

Posted: Fri Jan 27, 2012 11:25 am
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

Posted: Fri Jan 27, 2012 7:04 pm
by qt_ky
Congrats... you can mark the topic resolved!

Posted: Fri Jan 27, 2012 11:06 pm
by chulett
<cough> hitchhiker </cough>

Posted: Sat Jan 28, 2012 12:49 am
by ray.wurlod
Gesundheit!

Posted: Sun Feb 19, 2012 8:14 am
by qt_ky
Craig, how's your cough?