Whitespace added after every 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
pandujoy
Participant
Posts: 70
Joined: Tue May 13, 2008 1:37 pm

Whitespace added after every value

Post by pandujoy »

Hi Gurus,

I have a input field coming all char data types and when i do a lookup against char datatype fields the lookup is failing becoz the values are coming along with spaces.

ex. char (3) input field - "30" when i do a look up for this field the data is getting rejected and the if i see the data in reject file it shows "30 "

I have tried using trim/stripwhitespaces/trimleadingand trailing.

I have the $APT_STRING_PADCHAR to 0x20 .

Not sure what is the problem..all the datatype as char fields....please help me out.... :? :(
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's how CHAR fields work, they are always padded to their full length and that typically with spaces (0x20). Is your lookup field a CHAR(3) as well or a different size CHAR?
-craig

"You can never have too many knives" -- Logan Nine Fingers
pandujoy
Participant
Posts: 70
Joined: Tue May 13, 2008 1:37 pm

Post by pandujoy »

thanks for the reply...My lookup is also char(3)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Then as long as both sources are space padded, there shouldn't be an issue matching "30 " to "30 ". What do they look like in your lookup source?
-craig

"You can never have too many knives" -- Logan Nine Fingers
pandujoy
Participant
Posts: 70
Joined: Tue May 13, 2008 1:37 pm

Post by pandujoy »

thanks again for the instace answer...

in the lookup they look like "30" and from input i am getting "30 " .
pandujoy
Participant
Posts: 70
Joined: Tue May 13, 2008 1:37 pm

Post by pandujoy »

Chulett,

I have one more requirement ...is to pass a null field to validate a field.

So as mentioned in the previous issue if i passing field1 it is give as "30 " and for the requirement 2 if i pass null value in i/p it is taking as whitespace...not sure whats wrong with it.....

Can you let me know if there is a way to lookup vchar input field to char field in database.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Then your lookup either isn't a CHAR(3) or perhaps the padding character was different when created. You might be able to solve this by simply calling your input field a VARCHAR(3) instead.
-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 »

Check the value of your 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Whitespace added after every value

Post by chulett »

pandujoy wrote:I have the $APT_STRING_PADCHAR to 0x20 .
-craig

"You can never have too many knives" -- Logan Nine Fingers
pandujoy
Participant
Posts: 70
Joined: Tue May 13, 2008 1:37 pm

Post by pandujoy »

plz help me out
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

chulett wrote:...You might be able to solve this by simply calling your input field a VARCHAR(3) instead.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

pandujoy wrote:plz help me out
Who, what or where is "plz"?
:?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Here in Germany, "PLZ" is the zip code, or "Postleitzahl".
pandujoy
Participant
Posts: 70
Joined: Tue May 13, 2008 1:37 pm

Post by pandujoy »

dats funny....any ways thanks for your help..mostly ray and ArnldW .....
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

And unmostly that chulett guy .... :P
-craig

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