data loading from varchar to char field

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
rahulverma
Participant
Posts: 11
Joined: Wed Feb 25, 2009 11:00 pm
Location: Bangalore/Hyderabad

data loading from varchar to char field

Post by rahulverma »

Hi,

I have a column of datatype CHAR(20).
When the DataStage job loads data of length 15 into it, it pads the
remaining 5 spaces with unprintable characters (these are represented by squares in aqua data studio).
This is happening with all CHAR datatype fields at DB2 Target.
Is there any global setting which is causing this? Any other ideas?

Thanks in advance.
srinivas.g
Participant
Posts: 251
Joined: Mon Jun 09, 2008 5:52 am

Post by srinivas.g »

Use varchar.....
Srinu Gadipudi
rahulverma
Participant
Posts: 11
Joined: Wed Feb 25, 2009 11:00 pm
Location: Bangalore/Hyderabad

Post by rahulverma »

Changing target datatype to VARCHAR solves the problem.
Is there any Other way out to resolve this issue without changing target metadat? I am looking for the resolution without changing the target metadata.
Please suggest.
srinivas.g
Participant
Posts: 251
Joined: Mon Jun 09, 2008 5:52 am

Post by srinivas.g »

use this option in Transformer stage :Column name[1,15]
Srinu Gadipudi
srinivas.g
Participant
Posts: 251
Joined: Mon Jun 09, 2008 5:52 am

Post by srinivas.g »

Ignore previous post. Use below command
use this option in Transformer stage :Column name[1,len(columnname)]
Srinu Gadipudi
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

srinivas.g wrote:Ignore previous post. Use below command
use this option in Transformer stage :Column name[1,len(columnname)]
Isn't it same as saying just 'columnName' !?
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Search for APT_PADCHAR.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

$APT_STRING_PADCHAR controls that and the default is a hex zero. Change it to a hex 20 to pad with spaces.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Mandy23
Participant
Posts: 8
Joined: Wed Nov 09, 2011 4:04 pm
Location: USA

Post by Mandy23 »

srinivas.g wrote:Ignore previous post. Use below command
use this option in Transformer stage :Column name[1,len(columnname)]
Thanks Srinivas.
This helped to solve my problem.

Thanks,
Mandy
Post Reply