Parsing String with Input Column Stage - double quote 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
mark1024
Participant
Posts: 9
Joined: Mon Nov 07, 2011 12:23 pm

Parsing String with Input Column Stage - double quote error

Post by mark1024 »

I am using MQ and I have to parse the payload. I am using Import column to parse the payload, after its taken from MQ.

The Payload is Pipe delimited, and strings are double quoted.
Given the following input, the importColumn stage is not parseing the string propertyl

"Apple"|"blue Jay"|"Rating "A" Note"|

Now the first 2 works, the 2nd gets parsed and ends after "Rating " the rest does not get into the columns.

THe question is: How do I get the parser to in Column input stage to
not stop its string at the first double quote. But only when it gets "| at the end of the string.


Did not find this issue until parralle test in proudciton.
Mark THomas
Data Architect
IBM GBS
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Unfortunately the string
"Rating "A" Note"
is not well-formed and cannot be parsed using the column definition of quoted strings. Unless you can make the party creating the quoted string do this correctly, i.e. create a string
"Rating ""A"" Note"
, then the next best thing would be to read the columns as unquoted strings and parse them yourself.
Option A - quotes inside strings aren't important = Convert('"','',In.Column)
Option B - quotes need to be kept in strings = In.Column[2,LEN(In.Column)-2])
Post Reply