i have data like
sam
ram
sam
raj
ram

I want two targets
trgt1
ram
sam

trgt2

raj
how can i do this in datastage?

Answers were Sorted based on User's Feedback



i have data like sam ram sam raj ram I want two targets trgt1 ram sam trgt2 raj ho..

Answer / ramu

src.....>agg........>t/r..........2trgs
take src as seqfiles and take aggregater stage is for
calculate count of records based on name coloumn,next take
the transformer is for apply constraints like cnt=1 then go
for trg1

Is This Answer Correct ?    7 Yes 0 No

i have data like sam ram sam raj ram I want two targets trgt1 ram sam trgt2 raj ho..

Answer / subhash

1) If SRC is either Oracle or Seq File

SRC--->AGG---->fILTER---->TGT1
...................|
...................|
..................TGT2

the main data is:
sam
ram
sam
raj
ram
from aggregator stage, the output is:
sam,2
ram,2
raj,1

Then specify the count<>1 in the Filter for TGT1 then you get:
ram
sam

in another link for TGT2, give count=1. THEN YOU GET:
raj

2) If SRC is DataBase,

Orcl Conector----->Filter---->TGT1
.......................|
.......................|
......................TGT2

SELECT NAME, COUNT(NAME)
FROM EABLE_NAME
GROUP BY (NAME)
from the Above Query, the output is:
sam,2
ram,2
raj,1

Then specify the count<>1 in the Filter for TGT1 then you get:
ram
sam

in another link for TGT2, give count=1. THEN YOU GET:
raj

Is This Answer Correct ?    6 Yes 1 No

i have data like sam ram sam raj ram I want two targets trgt1 ram sam trgt2 raj ho..

Answer / reddymkl.dwh

Small correction Ramu, Instead of Transformer stage use Filter stage it will give performance gain.

Is This Answer Correct ?    0 Yes 0 No

i have data like sam ram sam raj ram I want two targets trgt1 ram sam trgt2 raj ho..

Answer / cva

take seqfile for loading src then take filter stage and take
two outputs from filter . write condition in filter stage
use where clause=col like 'sam' and col like 'ram' for one
trg and for second also like that.

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More Data Stage Interview Questions

Hi frnds, my scenario is like i'm having a record 1234"1323£3434%343434^23232!1212$23232 in the above record all the special characters must be removed.how can we do it in datastage 8.0.1.can any one please ans this? thanx in advance

2 Answers   IBM,


What is lookup table?

5 Answers  


what is diff b/w datastage 8.1,8.5,8.7?

1 Answers   IBM,


How to initialize environment variables?

4 Answers   Infosys,


How can we run same job in 1 day 2 times

4 Answers   IBM,






I have Seq file, I don't want 10, 11th(or any two records like 20, 30th records ) records in the output

6 Answers   TCS,


Describe link sort?

0 Answers  


How many nodes supported by a one cpu in parallel jobs?

3 Answers   IBM,


What are orabulk and bcp stages?

0 Answers  


What could be a data source system?

0 Answers  


what is the use of DSattchJob?DetachJob? where can we find it?

0 Answers   IBM,


I have a file it contain 2 records like empname,company as Ram, Tcs and Ram, IBM. But i want empname, company1,company2 as Ram, TCS,IBM in the target. How?

6 Answers   Cap Gemini,


Categories