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 / subbuchamala

1)
We can solve this by using Change capture stage. First,we use source as 'A' and refrerence as 'B' both of them are connected to Change capture stage. From, change capture stage it connected to filter stage and then targets X,Y and Z.
(Change Code '0'--->exist in both, copy record
Change Code '1'--->Exists in SRC 'A', INSERT record
Change Code '2'--->Exists in SRC 'B', DELETE record
Change Code '3'--->Exists in 'A' & 'B' with changes, UPDATE record)

In the filter stage:
Change_code column=1 it goes to 'X' [1,2,3,4,5]
Change_code column=0 it goes to 'Y' [6,7,8,9,10]
Change_code column=2 it goes to 'Z' [11,12,13,14,15]

2)
Add an extra column 'colA' and 'colB' to the files 'A' and 'B' respectively. Let the value for colsA be 'a' for all the rows in file 'A' and the value for colB be 'b' in file 'B'(using the column generator stage).Now join both the files using join stage using 'ID' column. Perform full outer join. Map the ID col, colA and colB to output. Next pass it through a transformer.

Transformer constraint:

1) file X - colA=a and colB<>b ----->[1,2,3,4,5]
2) file Y - colA=a and colB=b------->[6,7,8,9,10]
3) file Z - colA<>a and colB=b------>[11,12,13,14,15]

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

if we using two sources having same meta data and how to check the data in two sources is same or not? and if the data is not same i want to abort the job ?how we can do this?

1755


Field,NVL,INDEX,REPLACE,TRANSLATE,COLESC

963


Where do you see different stages in the designer?

628


Explain entity, attribute and relationship in datastage?

629


Differentiate between validated and Compiled in the Datastage?

639






I/p : F1 table have A,B,C,D,E and F2 table having C,E,V i need output 0utput1: ABD output2: V any one suggest me this

545


How you Implemented SCD Type 1 & Type 2 in your project?

3695


Highlight the main features of datastage?

613


how do u catch bad rows from OCI stage? And what CLI stands for?

2281


What is datastage engine?

730


what is the use of surogate key in datastage

1814


What are some prerequisites for datastage?

616


Difference between ‘validated ok’ and ‘compiled’ in data stage?

666


How will you move hashed file from one location to another location?

1655


What is a ds designer?

640