DS job logic needed

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
boopathy86
Participant
Posts: 3
Joined: Fri Jul 03, 2009 1:00 am

DS job logic needed

Post by boopathy86 »

input file A contains
1
2
3
4
5
6
7
8
9
10

input file B contains
6
7
8
9
10
11
12
13
14
15

Output file X contains
1
2
3
4
5

Output file y contains
6
7
8
9
10

Output file z contains
11
12
13
14
15

How can we do in this in a single ds job in px ?....could you please give me the logic to implement ???
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

hi,

Could you elaborate a little bit?

On what basis you are sending to output files?

Would be equal no of lines in all the 3 output files?

The contents of the i/p file will be always in sequence?

The input files are always same with the same content?Not a dynamic one?
pandeeswaran
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You are looking for a full outer join between the two. Look at this topic
viewtopic.php?t=124978&highlight=full+o ... join+stage
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
soumya5891
Participant
Posts: 152
Joined: Mon Mar 07, 2011 6:16 am

Post by soumya5891 »

What is the logic?
Do you want to populate each file with five consecutive values?
Soumya
hsahay
Premium Member
Premium Member
Posts: 175
Joined: Wed Mar 21, 2007 9:35 am

Post by hsahay »

You need three joins for three files

One is left outer , one is right outer and one is equijoin...
vishal
boopathy86
Participant
Posts: 3
Joined: Fri Jul 03, 2009 1:00 am

Re: DS job logic needed

Post by boopathy86 »

input file A contains
1
2
3
4
5
6
7
8
9
10

input file B contains
6
7
8
9
10
11
12
13
14
15

Output file X contains
1
2
3
4
5

Output file y contains
6
7
8
9
10

Output file z contains
11
12
13
14
15

i need to populate three output files x,y,z.

output x should contatin the data which is present in the input file A and not present in input file B.

output y should contatin the data which is present in the input file A and input file B.

output z should contatin the data which is present in the input file B and not present in input file A.


I've given the input file records as sample only...not a series of numbers...


How can we do in this in a single ds job in px ?....could you please give me the logic to implement ???
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Full outer join.

Three-output Filter or Transformer stage constraining on whether A is null or B is null or neither is null.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
peddakkagari
Participant
Posts: 26
Joined: Thu Aug 12, 2010 12:07 am

Post by peddakkagari »

Yes, Full outer join will solve your problem
I agree with ray's reply
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

Can anybody post the job design for this?

Today i had the same question in interview.

Thanks
pandeeswaran
boopathy86
Participant
Posts: 3
Joined: Fri Jul 03, 2009 1:00 am

Post by boopathy86 »

Hi ray...thanks...logic works fine...
Post Reply