Problem with hex '00' characters

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
swathi Singamareddygari
Participant
Posts: 48
Joined: Fri Feb 29, 2008 1:09 am
Location: Bangalore

Problem with hex '00' characters

Post by swathi Singamareddygari »

Hi ,

from source i am getting hex '00' values instead of blanks.

Can any one help me to convert hex '00' charcters with blanks

I am not sure if trim funtion detect and trim hex '00' values

I used convert function,but i am not getting how to represent hex '00' as a argument to the convert funtion.

If any one knows please help me

Thanks for your help
Thanks&Regards
S.Swathi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Search for APT_STRING_PADCHAR environment variable.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
adi_2_chaos
Participant
Posts: 96
Joined: Fri Apr 17, 2009 5:58 am
Location: Delhi

Post by adi_2_chaos »

You may define the hex vaalue "00" in the APT_STRING_PADCHAR
adi_2_chaos
Participant
Posts: 96
Joined: Fri Apr 17, 2009 5:58 am
Location: Delhi

Post by adi_2_chaos »

You may also use Exchange (string, find.character, replace.character)

find.character is the hexadecimal value of the character to find and replace.character is the hexadecimal value of the replacement character. If somehow u can find the hexadecimal values mapping from somewhere, I think your job may be easy.
Please correct me if i'm wrong....
swathi Singamareddygari
Participant
Posts: 48
Joined: Fri Feb 29, 2008 1:09 am
Location: Bangalore

Post by swathi Singamareddygari »

Hi ray,

Thanks for your help,

To overcome this problem to which value i have to set to APT_STRING_PADCHAR variable.

This variable will Overrides the pad character of 0x0 (ASCII null)

If we set this variable to some other value will trim function trims the blanks also.

I dont know exactly about APT_STRING_PADCHAR varibale.

Please tell me what i am thiniking is correct or not

Thanks for your help
Thanks&Regards
S.Swathi
ShaneMuir
Premium Member
Premium Member
Posts: 508
Joined: Tue Jun 15, 2004 5:00 am
Location: London

Post by ShaneMuir »

If you set your APT_STRING_PADCHAR variable to '0x20' it will pad your string with spaces which can then be removed with your trim function.

However it is important to note that this variable must be included in the job where the padding of the stsring is happening. If your data is already padded with the hex'00' then adding APT_STRING_PADCHAR with the '0x20' value will have little effect.

How are the records getting padded with the Hex'00' value? Is it set as the environment default? Or is it coming in from your source data?
swathi Singamareddygari
Participant
Posts: 48
Joined: Fri Feb 29, 2008 1:09 am
Location: Bangalore

Post by swathi Singamareddygari »

Hi ShaneMuir,

Thanks for you replay,

from the source itself i am getting hex '00' characters.
So i have to trim those characters along with spaces.

will the Datastage Trim function trims the hex '00' characters also?

Can you please help me out to reslove this problem.

Is APT_STRING_PADCHAR variable helps for thsi problem

Thanks for your help
Thanks&Regards
S.Swathi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

APT_STRING_PADCHAR will not help. Try a Trim() function with Char(0) as the second argument.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ggarze
Premium Member
Premium Member
Posts: 78
Joined: Tue Oct 11, 2005 9:37 am

Post by ggarze »

I believe I got how to correct my data. I dumped it to a transformmer did a trim(field,Char(0),"A") and loaded it back in.

I will rework my jobs to get to a varchar sooner and trim the incoming data from source.

Any difference in trim() with no options compared to StripWhiteSpace()?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes, Trim() will reduce multiple internal space characters to single.
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