Page 1 of 1

escape character for \n in DataStage

Posted: Tue Sep 26, 2006 6:26 am
by Vijay Kumar
Hi,
One of the Oracle Field contains new line character as value. When I extract the field from Oracle database and write to a sequential file, a blank line is getting inserted after the record which contains newline character as the filed value.

I want to replace the newline charcter in my output with space.

What is the escape character in DataStage for new line character so that I can use convert function to replace it?

Regards,
Vijay

Posted: Tue Sep 26, 2006 6:37 am
by ray.wurlod
It's the same as anywhere. In what stage type are you attempting to effect this conversion? You might require Char(10) or you might be able to use the regular expression "\n" depending on what stage type you are using.

Posted: Tue Sep 26, 2006 6:39 am
by Vijay Kumar
I am trying to do it in a Transformer stage using convert function.
I will check whether convert(char(10),' ',<mapping column>) will work or not.

Regards,
Vijay

escape character for \n in DataStage

Posted: Fri Jul 02, 2010 6:31 am
by austin_316
using the function Convert(char(10),' ',Column1) i am able to replace the new line with a space. but i want to replace the new line with '*****'(5stars) in the column.can any one please tell me if this possible??

thanks

Posted: Fri Jul 02, 2010 6:46 am
by ray.wurlod
Yes it's possible. Use the parallel Ereplace() function published here on DSXchange by DSGuru some time back.