Removing special character

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
paranoid
Premium Member
Premium Member
Posts: 185
Joined: Tue May 29, 2007 5:50 am

Removing special character

Post by paranoid »

Hi,

One of your jobs is failing daily due to a special character in the input data where we need to manually delete that special character and loading the data.

Eg:

Input data : SDS22MM SDS bushing 22mm ID ¼ key

I guess, the input source might have had the data as A to the power of 1/4 and during its import to a text file it is being converted to 2 characters as ¼ and this resulting in the increase of the record length and getting failed.

Appreciate your help.

Thanks in advance
Sue
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Find out what that character actually is, using a hex viewer such as the od -xc command in UNIX or an editor like UltraEdit. Then you can use an appropriate Char() function to represent that character and either remove it or convert it to something else.

Just be sure that it's valid (according to the data owner's rules) to remove characters from their data.

You may need the special form of the Char() function if you're dealing with characters in the top half of eight-bit ASCII. The undocumented second argument is a true/false value that enables the use of the high-order bit. For example

Code: Select all

Char(164,@TRUE)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dbdecoy
Premium Member
Premium Member
Posts: 17
Joined: Tue Jul 15, 2008 1:17 pm
Location: Hyderabad

Post by dbdecoy »

thanks
Last edited by dbdecoy on Fri Aug 26, 2011 4:35 am, edited 1 time in total.
paranoid
Premium Member
Premium Member
Posts: 185
Joined: Tue May 29, 2007 5:50 am

Post by paranoid »

Hi Ray,

BY using the command od -cx for the line SDS22MM SDS bushing 22mm ID ¼ key, i got the following output:

0000000 S D S 2 2 M M S D S b u s h
5344 5332 324d 4d20 5344 5320 6275 7368
0000020 i n g 2 2 m m I D 302 274 k
696e 6720 3232 6d6d 2049 4420 c2bc 206b
0000040 e y
6579
0000042

Plese help me out in intrepreting this.

Thanks again
Sue
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can you please wrap that in Code tags so that the spacing is not lost?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
paranoid
Premium Member
Premium Member
Posts: 185
Joined: Tue May 29, 2007 5:50 am

Post by paranoid »

Code: Select all

0000000   S   D   S   2   2   M   M       S   D   S       b   u   s   h
            5344    5332    324d    4d20    5344    5320    6275    7368
0000020   i   n   g       2   2   m   m       I   D     302 274       k
            696e    6720    3232    6d6d    2049    4420    c2bc    206b
0000040   e   y
            6579
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Code not quote. Fixed.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply