Left outer join in HASH file

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

karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Left outer join in HASH file

Post by karthi_gana »

All,

1) I have a sequential file. It contain 16000 records.
2) I have a HASH file. It contains 2000 records

I desiged the job like,

Code: Select all

Seq_File _____> Transformer  <--------- Hash File 
                       |
                       |
                       |
                       v
                 Final_Seq_File

Seq_File contains Fund_Id, Portfolio_Id
Hash File contains Portfolio_id

Final_Seq_File contains 2000 records now.
But my requirement is, I have to store all 16000 records in the Final_Seq_File alongg with Portfolio_id (HASH FILE), if Portfolio_id is not matching with Seq_File, simply i have to store 'NULL'.
Karthik
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Isn't that the default working mechanism - unless you have constrained something !!??
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Right, you have a constraint that only allows lookup successes to pass - you need to "turn that off".
-craig

"You can never have too many knives" -- Logan Nine Fingers
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

chulett wrote:Right, you have a constraint that only allows lookup successes to pass - you need to "turn that off".
I don't have any constraint under 'Transformer'.
Karthik
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

See the row count per link and find where the constraint is.
battaliou
Participant
Posts: 155
Joined: Mon Feb 24, 2003 7:28 am
Location: London
Contact:

Post by battaliou »

Er, you're trying to put NULL into a sequential file? Good luck.
3NF: Every non-key attribute must provide a fact about the key, the whole key, and nothing but the key. So help me Codd.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Have you checked your job's log to see if there were warnings logged during the write to the sequential file?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Ensure that all columns are nullable. Or set a dummy value if the lookup fails.
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

chulett wrote:Have you checked your job's log to see if there were warnings logged during the write to the sequential file?
Yes...I have checked the log...i din't see any warnings...
Karthik
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Did you ensure that all NULL returns are made into a non-null values.

DataStage server is observed to be notorious in losing rows where NULLs are moved into non-nullable columns.
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

Sainath.Srinivasan wrote:Did you ensure that all NULL returns are made into a non-null values.

DataStage server is observed to be notorious in losing rows where NULLs are moved into non-nullable columns.
I am using only two columns in the HASH file, both of them are NON NULL values.

so i choose 'NO' for Nullable property.
Karthik
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

:idea: They may be non-nullable in the hashed file. But if the lookup fails, the return is null.
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

karthi_gana wrote:
Sainath.Srinivasan wrote:Did you ensure that all NULL returns are made into a non-null values.

DataStage server is observed to be notorious in losing rows where NULLs are moved into non-nullable columns.
I am using only two columns in the HASH file, both of them are NON NULL values.

so i choose 'NO' for Nullable property.
I am just thinking the below steps...

1) Get matching records
2) Get unmatching records
3) Merge both the files

i think it may be a workaround for this problem...
Karthik
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Your steps 1 through 3 can be summarised as "get ALL the records".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
arunpramanik
Participant
Posts: 63
Joined: Fri Jun 22, 2007 7:27 am
Location: Kolkata

Post by arunpramanik »

karthi_gana wrote: 2) Get unmatching records

i think it may be a workaround for this problem...
That is what you are not getting in the job you have designed, so your work around will not work
Post Reply