REGARDING THE kEY VALUES....................

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
akansha123
Participant
Posts: 9
Joined: Sat Mar 18, 2006 1:53 pm

REGARDING THE kEY VALUES....................

Post by akansha123 »

Hai,
I got a sequential file with 73 columns.I want to get the key fields so that i can use those for lookup in my job.So what is the best way to find the keys.I looked for notnull fields,but still i have 50 columns and some of them are also having the repetitive values.Can anyone suggest how to find the Keys(Combination of Fields) which will give the unique value.
Thanks,
Akansha
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Sequential files have neither keys nor data types. You can identify columns based upon the metadata, but that's all.

Use a profiling tool to determine whether there are any candidate key columns. A candidate key column contains no nulls and no duplicate values.

Profiling tools such as ProfileStage, AuditStage or QualityStage (Investigate) can report the cardinality of combinations of columns, in case you have no single column candidate keys.

You *could* do it by hand, with SELECT column, COUNT(*) FROM filename GROUP BY column HAVING COUNT(*) > 1; queries executed through an ODBC text driver, but that's a hugely cumbersome approach.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

you will have to get and understand the business logic behind the table to understand what the keys are.

I dont think you can judge a key by looking at the data file. The best you can do is to get a idea of probable columns that can form a key.

A key column can be null. so eliminating it will not work either.

Ask your business user or your datawarehouse architect to provide you with the lookup keys.
Post Reply