Link Collector

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
deva
Participant
Posts: 104
Joined: Fri Dec 29, 2006 1:54 pm

Link Collector

Post by deva »

Hi,
I have one derived column setid, from source let say two cols pol_year, id.

My requirement is like if the first record pol_year,id value <> previos record pol_year,id value then setid should increse else previous set id.

I am using hash file to read the o/p and comparing the previous val. But I am not getting

can any one suggest with correct code
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Key marked in Hash file will eliminate duplicates. So if you have the same values of the key, it will be eliminated.
You can sort the data based on the two fields. Use Transformer stage variable to compare the previous record value and assign the Set_Id.
If you search for Previous records manipulation in transformer, you will get an idea of how to use the stage variable to check it.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: Link Collector

Post by gateleys »

Does your post have anything to do with the subject of your post (Link Collector)??

In what order do your columns arrive? And how are they supposed to be sorted?

You may want to check the functions -
RowProcCompareWithPreviousValue() and RowProcGetPreviousValue(). You could use them in stage variables to compare the current concatenated values of pol_year and id to the previous.
gateleys
Post Reply