problem in getting unique record

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
harithay
Participant
Posts: 106
Joined: Tue Dec 14, 2004 10:51 pm

problem in getting unique record

Post by harithay »

Hi all;

i have source flat file(tab delimited). i have to calculate ' change in assets' for new records based on existing records based on fund name , fund_no(key columns) after matching date difference between new record and existing record should be 360 and 370,and the existing record should have the 'net assets' column maximum.


the key column in table in database is account_id (sql server auto generated)


after i get the record from database (with same fund_name, fund_no, date difference lies between 360 and 370, with 'assets' of maximum value)
i have to caliculate 'change in assets' for new record by subtracting ASSETS (new record) - assets (old record).

i don't know how to get record from database. but 'Hashed file stage ' does not work here (because i can get only one matching record with 'assets 'maximum but after that it may not satisfy date differnce between 360 and 370 days).

please i need some suggetsions how to proceed.

is there any possibility first checking date differnce (360 and 370 days) and after that taking only one record with max 'assets' from database


Thanks in advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use an ODBC stage to connect to SQL Server. In the Transformer stage check the "multiple rows for lookup" check box on the link properties.
Read the on-line help topic covering multiple rows for lookup, or search this forum where it's been described on a number of occasions.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply