1.how to generate even numbers in surrogate or tranformar
stage ?
2. how many ways to remove duplicate values?
Answers were Sorted based on User's Feedback
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 |
Answer / pavan
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.
mail me @ akellapavankumar@gmail.com for more info.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / kumar
By using distinct we can eliminate duplicates,
by using variable comparison we can eliminate duplicates.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / pavan
To remove duplicates we could use Remove Duplicates Stage.
If the requirement states not to use a remove duplicates
stage, u culd use Sort stage, by setting one of its
property Allow Duplicates to false.
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / kiran
IN surrogate key generator stage set the block size to 2
with initial value as 2, it will increment the surrogates
by 2 and will get you even numbers. I don't think in any
real world scenario you would do this as it violates
surrogate key concept. I wish the interviewer knew this
before he/she asked you.
| Is This Answer Correct ? | 1 Yes | 4 No |
Wat is pre-load in Hashed file
What are the steps needed to create a simple basic datastage job?
What are the types of containers and how to create them?
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?
i have source data like empno,enmae 11 ,aa 12 ,bb i want output like empno,ename 11 ,aa 12 ,bb 11 ,aa 12 ,bb
What is aggtorec restructure operator?
How rejected rows are managed in datastage?
What are the different plug-ins stages used in your projects?
how to sort two columns in single job in datastage.
What's the Main Function of the Staging area in DWH
Create a job to load all unique products in one table and the duplicate rows in to another table. The first table should contain the following output A D The second target should contain the following output B B B C C Q2. Create a job to load each product once into one table and the remaining products which are duplicated into another table. The first table should contain the following output A B C D The second table should contain the following output B B C
what is set mapping in datastage??