number of records written to a link

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
garirt
Participant
Posts: 10
Joined: Thu Mar 31, 2005 6:37 pm

number of records written to a link

Post by garirt »

Hi,

In a transformer stage, I have two output links. One writing to a hash file(link1) and another to update a table(link2).
I want to update the table with the number of records written to link1 in the transformer. I want to do this after all
the records are written to the link1. Any ideas how I can accompilsh this ?

thanks,
nrc
ml
Participant
Posts: 82
Joined: Wed Jun 09, 2004 1:03 pm
Location: Argentina

Post by ml »

You just want the "number of records written to link1" i think you can use the @OUTROWNUM variable. But if you need this at tthe end you should load the hash file first :roll:
nsm
Premium Member
Premium Member
Posts: 139
Joined: Mon Feb 09, 2004 8:58 am

Post by nsm »

I feel better is have a different job to read the LinkInfo from this job and updates the table.

If you do as ml told you its gonna be multiple updates instead of one update..

nsm.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Run your second link to an aggregator first and then to the update. Send a numeric field set to 1 for every row that goes down the first link or a 0 for any rows that don't... either that or have them use the same constraint. Then just do a 'sum' in the aggregator.

If there are no constraints involved you can also send @OUTROWNUM down it and let the aggregator take the 'Last' or 'Max' value.
-craig

"You can never have too many knives" -- Logan Nine Fingers
garirt
Participant
Posts: 10
Joined: Thu Mar 31, 2005 6:37 pm

Post by garirt »

Thx for all the help. I got what I wanted using the aggregator.
Post Reply