6) my sorce
d1
d2
d1
d2
d1
d3
d2
d1


my target

tartget
1 d1
2 d1
3 d1
4 d1


target2


1 d2
2 d2
3 d3

Target 3

1 d3
Can any body send me answer this is argent requierment

Answers were Sorted based on User's Feedback



6) my sorce d1 d2 d1 d2 d1 d3 d2 d1 my targ..

Answer / subhash

1. SRC--->FILTER---->TGT1,TGT2,TGT3
In source query,
SELECT COL1,
RANK() OVER(PARTITION BY COL1 ORDER BY COL1) SNO
FROM TABLE
in filter,
col1='d1'------>TGT1
col1='d2'------>TGT2
col1='d3'------>TGT3

2. SRC---->TFM---->TGT1,TGT2,TGT3
in TFM, do the HASH partitioning on col1 and use the stage
varibles as below:
if col1 =prevCol then SV1=S1+1
else SV1=1
prevCol---->col1

In the link constraints:
TGT1 link, COL1='d1'
map SV1, COL1 to the tgt.

TGT2 link, COL1='d2'
map SV1, COL1 to the tgt.

TGT3 link, COL1='d3'
map SV1, COL1 to the tgt.

Is This Answer Correct ?    11 Yes 0 No

6) my sorce d1 d2 d1 d2 d1 d3 d2 d1 my targ..

Answer / ankit gosain

Hi,

The solution to the problem can be achieved by the below
job structure & settings:

Source---->SortStage---->Transformer---->Tgt1,Tgt2,Tgt3

1. In Sort Stage, sort in assending mode w.r.t. source
column (say col1) & Create a change key column (say
ChangeKey).
2. In Transformer stage, create a stage variable (say
count) & it's derivation would be:
if ChangeKey=1 then 1 else count+1
3. Constraint for Tgt1 => col1=d1
Constraint for Tgt2 => col1=d2
select otherwise constraint for Tgt3.

Cheers,
Ankit :)

Is This Answer Correct ?    6 Yes 1 No

6) my sorce d1 d2 d1 d2 d1 d3 d2 d1 my targ..

Answer / srinivas

Hii guys use following stages to get output
sequecial file->copy->aggregator and Joinstage then use filter to get required output
by using copy stage take two links one for aggregator and other for Join then you will get
required output

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Data Stage Interview Questions

What are the types of containers?

0 Answers  


create a job that splits the data in the Jobs.txt file into four output files. You will direct the data to the different output files using constraints. • Job name: JobLevels • Source file: Jobs.txt • Target file 1: LowLevelJobs.txt &#8722; min_lvl between 0 and 25 inclusive. &#8722; Same column types and headings as Jobs.txt. &#8722; Include column names in the first line of the output file. &#8722; Job description column should be preceded by the string “Job Title:” and embedded within square brackets. For example, if the job description is “Designer”, the derived value is: “Job Title: [Designer]”. • Target file 2: MidLevelJobs.txt &#8722; min_lvl between 26 and 100 inclusive. &#8722; Same format and derivations as Target file 1. • Target file 3: HighLevelJobs.txt &#8722; min_lvl between 101 and 500 inclusive. &#8722; Same format and derivations as Target file 1. • Rejects file: JobRejects.txt &#8722; min_lvl is out of range, i.e., below 0 or above 500. &#8722; This file has only two columns: job_id and reject_desc. &#8722; reject_desc is a variable-length text field, maximum length 100. It should contain a string of the form: “Level out of range: <min_lvl>”, where <min_lvl> is the value in the min_lvl field. My Question is how do you write the stage variable for reject rows.

0 Answers   HCL,


What is the difference between operational data stage (ods) and data warehouse?

0 Answers  


I have the following columns in the EMP table Empid,Empname,Sal,month(Sal),year(Sal) and DOB(let us say the dob is 15th-Jan-1981) Desing a job such that the output contains the following empname,year(sal),tot(sal) and current age i.e. whether 18yrs or so on

1 Answers   Accenture,


What are sequencers?

0 Answers  






How you Remove the Dataset in Unix?

5 Answers  


Please explain me the difference between 3 types of slowly changing dimension in datawarehousing?

3 Answers   TCS,


What are the different common services in datastage?

0 Answers  


What is datastage engine?

0 Answers  


what is Audit table?Have u use audit table in ur project?

3 Answers   Accenture, Wipro,


What is Horizontal transformation, vertical transformation,diagonal transformation?

2 Answers   Cap Gemini,


In aggregator stage,to find the sum of the entire group of columns,it displays in binary format. How can i solve this problem.

1 Answers   IBM,


Categories