Page 1 of 3

help in job logic

Posted: Sat May 21, 2011 1:18 am
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

Posted: Sat May 21, 2011 6:29 am
by chulett
What was your answer?

Posted: Sat May 21, 2011 7:55 am
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

Posted: Sat May 21, 2011 8:58 am
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.

Posted: Sat May 21, 2011 10:07 am
by pandeesh
ok Craig!! thanks!!

I will try it out and let you know!

Posted: Sun May 22, 2011 10:42 am
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

Posted: Sun May 22, 2011 2:41 pm
by ray.wurlod
Parallel Transformer stage does not support two inputs.

Posted: Sun May 22, 2011 3:52 pm
by chulett
Ah... but there is at least one that does.

Posted: Sun May 22, 2011 6:52 pm
by pandeesh
chulett wrote:Ah... but there is at least one that does.
i don't get you

Re: help in job logic

Posted: Sun May 22, 2011 8:01 pm
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?

Re: help in job logic

Posted: Sun May 22, 2011 8:17 pm
by pandeesh
C should be,

1,3
2,4
5,7
6,

Re: help in job logic

Posted: Sun May 22, 2011 8:29 pm
by SURA
What is your source?

Re: help in job logic

Posted: Sun May 22, 2011 8:34 pm
by chulett
SURA wrote:What is your source?
That was noted in the first post.

Posted: Sun May 22, 2011 8:36 pm
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.

Re: help in job logic

Posted: Sun May 22, 2011 8:46 pm
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.