Sequential file read error

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
suja.somu
Participant
Posts: 79
Joined: Thu Feb 07, 2013 10:51 pm

Sequential file read error

Post 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?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Add a reject link to the Sequential File stage. Direct rejected rows wherever you will.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
suja.somu
Participant
Posts: 79
Joined: Thu Feb 07, 2013 10:51 pm

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply