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 implement this in a single ds job?
Answer Posted / shar
alternative ans lot similar to subu's.
to both files add a dummy column let say
File A
col1,dummy1
1,1
2,1
3,1
4,1
5,1
6,1
7,1
8,1
9,1
10,1
And for File B
col1,dummy2
6,2
7,2
8,2
9,2
10,2
11,2
12,2
13,2
14,2
15,2
Using col generator . Now join the two files using join
stage with full outer join. With key col1.
Then the output will be:
Left_col1, dum1, right_col1, dum2
1 1 0 0
2 1 0 0
3 1 0 0
4 1 0 0
5 1 0 0
6 1 6 2
7 1 7 2
8 1 8 2
9 1 9 2
10 1 10 2
0 0 11 2
0 0 12 2
0 0 13 2
0 0 14 2
0 0 15 2
Now assign the output to Transformer stage where at
constraints we mention:
DSLink6.dummy1 = 1 And DSLink6.dummy2 <> 2
DSLink6.dummy1 = 1 And DSLink6.dummy2 = 2
DSLink6.dummy1 <> 1 And DSLink6.dummy2 = 2
Then at three targets we map
Target 1 : left_col1
Target2 : left_col1
Target3: Right_col1
Hence the o/p.
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What are routines in datastage?
What is the difference between datastage and informatica?
Notification Activity
what is ds administrator used for?
Where the datastage stored his repository?
How can you write parallel routines in datastage PX?
How do you remove duplicate values in datastage?
What is a quality stage in datastage tool?
Can you explain kafka connector?
what should be ensure to run the sequence job so that if its get aborted in 10th job before 9job should get succeeded?
What are constraints and derivations?
sed,awk,head
how to read 100 records at a time in source a) hw is it fr metadata Same and b) if metadata is nt same?
In a batch if a job fails in between and you want to restart the batch from that particular job and not from the scratch then what will you do?
Can you explain players in datastage?