to include double quote in front and rear of row of data

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
agathaeleanor
Participant
Posts: 76
Joined: Mon Mar 05, 2007 9:26 pm
Location: Malaysia

to include double quote in front and rear of row of data

Post by agathaeleanor »

Hi All expert,

Need your advice on how do i achieve on below scenario.

Due to some constraint, sequential file is given in a format of (separate by delimiter --> ","

001","CEREL","29","1-yearly","1990

However in DS, I am require to include a double quote(front and rear) for each row of data as

"001","CEREL","29","1-yearly","1990"

May I know how can I achieve this in DS?
Thanks in advance for your help.
BI-RMA
Premium Member
Premium Member
Posts: 463
Joined: Sun Nov 01, 2009 3:55 pm
Location: Hamburg

Re: to include double quote in front and rear of row of data

Post by BI-RMA »

Hi agathaeleanor,

To read the file, set the option "delimiter string" of the Sequential-File-Stage to <<",">> and the Option Quote Character to <<none>>. That's it.

If your target is another sequential file, set the format-option for Quote Character of the output-file to double quotes and the option delimiter to <<,>>. Again: That's it. Is there any other scenario where you would want quotes in your output?
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Read the entire line as a single VarChar field, then concatenate quote characters in a Transformer stage before parsing into separate fields.
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