Job design

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
Noozeethullah
Participant
Posts: 3
Joined: Tue Mar 20, 2012 7:00 am
Location: Chennai

Job design

Post by Noozeethullah »

Hi guys I am stuck up with the job design for the below sql queries. Please help:

select empno from emp_1 minus select empno from emp_2;

I need the emp_1 rejected empno into the target file
Sahana
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Post by kandyshandy »

User defined SQL in respective DB stage!!
Kandy
_________________
Try and Try again…You will succeed atlast!!
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

What about using difference stage ,if you want to do in datastage?
pandeeswaran
udayk_2007
Participant
Posts: 72
Joined: Wed Dec 12, 2007 2:29 am

Post by udayk_2007 »

How abt using a lookup. The reject file of the look-up will give you the required data.

Regards
Ulhas
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

There are many ways to do it but I should ask what the OP has tried?
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
mobashshar
Participant
Posts: 91
Joined: Wed Apr 20, 2005 7:59 pm
Location: U.S.

Post by mobashshar »

Hi Sahana,
You should get the empno not present in emp_2 table by using this query. Nothing wrong in sql.
What is your requirement?
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post by jerome_rajan »

Just so I understand, you need all empno from emp_1 that are not present in emp_2, right?

Off the top of my head, I can think of a design with a lookup.

The primary link will have emp_1 data and the reference link will have emp_2. perform a lookup on empno.
The data rejected by the lookup would be the data not present in emp_2. You can capture this in a reject file and use it downstream.

Hope this helps.
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
Post Reply