Find unique records based on another field

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
skp
Premium Member
Premium Member
Posts: 135
Joined: Wed Dec 26, 2007 1:56 am
Location: India

Find unique records based on another field

Post by skp »

Hi All,

My requirement is
Emp No, Emp Name
12345, skp
14567, skp
43567, skp
56789, skp
45678, rjp
23456, skp
45236, mkp

Group by Emp Name I have to find out if more than one employee is there I need to pass to target else I have to reject and capture the records.

Target O/P
12345, skp
14567, skp
43567, skp
56789, skp
23456, skp

Reject O/P
45678, rjp
45236, mkp

In datastage how we can achieve this... Appreciate your help...

Thanks,
skp.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This is a classic "fork join" job design. Search DSXchange for examples of how it's done. Basically, though, you use a Copy stage to make two copies of your data. Apply an Aggregator to perform the counts and run the two inputs into a Join stage. Downstream of that, filter out those groups that have a count of more than one into your "reject" handler. Actually, you don't need the Join stage to solve your particular problem.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
skp
Premium Member
Premium Member
Posts: 135
Joined: Wed Dec 26, 2007 1:56 am
Location: India

Post by skp »

Not able to view entire post.. any one please help on this...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

ray.wurlod wrote:This is a classic "fork join" job design. Search DSXchange for examples of how it's done.
You can certainly see enough of the post.
-craig

"You can never have too many knives" -- Logan Nine Fingers
srinivas.nettalam
Participant
Posts: 134
Joined: Tue Jun 15, 2010 2:10 am
Location: Bangalore

Post by srinivas.nettalam »

Code: Select all

fork join:
                |-----------Aggr----> |
                |                     |
Source-->Copy---|------------------>Join ------>Target
N.Srinivas
India.
Post Reply