Specific character in string

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You can use the convert() function to replace that character with some other one.
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Re: Specific character in string

Post by DeepakCorning »

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.
scognet
Charter Member
Charter Member
Posts: 9
Joined: Thu Apr 06, 2006 2:00 pm
Location: MARSEILLE

Re: Specific character in string

Post by scognet »

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
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Re: Specific character in string

Post by DeepakCorning »

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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

if you don't care what you convert it to to then use OCONV(In.ColumnName,'MCP') to convert unprintable characters to a "." (period).
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post by DeepakCorning »

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 !!
srinivas_dsx
Premium Member
Premium Member
Posts: 7
Joined: Thu Nov 17, 2005 12:00 pm

Post by srinivas_dsx »

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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is no out-of-the-box function for detecting non-printing characters unless NLS is enabled. But you could write your own.

Code: Select all

FUNCTION IsPrintable(TheString)
* Returns 1 (true) if the string contains only printable characers, 0 otherwise
   Ans = ((TheString) = Oconv((TheString),"MCP")
RETURN(Ans)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply