Page 1 of 1

Escaping Delimiters & Newlines

Posted: Mon Aug 22, 2005 9:41 am
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?

Posted: Mon Aug 22, 2005 9:50 am
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.'

Posted: Mon Aug 22, 2005 5:35 pm
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.