UNION Functionality

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
cherry
Participant
Posts: 108
Joined: Sun Jul 10, 2005 1:35 am

UNION Functionality

Post by cherry »

Hello Everyone,

I have two files AAAA.txt and BBBB.txt

I need to have all records from AAAA.txt and Unmatched records from BBBB.txt and I don't want the records from BBBB.txt that matches in AAAA.txt

I need to implement the functionality of UNION. Is there any chance that datastage can implement UNION functionality.

Thanks in Advance

Regards
Cherry
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Take 2 streams.

1.) AAA
2.) Do a Left outer join of AAA and BBB

Funnel both.
Grace J.
Participant
Posts: 22
Joined: Mon Nov 03, 2008 5:34 am

Post by Grace J. »

Do full outer join on AAAA.txt and BBBB.txt. You will get left link key columns and right link key columns that is AAAA.key columns and BBBB.key columns. Next in a transformer stage take two output links, One link contrained with AAAA.key columns as null(i.e Records in BBBB is not in AAAA) and another link constrained with AAAA.key columns not null. Then funnel both the links.
mddw08
Premium Member
Premium Member
Posts: 7
Joined: Fri Apr 18, 2008 1:52 pm

Re: UNION Functionality

Post by mddw08 »

UNION is UNION ALL plus DISTINCT (in SQL terms). So, you can use Funnel stage and Remove Duplicates Stage right after that.
Post Reply