Quote character within a quoted text field

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
dohertys
Participant
Posts: 39
Joined: Thu Oct 11, 2007 3:26 am
Location: Sheffield

Quote character within a quoted text field

Post by dohertys »

Hi ,
I've got a comma separated file with character fields quoted with "s.

I've found some records where there is a section within a character field that is quoted with 2 double quotes.

e.g.
1,"some field1","some field with a ""quoted section"" in it",2

This seems to cause my datastage to assume that its a new field when it sees the "" characters.

Anyone got any ideas how I should handle that ?

Why does datastage treat the " character as though it signifies a new field ( when the file is using comma as the delimiter).?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Because it does. [shrug]

Have you tried using a Server job for that, they are more... forgiving.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dohertys
Participant
Posts: 39
Joined: Thu Oct 11, 2007 3:26 am
Location: Sheffield

Post by dohertys »

A good plan, but I've got to use our 'standard' jobs. (We've got a generic bit of px code to take any file and load it into a table with the same format).


I think I might stick a unix script with a sed command to remove "" from the file...unless anyone's got any other ideas.

Is there anything that can be set in the orchestrate schema definition for the input file layout which would handle these double quotes?
betterthanever
Participant
Posts: 152
Joined: Tue Jan 13, 2009 8:59 am

Post by betterthanever »

If have control over the source files you were reading, i would suggest to get them tab delimited so that you will not have these issues with quotes...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That won't help, it's not the field delimiter that's the issue, it's the fact that string fields are double-quoted and then have them inside as well. You could try removing that property from the field and then trim the quotes from inside the job, I would think.
-craig

"You can never have too many knives" -- Logan Nine Fingers
betterthanever
Participant
Posts: 152
Joined: Tue Jan 13, 2009 8:59 am

Post by betterthanever »

i agree..presumed problem with a ',' and replied for a "" ..my bad.. avoiding quotes on source side will help..
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In which case set the Quote character in the format to none.
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