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


since April 2006

Group memberships:
Premium Members

Joined: 06 Apr 2006
Posts: 9
Location: MARSEILLE
Points: 87

Post Posted: Wed Sep 27, 2006 8:23 am Reply with quote    Back to top    

DataStage® Release: 5x
Job Type: Server
OS: Unix
Hi,

I have a problem to make a SUBSTRING when i load a DOS file from my Unix Datastage.

I have a file that containt some lines like this one :
Str = "15 100.000000Goûter 1 Goû102093101020003810200013"
For example i would like to do a substrings(Str,21,20) but i have a problem with this specific "û" character that generate bad columns.

Do you know what function i have to use to resolve this problem ?

Thanks
ArndW

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup

Joined: 16 Nov 2004
Posts: 14022
Location: Germany
Points: 79230

Post Posted: Wed Sep 27, 2006 8:31 am Reply with quote    Back to top    

You can use the convert() function to replace that character with some other one.

_________________
Image
Rate this response:  
Not yet rated
DeepakCorning



Group memberships:
Premium Members

Joined: 29 Jun 2005
Posts: 501

Points: 3171

Post Posted: Wed Sep 27, 2006 8:33 am Reply with quote    Back to top    

When you say you have a problem , do you mean that you are getting some kind of warning while running the Job? If yes can you please let us know the warning/error message.

Usually you have to make changes in the NLS setting of the jobs to handle special character, but can not comment till I see the warnign message.
Rate this response:  
Not yet rated
scognet


since April 2006

Group memberships:
Premium Members

Joined: 06 Apr 2006
Posts: 9
Location: MARSEILLE
Points: 87

Post Posted: Wed Sep 27, 2006 8:51 am Reply with quote    Back to top    

I have no good result with "Ereplace" or "Convert" function because i think i'm in front of difference between DOS and UNIX character.

In log of Director i ave just somme logs with "value too large" because i don't do correctly the substring.

Thanks
Rate this response:  
Not yet rated
DeepakCorning



Group memberships:
Premium Members

Joined: 29 Jun 2005
Posts: 501

Points: 3171

Post Posted: Wed Sep 27, 2006 8:58 am Reply with quote    Back to top    

scognet wrote:

In log of Director i ave just somme logs with "value too large" because i don't do correctly the substring.
Thanks


Can you put a Seq or Hashed File and pull out this value in it. That will give an idea what exactly what is going in to the target.
Rate this response:  
Not yet rated
ArndW

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup

Joined: 16 Nov 2004
Posts: 14022
Location: Germany
Points: 79230

Post Posted: Wed Sep 27, 2006 8:58 am Reply with quote    Back to top    

if you don't care what you convert it to to then use OCONV(In.ColumnName,'MCP') to convert unprintable characters to a "." (period).

_________________
Image
Rate this response:  
Not yet rated
scognet


since April 2006

Group memberships:
Premium Members

Joined: 06 Apr 2006
Posts: 9
Location: MARSEILLE
Points: 87

Post Posted: Wed Sep 27, 2006 9:22 am Reply with quote    Back to top    

Ok with OCONV MCP
When i use Oconv(Str,'MCP') Datastage convert the caracter 'û' to '.'. So its good for me but my target is to have 'u'.

Thanks
Rate this response:  
Not yet rated
ArndW

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup

Joined: 16 Nov 2004
Posts: 14022
Location: Germany
Points: 79230

Post Posted: Wed Sep 27, 2006 9:24 am Reply with quote    Back to top    

Well, then you need to do a convert('û' ,'u',In.Column)

_________________
Image
Rate this response:  
Not yet rated
DeepakCorning



Group memberships:
Premium Members

Joined: 29 Jun 2005
Posts: 501

Points: 3171

Post Posted: Wed Sep 27, 2006 9:41 am Reply with quote    Back to top    

Just wanted to ask you that are you sure you will never have any other special cahracters other than what you specified here?? If yes then the above solution is perfect !!
Rate this response:  
Not yet rated
srinivas_dsx



Group memberships:
Premium Members

Joined: 17 Nov 2005
Posts: 7

Points: 60

Post Posted: Wed Sep 27, 2006 11:22 am Reply with quote    Back to top    

DeepakCorning wrote:
Just wanted to ask you that are you sure you will never have any other special cahracters other than what you specified here?? If yes then the above solution is perfect !!


Adding to Deepak comments...

Usually these characters are from European character set and are called "diacritic" characters. It is possible that if one creeps in other will follow. We had a similar issue, but our issue started when we converted from non-NLS to NLS. Deepak is right in pointing out that we need more information about your situation.

Assuming that you are using NLS, one cautious option would be to look at using Unicode character set/code page to resolve this issue. If your setup is non-NLS then it should be straight forward as others suggested.

Srinivas
Rate this response:  
Not yet rated
scognet


since April 2006

Group memberships:
Premium Members

Joined: 06 Apr 2006
Posts: 9
Location: MARSEILLE
Points: 87

Post Posted: Thu Sep 28, 2006 6:33 am Reply with quote    Back to top    

Some answers to your questions.

I'm with Datastage server without NLS option. The customer doesn't want to implement it now. So i have to work with "exotic" solution.

I have a good result with Oconv(Str,"MCP"). It's good because it make "Converts unprintable characters". I can't use "convert" because when i try to convert 'û' Datastage not reconise 'û'.

Do you know if in Datastage is ther another function to detect all "unprintable characters" ?

Thanks
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

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

Joined: 23 Oct 2002
Posts: 41076
Location: Canberra, Australia
Points: 228937

Post Posted: Thu Sep 28, 2006 3:30 pm Reply with quote    Back to top    

There is no out-of-the-box function for detecting non-printing characters unless NLS is enabled. But you could write your own. Code: FUNCTION IsPrintable(TheString) * Returns 1 ( ...

_________________
Zenith Solutions (Australia) Pty Ltd
-- from obscurity to clarity
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