sequential file read running if the wrong delimeter

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
suresh_dsx
Participant
Posts: 160
Joined: Tue May 02, 2006 7:49 am

sequential file read running if the wrong delimeter

Post by suresh_dsx »

Source is the comma delimited file.
Sample data:
"Emp name","Empno","sal"
"xxx","101","2000"
"bbb","102","4000"
"aaa","103","3000
I have given the below properties in the sequential file stage.

Record level

final delimter=end
Record delimiter=UNIX newline

Field defaults

Dlimeter=Comma
Quote=double

I am able to run the job. It is working. Some reason they have provided wrong delimiter in the file.

Sample data:
"Emp name" "Empno" "sal"
"xxx" "101" "2000"
"bbb" "102" "4000"
"aaa" "103" "3000"

even though i am having different delimeter in the source file. Still my job running fine.
But I want to fail my job if the file having wrong delimiter other than comma delimiter. It is not failing and running fine.

Any help greatly appreciated.

Thanks
Last edited by suresh_dsx on Fri Apr 08, 2011 12:10 am, edited 1 time in total.
GJ_Stage
Participant
Posts: 131
Joined: Mon Oct 27, 2008 6:59 am

Post by GJ_Stage »

Hi,

It looks default parameter is space , that is the reason it is accepting. If you want to abort/fail job then you need to check the file after the second quote shoud be comma.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

My guess is that it would read the entire line into the first field, if there are no commas in the line but your metadata prescribe comma as the field delimiter.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
suresh_dsx
Participant
Posts: 160
Joined: Tue May 02, 2006 7:49 am

Post by suresh_dsx »

We have specified the below options in the sequential file stage.

Record level

final delimter=end
Record delimiter=UNIX newline


Field defaults

Dlimeter=Comma
Quote=double


Actual process expected:
i am sure i have to get the file with comma delimeter, so that i have used comma as field delimeter in the sequential file stage.

when i run the job with space delimeted file, it is running fine. as per the requirement it should get fail.


Additional information: when i view the data from sequential file stage, i am able to view the data for all the fields not as a single column.

Any help greatly appriciated.
Thanks
GJ_Stage
Participant
Posts: 131
Joined: Mon Oct 27, 2008 6:59 am

Post by GJ_Stage »

As I told earlier in my reply - defauly delimiter is space So it will work fine without fail. If you wanted to fail you need to do explicit check in transforamtion stage.
GJ_Stage
Participant
Posts: 131
Joined: Mon Oct 27, 2008 6:59 am

Post by GJ_Stage »

What I am trying to say is , Before you read the file with delimiter - Read each line as one record and check if anything otherthan comma after the second quote then fail the job.
I have tested the same (file without comma) and it is loading so I put the above condition and fail the job.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

suresh_dsx wrote:Finally, The sequential fine having any delimiter (space, comma, pipe), it is working fine.
That just seems... odd to me and not any kind of behaviour I recall seeing in the past. I would have said the same thing Ray did. :?
suresh_dsx also wrote:So can I treat this is a bug in data stage V8.1 version. Do I need to ask IBM for patch or am I need to add any options in the sequential file stage to control.
Only way to know is to ask, let us know what you find out.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply