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

How u implement the slowly changing dimensions if my source table is consisting of cid,cname,add,phno,email but i need to capture the changes for first three columns how u implement?

1 Answers   IBM,


What are the repository tables in datastage?

0 Answers  


Which algorithm you used for your hashfile?

0 Answers  


What is the use of hoursfromtime() function in transformer stage in datastage?

0 Answers  


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

9 Answers   HCL,






what are the devoleper roles in real time? plz tell i am new to datastage....

0 Answers   Mphasis,


what is a message handler

3 Answers   IBM,


if we using two sources having same meta data and how to check the data in two sources is same or not? and if the data is not same i want to abort the job ?how we can do this?

1 Answers   IBM,


if a column contains data like abc,aaa,xyz,pwe,xok,abc,xyz,abc,pwe,abc,pwe,xok,xyz,xxx,abc, roy,pwe,aaa,xxx,xyz,roy,xok.... how to send the unique data to one source and remaining data to another source????

3 Answers  


how can we perform the 2nd time extraction of client database without accepting the data which is already loaded in first time extraction

1 Answers   Reliance,


How to generate surrogate key without using surrogate key stage?

6 Answers   IBM,


What can we do with datastage director?

0 Answers  


Categories