1.how to generate even numbers in surrogate or tranformar
stage ?

2. how many ways to remove duplicate values?

Answer Posted / subhash

1) By using Stage variables in transformer, we can generate even numbers,
Declare a stage variable - SV1 and initialize to '0'.
In the derivation of that stage variable increment by 2.
i.e. SV1=SV1+2.

By using Surrogate key in transformer, use the below logic in derivation part.
Surrogate_Key -----> If mod(Surrogate_Key,2)= 0 then Surrogate_key Else Surrogate_Key + 10000001

2)Removing Duplicates
a. By using Remove Duplicates Stage.
b. By using SORT Stage,Sort on KEY Column and set 'Allow Duplicates' to 'FALSE'
c. By using Link Partitioning, use 'HASH partition' on KEY Columns and Select Perform Sort and UNIQUE options.
d. By using Transformer Stage Variables,
SV2----->If SV1=KEY_Column then 0 Elso 1
SV1----->KEY_Column
In the Constraint Part give as,
SV2=1

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the differentiate between data file and descriptor file?

863


What is datastage engine?

730


how to read 100 records at a time in source a) hw is it fr metadata Same and b) if metadata is nt same?

1718


Give an idea of system variables.

587


How to clean the datastage repository?

694






What are stage variables and constants?

702


What are the various kinds of the hash file?

662


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

1641


What is usage analysis in datastage?

816


How do you run datastage job from the command line?

599


How to reverse the string using unix?

2811


What is datastage?

649


Can you explain how could anyone drop the index before loading the data in target in datastage?

895


What are the types of containers in datastage?

704


To see hidden files in LINIX?

945