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
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 |
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 |
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 |
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 |
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 ?
how can u find out the datastage job is running on how many nodes
How to read multiple files using a single datastage job if files have the same metadata?
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?
What are transforms and what is the differenece between routines and transforms?
1.What is the flow of Transformer? 2.How can you do INDEX table in DataStage level?
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 − min_lvl between 0 and 25 inclusive. − Same column types and headings as Jobs.txt. − Include column names in the first line of the output file. − 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 − min_lvl between 26 and 100 inclusive. − Same format and derivations as Target file 1. • Target file 3: HighLevelJobs.txt − min_lvl between 101 and 500 inclusive. − Same format and derivations as Target file 1. • Rejects file: JobRejects.txt − min_lvl is out of range, i.e., below 0 or above 500. − This file has only two columns: job_id and reject_desc. − 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.
source file contains 100 records, i want 10 records in target file how it possible in datastage
can we half project in parallel jobs and half project in server jobs?
Why we need datasets ratherthan sequential files?
What are the various kinds of the hash file?
Main Function of the Staging area in DWH ?