DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
This topic has been marked "Resolved."
Author Message
siva9880
Participant



Joined: 02 Apr 2008
Posts: 12

Points: 88

Post Posted: Thu Jun 21, 2012 8:50 pm Reply with quote    Back to top    

DataStage® Release: 8x
Job Type: TX
OS: Windows
Hello All

trim the alphabetic character(s) to the right of an element that can contain alphanumeric characters at input.

e.g, input – output

1. ABCD1234 – ABCD1234

2. ABCD1235X – ABCD1235

3. 1234ABCD – 1234

4. ABCD1236YZX – ABCD1236

5. ABCD – ABCD –> Exceptional case!

6. A1B22X – A1B22


There is no limitation on the length of the input or output element value length. Also, there can be any number of (0 to many) alphabetic characters at the right side.

Thanks in advance
vamsi.4a6
Participant



Joined: 22 Jan 2012
Posts: 334

Points: 2984

Post Posted: Fri Jun 22, 2012 12:23 am Reply with quote    Back to top    

1)Replace some dummy character # for all the alphabets using convert function

2)Remove the trailing dummy character # by using Trim function with proper arguments and handle the [ABCD – ABCD –> Exceptional case! ] by using proper IF statements
Rate this response:  
ray.wurlod

Premium Poster
Participant

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

Joined: 23 Oct 2002
Posts: 54479
Location: Sydney, Australia
Points: 295436

Post Posted: Fri Jun 22, 2012 3:21 am Reply with quote    Back to top    

What the OP really wants, vamsi.4a6, is a WebSphere TX map. This is NOT a requirement for a DataStage solution. That's why it's in the TX forum.

_________________
RXP Services Ltd
Melbourne | Canberra | Sydney | Hong Kong | Hobart | Brisbane
Rate this response:  
Not yet rated
siva9880
Participant



Joined: 02 Apr 2008
Posts: 12

Points: 88

Post Posted: Fri Jun 22, 2012 3:25 am Reply with quote    Back to top    

Please help me in WTX8.3
Rate this response:  
Not yet rated
vamsi.4a6
Participant



Joined: 22 Jan 2012
Posts: 334

Points: 2984

Post Posted: Fri Jun 22, 2012 4:34 am Reply with quote    Back to top    

@ray.wurlod

Sorry Ray I have not check it properly
Rate this response:  
Not yet rated
siva9880
Participant



Joined: 02 Apr 2008
Posts: 12

Points: 88

Post Posted: Sun Jul 01, 2012 6:57 am Reply with quote    Back to top    

Got the solution by my own.

solution for this case is
=TRIMRIGHT(input, WORD(input, RIGHT( LEAVENUM(input),1), -1))

Thanks,
siva9880
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