Page 1 of 1

Sequential file read error

Posted: Mon Feb 18, 2013 10:26 am
by suja.somu
I am reading a ( Empdet.csv )sequential file with the below columns

EmpNo,EName,Salary,DeptNo
1,SAM,40000,10
2,RAM,50000,20
3,RAJ,30000,30
4,ALI,20000,40
Columns datatype is defined as CHAR for all the fields
with the Format properties as Final Delimiter = End
Delimiter = comma
Quote = none

I am able to read the file properly with the above settings.
My requirement is to reject the data to a reject file when the layout is not same.

EmpNo,EName,Salary,DeptNo
1,SAM,40000,10
2,RAM,50000,20
3,RAJ, 25000, 30, B
4,ALI,20000,40
5,TONY,55000,50,A
I want to reject the 3 and 5 records in above file. I have a issue , when i tried to view data (3 and 5 records) its appearing as

EmpNo,EName,Salary,DeptNo
3,RAJ, 25000, 30, B
5,TONY,55000,50,A

30,B and 50,A in the Deptno field. I have set the reject mode = output property
what properties should i change to reject the data to a file?

Posted: Mon Feb 18, 2013 3:04 pm
by ray.wurlod
Add a reject link to the Sequential File stage. Direct rejected rows wherever you will.

Posted: Mon Feb 18, 2013 9:35 pm
by suja.somu
Thanks Ray.

I have added the reject link to a sequential file to capture the rejects. The issue here is records are not getting rejected to the reject file. It gets processed as a good record and is loaded into the target.

The below 2 records ( that does not fit the layout)flows into the target along with the good records
EmpNo,EName,Salary,DeptNo
3,RAJ, 25000, 30, B
5,TONY,55000,50,A

the last field Deptno takes up the values which is wrong.
30,B and 50,A

Please help me to correct the issue.

Posted: Mon Feb 18, 2013 10:48 pm
by ray.wurlod
Looks like it may be ignoring the Field Delimiter property. It shouldn't be.
Why not try defining the format as variable length (all strings are VarChar) and using a Transformer or Filter stage to trap the rejects? This has the advantage that the filtering is done in parallel.