Home > Software > Data-Warehouse > DataStage
Interview Questions   Tutorials   Discussions   Programs   Discussion   

DataStage - How to generate even numbers in surrogate or transformer stage ? how many ways to remove duplicate values?




1019
views
asked mar September 20, 2014 06:32 AM  

How to generate even numbers in surrogate or transformer stage ? how many ways to remove duplicate values?


           

1 Answers



 
answered By vishnoiprem   0  
Method-1:

To generate even numbers using transformer, we can make use of stage variables. declare a stage variable say SV1 and initialise it to 0. In the derivation of that stage
variable increment it by 2 which looks like SV1+2. By doing this we can generate even numbers.

Method-2:

In transformer Properties, there is a tab called “Surrogate Key”. Here we can define it.
We can select from
a. Flat file : State file which holds the SK values and generates SK values.
b. DB Sequence: Database sequence object to use to generate the SK values.
oracle stage--->surrogate key generator--->transformer
 
the t/f having 'mod' function
 
mod(empkey,2)=0 --->even rows
mod(empkey,2)<>0 --->odd rows
 
empkey is generated from surrogate key generator

flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert