SOURCE LIKE
I_D,F1,F2
---------
100,N,Y
100,N,N
100,Y,N
101,Y,Y
101,N,Y
102,Y,N
103,N,N
104,Y,Y
105,N,N
106,N,Y
102,N,Y
105,Y,Y

O/P LIKE

ID flag1 flag2

101 Y Y
101 N Y
102 Y N
102 N Y
104 Y Y
106 N Y

Answers were Sorted based on User's Feedback



SOURCE LIKE I_D,F1,F2 --------- 100,N,Y 100,N,N 100,Y,N 101,Y,Y 101,N,Y 102,Y,N 103,N,N 10..

Answer / vaibhav

I think, here the question is... if F1 & F2 both are 'N' then the records with same I_D should be dropped.. correct Prasad?

if this is the case we need to find ans for this scenario..

Is This Answer Correct ?    1 Yes 0 No

SOURCE LIKE I_D,F1,F2 --------- 100,N,Y 100,N,N 100,Y,N 101,Y,Y 101,N,Y 102,Y,N 103,N,N 10..

Answer / bharath

Hi friend..
question may not clear..
my question is..
in what based on I_D s 100,103,105 don't want to send to
target?

Out of my knowledge
1.change the Field names as new field names by using modify stage as follows
Give at specification as
'ID = I_D; flag1=F1; flag2;'
2.Give the field delimiter=tab
and final delimiter=end

then u get

clear my question?
thank you..

Is This Answer Correct ?    0 Yes 0 No

SOURCE LIKE I_D,F1,F2 --------- 100,N,Y 100,N,N 100,Y,N 101,Y,Y 101,N,Y 102,Y,N 103,N,N 10..

Answer / akila

Looks like if both the flags for any ID are 'N' then all
the records of that particular ID are not sent to output.

For this, first sort the data using ID, F1, F2(all in asc
order).

Next in a transformer stage variables,
svOldID = svNewID
svNewID = ID
svCompare = If svOldID=svNewID then 'N' else 'Y'
svRejectedID= If svCompare='Y' and F1='N' and F2='N' then
ID else svRejectedID

In the output link contraint: ID<>svRejectedID

Is This Answer Correct ?    0 Yes 1 No

SOURCE LIKE I_D,F1,F2 --------- 100,N,Y 100,N,N 100,Y,N 101,Y,Y 101,N,Y 102,Y,N 103,N,N 10..

Answer / bharath

Hi,
please find the below answer.

|------seq1
src---->trans-----
|------seq2


in transformer stage give constraint as follows

src.f1="N" And src.f2="N"

check other wise link on seq2link.

then you get..

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More Data Stage Interview Questions

Explain the importance of surrogate key in data warehousing?

0 Answers  


What is the process of killing a job in datastage?

0 Answers  


What is merge stage?

0 Answers  


Differentiate between operational datastage (ods) and data warehouse?

0 Answers  


What is staging variable?

0 Answers  






Can anyone tell me a difficult situation who have handled while creating Datastage jobs?

0 Answers   Cap Gemini, TCS,


Hi All, I have a file. i need to fetch the records between first and last records by using transform stage. EX:- Source: EMPNO EMPNAME 4567 shree 6999 Ram 3265 Venkat 2655 Abhi 3665 Vamsi 5852 Amit 3256 Sagar 3265 Vishnu Target: EMPNO EMPNAME 6999 Ram 3265 Venkat 2655 Abhi 3665 Vamsi 5852 Amit 3256 Sagar I dont wan't to Shree and vishnu records.we can fetch another way also but How can I write the function in transform stage?

2 Answers   TCS,


What is RCP?

2 Answers   TCS,


What are routines in datastage? Enlist various types of routines.

0 Answers  


how to change left and right links in join stage?

4 Answers   Cap Gemini, IBM,


You enter values in a schema file for RCP and you also entered values in sequential file? which one will it take?

1 Answers   TIAA CREF,


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

3 Answers   TCS,


Categories