I have Seq file, I don't want 10, 11th(or any two records like 20, 30th records ) records in the output

Answers were Sorted based on User's Feedback



I have Seq file, I don't want 10, 11th(or any two records like 20, 30th records ) records in th..

Answer / subbuchamala

SeqFile---->Tranfrmr----->TGT
in Seq file we can add 'ROW NUMBER COlumn' as ROW_NUM which will numbers to each row.
we add 2 parameters to the job: RowNum1, RowNum2
in transformer, in the constrain we can specify below condition:
ROW_NUM<>RowNum1 OR ROW_NUM<>RowNum2
then we can skip those two records.

Is This Answer Correct ?    11 Yes 0 No

I have Seq file, I don't want 10, 11th(or any two records like 20, 30th records ) records in th..

Answer / subhash (subbuchamala)

If we use @INROWNUM, then we have to run transformer on 'single' NODE.

Is This Answer Correct ?    8 Yes 0 No

I have Seq file, I don't want 10, 11th(or any two records like 20, 30th records ) records in th..

Answer / ankit gosain

Hi,

You can block any specified record(s) from the source seq.
file with the help of a Transformer Stage.

Source Seq. File ----> Transformer ---->Target Seq. File

Now, in Transformer stage create a Stage Variable (say
row_num) & initialize it with ZERO.
In it's derivation, just increment it by ONE (i.e.
row_num+1)

Now, Insert a new column in the output & it's derivation,
assign the variable (row_num).

Now, in the contraint tab wirte row_num<>10 OR row_num<>11

If you have some other doubts or queries, you can mail me
on ankitgosain@gmail.com

Cheers,
Ankit :)

Is This Answer Correct ?    2 Yes 1 No

I have Seq file, I don't want 10, 11th(or any two records like 20, 30th records ) records in th..

Answer / srinivas

We can do it by using filter option in sequencial file by using sed command
sed '10d;11d' filename then you will get required output

Is This Answer Correct ?    1 Yes 0 No

I have Seq file, I don't want 10, 11th(or any two records like 20, 30th records ) records in th..

Answer / sushil

SeqFile---->Tranfrmr----->TGT
To number of rows in a sequential file in Transformer we
can use @INROWNUM, store value in variable ROW_NUM and then
by providing condition as same condition as:
ROW_NUM = '10' and ROW_NUM = '11' we can skip such records.

Is This Answer Correct ?    0 Yes 0 No

I have Seq file, I don't want 10, 11th(or any two records like 20, 30th records ) records in th..

Answer / sharath

Yes Mr Ankit Gosian Answer is correct. But What if numbers
are 1 4 7 9 10 11 13 and so on then.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Stage Interview Questions

how to get the unique records on multiple columns by using sequential file stage only

3 Answers  


Hi any one has datasatge 8.5 certication dump could you please provide your details i will contact you. send reply to my mail rajaadivi@gmail.com Thanks in Advance

2 Answers  


How do u call shellscript/Batch file from DS?

4 Answers   HP,


i hav source like this . deptno,sal 1,2000 2,3000 3,4000 1,2300 4,5000 5,1100 i want target like this target1 1,2000 3,4000 4,5000 target2 2,3000 1,2300 5,1100 with out using transformer

2 Answers  


input Name Salay Sam 10 Sam 30 Sam 20 Ram 40 Ram 50 Output should be Name Salary Count Sam 10 3 Ram 40 2 get min salary and count of name . OutPut 2 Name Seq Sam 1 Sam 2 Sam 3 Ram 1 Ram 2

1 Answers   HCL,






What is container and then types?

1 Answers  


Can you filter data in hashed file?

0 Answers  


What is the Difference Between DataStage 7.5 version and 8.1 Version?

10 Answers   IBM,


Define orabulk and bcp stages?

0 Answers  


I/p : F1 table have A,B,C,D,E and F2 table having C,E,V i need output 0utput1: ABD output2: V any one suggest me this

0 Answers  


How to convert RGB Value to Hexadecimal values in datastage?

0 Answers  


If there is a file that contains 1000 records, I need the ouput to contain these 1000 records with the header as file name concatenated with the current timestamp and trailer as the count of records

2 Answers   TCS,


Categories