How to implement join

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
Rajendra_89
Participant
Posts: 22
Joined: Fri Jul 12, 2013 7:32 am

How to implement join

Post by Rajendra_89 »

Hi Craig,

I have gone through the answers from forums other questions for this topic but yet I am not sure ...

I want to join a sql server table and text file on the basis of Varchar column and then two sqo server tables

But as the join stage is not supported in Server edition I am not able to figure
how this join can be achieved

Two sql server tables I can join in the ODBC stage..

But how to join a text file with Sql server table by matching their varchar column?

Thanks in Advance!
Rajendra
ETL Developer
InfoCepts
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That would be the Merge stage, not to be confused with the Parallel stage off the same name.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Rajendra_89
Participant
Posts: 22
Joined: Fri Jul 12, 2013 7:32 am

Post by Rajendra_89 »

Correct me if I am wrong Craig

Merge stage is used to join only two sequential file

I want to join one sequential file with one Sql server table which I am importing in ODBD stage..

How can I join this file with SQL server table?
Rajendra
ETL Developer
InfoCepts
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Either import the file into your database and join them there or export the table to a file and use the Merge stage. From what I recall,those are your two primary choices in a Server job.

Depending on the type of kind of join, you may be able to put the file into a hashed file and use a lookup to perform the join.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Read the text file and perform lookups against the table, either directly or a copy pre-loaded into a hashed file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rajendra_89
Participant
Posts: 22
Joined: Fri Jul 12, 2013 7:32 am

Post by Rajendra_89 »

Thanks Chulett and Ray

I am not clear with the concept of Hash files And as Server jobs dont have a Look up Stage how can we perform look up on hash files?

I dont have any idea of implementing the Hash files

The more am reading on it more getting confused :roll:

Please guide me on this...
Rajendra
ETL Developer
InfoCepts
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In server jobs lookups are performed with the Transformer stage.

The server Transformer stage takes one stream input and zero or more reference inputs (these are painted with short dashed lines). Reference inputs provide the lookup functionality.

Hashed files (note, not "hash" files) are implemented using Hashed File stage. You can get by using the defaults in this stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rajendra_89
Participant
Posts: 22
Joined: Fri Jul 12, 2013 7:32 am

Post by Rajendra_89 »

I am working on this ...
Lets see If I succeed :)
Rajendra
ETL Developer
InfoCepts
rameshrr3
Premium Member
Premium Member
Posts: 609
Joined: Mon May 10, 2004 3:32 am
Location: BRENTWOOD, TN

Post by rameshrr3 »

Im curious - if you are using an ODBC stage , and network latency is low enough , you may be able to use the oDBC stage as a reference link input , with its reference returns multi rows property set in the transformer ( identity stage) . The file will be stream input link .
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes, that's precisely what I suggested. If network latency is an issue, pre-load the table (only the rows and columns you actually need) into a hashed file.
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