Handling ASCII VALUE

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
oracle
Participant
Posts: 43
Joined: Sat Jun 25, 2005 11:52 pm

Handling ASCII VALUE

Post by oracle »

Hello,
Ascii value is appending end of the data for the column .Can you help us how to remove ascii value using datastage.

for example we are defaulting "1111" to db2 column which is having length of the char(15) then output coming as "1111+asciivalues.

deafult env variable in our project is APT_PADCHAR_STRING=0x0. we have tried changing env value as space , blank , but we could b't able to remove ascii value.

can some share ur idea how to handle ascii values.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

WHAT ascii value? It's important to identify any characters you want to remove. I'm also curious how you changed APT_PADCHAR_STRING to a "space", I'm guessing you did not set it to "0x20" which is the hex representation of the space character that you want.
Last edited by chulett on Sun Jun 02, 2013 5:15 pm, edited 1 time in total.
-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 »

Whatever character is defined by APT_STRING_PADCHAR will be used to pad CHAR strings.

The only way to prevent this from happening is to use VARCHAR data type.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
oracle
Participant
Posts: 43
Joined: Sat Jun 25, 2005 11:52 pm

Post by oracle »

Resolved the ascii issue while loading char(15) column in db2 table using below changes.

Added Environment variable APT_STRING_PADCHAR=0X20
Called this Environment variable in the DB2 connector stage.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Space is an ASCII character too, you know.

Why not mark this thread as Resolved?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Done.
-craig

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