how to handle the escape code in sequential file stage

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
yimwai
Participant
Posts: 46
Joined: Thu Jul 01, 2010 9:34 pm

how to handle the escape code in sequential file stage

Post by yimwai »

I use a sequential stage to read a DB2 exported file .
one record only has two columns one is id (int),the other is name(char(60))
but sometime there will be a " in the second column, after exported,there will be double " in the file,one is the escape code.
so in this time how can i read the file?
if i set the column length 60,sometime it will be too short
if i set the column length longer or use type varchar,the stage will read double " in the column .
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If it can 'read the double " in the column' successfully, why not simply remove them using Convert() afterwards? Or reduce it to a single occurance if that's what you need.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use type VarChar or set the length sufficiently longer.
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