Escaping Delimiters & Newlines

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
gsherry1
Charter Member
Charter Member
Posts: 173
Joined: Fri Jun 17, 2005 8:31 am
Location: Canada

Escaping Delimiters & Newlines

Post by gsherry1 »

Is it possible to escape data values that are equal to the delimiter used or the newline character used, to prevent the file from being parsed incorrectly?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Usually you have a choice of what delimiter to use in DataStage jobs, i.e. you can make a derivation "hello world" or 'Hello world' and \Hello world\.
If you have all 3 delimiters in a single string then you need to improvise, i.e.
x = 'This is a "':"'":'" singly and doubly ':/ "'confusing'"/:' string.'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Basically no. What you've got is a file that does not comply with the published standards.

You can get around it, but the technique is not escaping particular characters (which you'd have to do before DataStage reads the file based on metadata).

Unless, of course, you pre-processed the file with a DataStage job that reads the entire line as a single VarChar column, and parses it correctly into a second file.

In the Columns grid scroll right and you will see some extra rules that you can set up to handle line terminators in data, override null handling and padding, and so on. Use these in combination with the parsing job and you'll be most of the way to a solution.
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