Having single input source want three different outputs.

I have a source file having data like:
10
10
10
20
20
20
30
30
40
40
50
60
70
i want three output from the above input file, these output would be:
1) having only unique records no duplicates should be there. Like:
10
20
30
40
50
60
70
2) having only duplicate records, no unique records should be there. Like:
10
10
10
20
20
20
30
30
40
40
3) only unique record should be present. Like:
50
60
70
how can i achieve this using datastage 8.5?
please do reply.

Questions by taruna.arya

Showing Answers 1 - 21 of 21 Answers

Ramya Sujith

  • Oct 6th, 2014
 

Sourcefile --> copy stage --> 1st link --> Removeduplicate stage --> outputfile1 with 10,20,30,40,50,60,70

Copy stage-->2nd link --> aggregator stage (creates the row count)--> filter stage-->filter1 (count>1) -->outputfile2 with 10,20,30,40 -->Filter2(count=1)-->outputfile3 with 50,60,70

  Was this answer useful?  Yes

BML

  • Oct 9th, 2014
 

source --> aggregator(count based on keys) -> Tfm (to distribute rows) -> 3 targets

  Was this answer useful?  Yes

laxmi

  • Nov 10th, 2014
 

Use dedup > keep parameter - first>we will get first unique records no duplicates in out port
in UDP port we will get all duplicate records
in next stage by keeping unique in keep parameter we will get only unique records

  Was this answer useful?  Yes

Dheerendra

  • Nov 11th, 2014
 

use aggregator...take count of rows.....then add filter...specify conditions as row count = 1 and >1

  Was this answer useful?  Yes

Mihir

  • Nov 27th, 2014
 

Use Sort Stage-->Define the key field, In Property, Key Change column is TRUE.
Then use a Transformer, In constraint , KeyChange=1 for Unique record O/P and KeyChange=0 for Duplicate O/P.

  Was this answer useful?  Yes

shaheed

  • Nov 20th, 2019
 

Src->Sggr->Trans->Target(3)
1) Unique- send as it is with link sort
2) Duplicate only- Loop through Count of each row count (constraint Count . 1)
3)Unique Only- Constraints Count = 1

  Was this answer useful?  Yes

Ruchi Gautami

  • Dec 30th, 2019
 

File -->> Sort -->> Transformer -->> O/P File
Sort:
Define the key field and in Property set Key Change column as TRUE.
Transformer:
In Constraints put the below condition:
KeyChange=1 for Unique record O/P
KeyChange=0 for Duplicate O/P.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions