Special Characters

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
naren6876
Participant
Posts: 233
Joined: Mon Feb 07, 2005 7:19 pm

Special Characters

Post by naren6876 »

Hi,

My Input file has some special characters. I have used the HEX editor to find out them and they are (OD OA pairs) and HEX (00).

I want to replace them with the spaces.

I have gone thru the forum and found some solutions like

1). EReplace and Iconv with MCP

2). EReplace( string,char(13):char(10)," ")

3) Convert function.

Please let me know which one would be the best solution.

Any input would be highly appreciated.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

"0D 0A" are DOS record delimiters - CR/LF pairs. Use #2 for that and #3 for the hex zeroes.
-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 »

Make the record delimiter "DOS format" might work. Or are the 0D0A pairs within quoted strings?

Otherwise, to convert the NUL characters to space, define a stage variable svNUL initialized to Char(0) then:

Code: Select all

Convert(svNUL, " ", InLink.TheColumn)
To replace the CRLF pairs, define a stage variable svCRLF initialized to Char(13):Char(10) then:

Code: Select all

Ereplace(InLink.TheField, svCRLF, " ", -1, 0)
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