help in job logic

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

pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

help in job logic

Post by pandeesh »

HI,

Today i have faced this question in interview.
my 2 input files A , B are as given below

A
__

1
2

B
__

3
4

My output file C should be


C
__

1,3
2,4

How to implement this in job level?

Thanks
pandeeswaran
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What was your answer?
-craig

"You can never have too many knives" -- Logan Nine Fingers
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

I dont knw the answer.

Actually i told that in unix level we can do that via

Paste -d ',' A B

But i dont knw how to do in datastage.

Please help me
pandeeswaran
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'd rather see if you can work it out on your own with some help rather than just provide a solution... teach a man to fish and all that. Did you look to see what paste does? Have you tried to put the requirement into words? A lot of times, simply spelling out what needs to be done can lead you to the solution.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

ok Craig!! thanks!!

I will try it out and let you know!
pandeeswaran
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

hi Craig,

I can achieve this by the following design:

2 Seq file stages -----> Transformer stage -----> Seq file stage(record delimiter=',')

We can have 2 fields in the target seq file. Since the record delimiter is ',',

the result will look like 1,1
2,2
3,3


Am i correct?

Is there any other way to do this?

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

Post by ray.wurlod »

Parallel Transformer stage does not support two inputs.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ah... but there is at least one that does.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

chulett wrote:Ah... but there is at least one that does.
i don't get you
pandeeswaran
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: help in job logic

Post by SURA »

Examples are always seems to be simple.


A
__

1
2
5
6
B
__

3
4
7

what should be the ouput in C?
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Re: help in job logic

Post by pandeesh »

C should be,

1,3
2,4
5,7
6,
pandeeswaran
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: help in job logic

Post by SURA »

What is your source?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: help in job logic

Post by chulett »

SURA wrote:What is your source?
That was noted in the first post.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

pandeesh wrote:
chulett wrote:Ah... but there is at least one that does.
i don't get you
You can't use a parallel transformer to join two data sources.
-craig

"You can never have too many knives" -- Logan Nine Fingers
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: help in job logic

Post by SURA »

There is no direct way to do it. Still you can do it.

Need to make one identy col as a key to join two links. Use join stage (full outer for safer) and the in the TFM combined the col.
Post Reply