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



Group memberships:
Premium Members

Joined: 22 Apr 2005
Posts: 38

Points: 467

Post Posted: Wed Oct 10, 2007 4:49 pm Reply with quote    Back to top    

DataStage® Release: 7x
Job Type: Parallel
OS: Unix
Hi All,
Following is the code being used in Ab Initio:
out.pd_into_ovrdrft_cd :: string_replace(re_replace(in.pd_into_od_cd, "[\001-\037|\177-\377]", " "), char_string(0), " " );

My understanding is Within the column pd_into_od_cd, any occurrence of a value between \001 and \037 (control characters) or between \177 and \377 (non-ASCII characters or non-printable characters) should be replaced finally by 1 space

Can we use same code in a convert function? Or is there other way of doing this?

Thanks in advance.
-Amit
ArndW

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup

Joined: 16 Nov 2004
Posts: 16311
Location: Germany
Points: 92496

Post Posted: Wed Oct 10, 2007 5:25 pm Reply with quote    Back to top    

The Ab Initio code looks like a direct interlude to the unix tr command; which you can use as a filter in the source sequential stage. The syntax of the DataStage CONVERT function is very differen ...

_________________

Image
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: 54259
Location: Sydney, Australia
Points: 294280

Post Posted: Wed Oct 10, 2007 5:27 pm Reply with quote    Back to top    

Convert() does not support ranges or octal representation, but you can set up a stage variable containing a string of all the characters to be converted, and a single Convert() function can then be us ...

_________________
RXP Services Ltd
Melbourne | Canberra | Sydney | Hong Kong | Hobart | Brisbane
currently hiring: Canberra, Sydney and Melbourne
Rate this response:  
Not yet rated
katz


since March 2006

Group memberships:
Premium Members

Joined: 20 Jan 2005
Posts: 52

Points: 770

Post Posted: Thu Oct 11, 2007 5:03 pm Reply with quote    Back to top    

Just thinking aloud, but could this translation be done using a custom NLS map?

katz
Rate this response:  
Not yet rated
Amit Jaiswal



Group memberships:
Premium Members

Joined: 22 Apr 2005
Posts: 38

Points: 467

Post Posted: Sat Oct 13, 2007 7:58 am Reply with quote    Back to top    

Hi,

I am sorry Ray, since I am not a premium member of this forum I am not able to see your copleter response here. I am still struggling with this. Can anyone tell me how to find and replace non-ascii/control characters from the string?
Thanks in advance.

-Amit
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: 42622
Location: Denver, CO
Points: 219444

Post Posted: Sat Oct 13, 2007 8:07 am Reply with quote    Back to top    

Said pretty much the same Arnd did. Investigate the Convert function, use multiple Char() functions cat'd together to build the list of characters to change.

_________________
-craig

And I'm hovering like a fly, waiting for the windshield on the freeway...
Rate this response:  
Not yet rated
us1aslam1us


since April 2006

Group memberships:
Premium Members, Heartland Usergroup

Joined: 17 Sep 2005
Posts: 822
Location: USA
Points: 4037

Post Posted: Sat Oct 13, 2007 3:56 pm Reply with quote    Back to top    

If i remember it correctly, one of the user 'michaeld' or 'bcarlson' has written a generic 'C' function and posted here which does this.Do a search in the forum.

_________________
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
Rate this response:  
Not yet rated
olgc
Participant



Joined: 18 Nov 2003
Posts: 140

Points: 1642

Post Posted: Fri Jun 01, 2018 12:27 pm Reply with quote    Back to top    

It can be detected with function index(strg, char(8206),1) for Unicode 0x200E, but it seems convert(strg, char(8206), '') doesn't recognise the char(8206), so doesn't work as expected.
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: 42622
Location: Denver, CO
Points: 219444

Post Posted: Fri Jun 01, 2018 12:38 pm Reply with quote    Back to top    

So... are you looking for help with that or simply providing help 11 years after the fact? Wink

_________________
-craig

And I'm hovering like a fly, waiting for the windshield on the freeway...
Rate this response:  
Not yet rated
olgc
Participant



Joined: 18 Nov 2003
Posts: 140

Points: 1642

Post Posted: Fri Jun 01, 2018 1:11 pm Reply with quote    Back to top    

Another function works: ereplace(strg, char(8206), '')
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