how can we send even and odd records from a sequential file
to two different targets
Answers were Sorted based on User's Feedback
Answer / varma
In transformer specify constraints Mod(@INROWNUM,2) =1 for Odd records and Mod(@INROWNUM,2) = 0 for even records.
Is This Answer Correct ? | 41 Yes | 2 No |
SeqFile--->Transformer=====>TGTFile1,TGTFile2
1. in SeqFile, add the 'Row Number Column' property and
name it as 'Row_Number'
2. in the Transformer, give the constraint for TGTFile1
link:
'MOD(Row_Number,2)=1'----> all the ODD rows
give the constraint for TGTFile2 link:
'MOD(Row_Number,2)=0'----> all the even rows.
If we use INROWNUM in transformer, then we need to run the
transformer on 'Single' NODE configuration.
Is This Answer Correct ? | 18 Yes | 0 No |
Answer / skyboyfli
Hi kiran, how can u get even or odd numbers with round robin method. i think it is not possible.
Is This Answer Correct ? | 8 Yes | 4 No |
Answer / rikan
same task without using transformer stage.
Source---->column generator stage--->filter stage---->2 targets
in column generator stage, select column tab, there create
column like skey and double click on starting point of that
row,we can get the metadata ,modification window--->there we
can give cycle=1 increment by 1 and ok.write the condition
in filter stage .we can get correct out put.
Is This Answer Correct ? | 5 Yes | 2 No |
Answer / vinay
HAI KIRAN, CAN U EXPLINE ME DETAIL WITH SMALL EXAMPLE
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / govind reddy
In Transformation level
even records-mod(empno,2=0)
odd records-mod(empno,2!=0)
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / satya
Create new column record number in sequential file then in
Transformer check that record number is even or odd and
send them accordingly to o/p.
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / deepu
we can use transfarmer stage,in the stage create surgatekey
and write constraint like mod(<surcatekeycolumn>/2)=0 in
one link and mod(<surgatekeycolumn>/2)=1 in another link.we
get even records and odd records
Is This Answer Correct ? | 0 Yes | 0 No |
Difference between JOIN,LOOKUP,MERGE?
What is audit table?
1)s.key generate 1 to 700 records today. tomorrow another 400 will updated how to update the records using s.key generator? 2)source is like :-- DB --> T/F stage1 --> seq1file T/f 1 is linking with T/F2 ---> seq 2 how to load the data? in source i given some conditions those r going in seq1. The another data will going to seq2 how to do this ?
DataStage Scenario based Interview Questions
I have file with empid,empname and I want to load these two fields along with sal in my target 1)salary must be same for all the records 2)I want pass the salary at run time
difference between function and procedure...
Hi I have scenario like this s/r table T/r table ename,sal empno,ename,sal vijay,2000 1 , vijay, 2000 kumar,3000 2 ,kumar , 3000 ravi ,4000 3 ,ravi , 4000 How can i get target table like that without using Transformer stage?
A job is having only 2 stages I/p dataset and target table.Job is taking very long time to load 50 million records.How to improve performance of this job.
WHERE YOU USE UNIX COMMANDS AS A ETL DEVELOPER?
Can you explain players in datastage?
What is the sortmerge collector?
why dataset ?