escape character for \n in DataStage

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
Vijay Kumar
Participant
Posts: 59
Joined: Sat May 29, 2004 12:31 am
Location: Pune

escape character for \n in DataStage

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Vijay Kumar
Participant
Posts: 59
Joined: Sat May 29, 2004 12:31 am
Location: Pune

Post 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
austin_316
Participant
Posts: 80
Joined: Fri Aug 21, 2009 7:49 am
Location: India

escape character for \n in DataStage

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes it's possible. Use the parallel Ereplace() function published here on DSXchange by DSGuru some time back.
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