i have a scenario like two columns(Empno, Ename) in that duplicate records are there, so my question is how to get second duplicate record in datastage.

Answers were Sorted based on User's Feedback



i have a scenario like two columns(Empno, Ename) in that duplicate records are there, so my question..

Answer / reddy

Source File/Table--->Transformer-->Target

Transformer stage:
---------------------------
Take two stage variables

sv-->Empno or Ename (drag and drop column(s))

sv1-->if Empno=sv or Ename=sv Then sv1+1 Else 1

in constraint --> sv1=2

u will get second duplicate record

Plz correct me if i am wrong...

Is This Answer Correct ?    2 Yes 0 No

i have a scenario like two columns(Empno, Ename) in that duplicate records are there, so my question..

Answer / pavani

if we have n duplicates
source---->transformer-------->target.
in transformer we define 2 stage variables
if empno=stg_var2 then stg_var1+1 else 1------->stg_var1;
emp_no-------->stg_var2;

now the constraint for target is stg_var1=2

Is This Answer Correct ?    2 Yes 0 No

i have a scenario like two columns(Empno, Ename) in that duplicate records are there, so my question..

Answer / narasimha rao k

By using Removeduplcate stage in datstage

This stage having avalabel Removeduplicate 1st and last you select last automatically apply to second duplicate data

Is This Answer Correct ?    6 Yes 6 No

i have a scenario like two columns(Empno, Ename) in that duplicate records are there, so my question..

Answer / nish

remove duplicate-> retail last

Alternate MEthod: if there are only two occurences then sort stage-> descending-> remove duplicates

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Stage Interview Questions

I HAVE EMP TABLE, 4 COLS R THERE COL1,COL2,COL3,COL4 ID-- 101,102,103,104 SAL-- 1000,4000,2000,5000 DATE-- COLUMN. I WANT TO DISPLAY THE DATA PREVIOUS MONTH HIGEST SAL ?

2 Answers   Wipro,


how can u find out the datastage job is running on how many nodes

7 Answers   IBM,


How to read multiple files using a single datastage job if files have the same metadata?

0 Answers  


if i have two tables table1 table2 1a 1a,b,c,d 1b 2a,b,c,d,e 1c 1d 2a 2b 2c 2d 2e how can i get data as same as in tables?chandu how can i implement scd typ1 and type2 in both server and in parallel?chandu field1 field2 field3 suresh , 10,324 , 355 , 1234 ram , 23,456 , 450 , 456 balu ,40,346,23 , 275, 5678 how to remove the ,inthe fields?

2 Answers  


What are transforms and what is the differenece between routines and transforms?

0 Answers  






1.What is the flow of Transformer? 2.How can you do INDEX table in DataStage level?

0 Answers   EDS,


create a job that splits the data in the Jobs.txt file into four output files. You will direct the data to the different output files using constraints. • Job name: JobLevels • Source file: Jobs.txt • Target file 1: LowLevelJobs.txt &#8722; min_lvl between 0 and 25 inclusive. &#8722; Same column types and headings as Jobs.txt. &#8722; Include column names in the first line of the output file. &#8722; Job description column should be preceded by the string “Job Title:” and embedded within square brackets. For example, if the job description is “Designer”, the derived value is: “Job Title: [Designer]”. • Target file 2: MidLevelJobs.txt &#8722; min_lvl between 26 and 100 inclusive. &#8722; Same format and derivations as Target file 1. • Target file 3: HighLevelJobs.txt &#8722; min_lvl between 101 and 500 inclusive. &#8722; Same format and derivations as Target file 1. • Rejects file: JobRejects.txt &#8722; min_lvl is out of range, i.e., below 0 or above 500. &#8722; This file has only two columns: job_id and reject_desc. &#8722; reject_desc is a variable-length text field, maximum length 100. It should contain a string of the form: “Level out of range: <min_lvl>”, where <min_lvl> is the value in the min_lvl field. My Question is how do you write the stage variable for reject rows.

0 Answers   HCL,


source file contains 100 records, i want 10 records in target file how it possible in datastage

6 Answers   IBM,


can we half project in parallel jobs and half project in server jobs?

4 Answers   Infosys, L&T,


Why we need datasets ratherthan sequential files?

5 Answers  


What are the various kinds of the hash file?

0 Answers  


Main Function of the Staging area in DWH ?

2 Answers  


Categories