DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
deesh
Participant



Joined: 08 Oct 2007
Posts: 188

Points: 1897

Post Posted: Mon Aug 13, 2018 5:24 am Reply with quote    Back to top    

DataStage® Release: 8x
Job Type: Parallel
OS: Unix
Hi,

My source having CHAR datatype and target has VARCHAR datatype. While moving data I am getting junk character into target.

Same thing s happening while moving data from VARCHAR to CHAR.

One of the options is to trim the column through out the job, but I need a better option.

Please suggest how to remove the junk char.
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 42677
Location: Denver, CO
Points: 219803

Post Posted: Mon Aug 13, 2018 6:26 am Reply with quote    Back to top    

Well, let's start with trying to explain what exactly your "junk" characters are. The vast majority of the time, they're simply perfectly good but misunderstood and mistranslated data, i.e. a characterset conversion issue. Can you post some before and after examples, please, so we can get you some proper help? I'd also like to know what exactly your source and target are and if you have any idea what characterset they are.

_________________
-craig

Research shows that 6 out of 7 dwarves aren't happy
Rate this response:  
Not yet rated
deesh
Participant



Joined: 08 Oct 2007
Posts: 188

Points: 1897

Post Posted: Mon Aug 13, 2018 4:07 pm Reply with quote    Back to top    

It is DB2 data, let me show an example

VARCHAR(5) data "ABCD" moved to CHAR(5) now data "ABCD " in the 5th character junk will happen instead of space.
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 42677
Location: Denver, CO
Points: 219803

Post Posted: Mon Aug 13, 2018 6:40 pm Reply with quote    Back to top    

You need to tell us what "junk" means, what the value of this unwanted character is. There must be a DB2 function that will give you that, on Oracle is it called DUMP. Also, what is your APT_STRING_PADCHAR environment variable set to? Left at its default, it can look like "junk" to some folks / systems.

_________________
-craig

Research shows that 6 out of 7 dwarves aren't happy
Rate this response:  
Not yet rated
asorrell
Site Admin

Group memberships:
Premium Members, DSXchange Team, Inner Circle, Server to Parallel Transition Group

Joined: 04 Apr 2003
Posts: 1680
Location: Colleyville, Texas
Points: 22817

Post Posted: Tue Aug 14, 2018 12:24 pm Reply with quote    Back to top    

Because you have not identified what kind of "junk" you are getting - my best guess is that your project is still using the default value 0x0 (Hex 0) for padding CHAR fields. CHAR fields are always automatically padded to their max length. Your job is probably using the default value from $APT_STRING_PADCHAR in the project environment variable settings.

Hex 0 is a somewhat problematic default. The 0x0 character is invisible in most cases unless you use "cat -tv", "od" or some other hex viewing mechanism.

The quick fix is to put $APT_STRING_PADCHAR into your job and set it to a space.

Note - if other jobs are also using that 0x0 default pad character, you might have issues with data from those jobs failing joins with data from your jobs.

_________________
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2017
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours