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

i have source data like empno,enmae 11 ,aa 12 ,bb i want output like empno,ename 11 ,aa 12 ,bb 11 ,aa 12 ,bb

7 Answers   TCS,


if a column contains data like ram,rakesh,madhan,suraj,pradeep,bhaskar then I want to place names separated by commas in another columns how can we do?

2 Answers   IBM,


I have a source table with column name CITY having 100 records, I want target table with column name start with 'A' and 'B',remaining columns as reject outputs. how can achieve this by data stage?please help me?????

5 Answers  


what are fact tables and dimension tables? give example assuming one table.

3 Answers   IBM,


In my project source data comes from MAINFRAME in files.so,This time data is coming as a binary file...I know for binary data we use Complex flat file stage..I have used it also..but on 'view data' data is not coming correctly..as it in MAINFRAME.give me some ideas..

2 Answers  






I have scenario like this seq file --> transformer --> sort stage --> dataset In this job which prtitioning technique you are using and why???

3 Answers   CTS, IBM,


what is the main difference between sorragate key n primary key in one word

2 Answers  


can we see the data in fixed width file? how can u change the datatype of fixed width files?

1 Answers   Infosys,


Hi guys, In sequencer job, we have 3 sources, in that 1st source have some records, Here requirement is 1st source records are 100 then only run the job otherwise total job will abort... How to calculate this. please design the job. Thanks.

1 Answers   IBM,


Differentiate between Join, Merge and Lookup stage?

0 Answers  


what is the main differences between Lookup, Join and Merge stages?

9 Answers   HCL,


how to get sum of sal based on dept_no and then sum of all sal irrespective of dept_no in same sql. output:- 10, 200(sum of sal for dept_no 10), 5000(sum of all sal)

0 Answers  


Categories