|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Using the translate function in a mapping node |
« View previous topic :: View next topic » |
Author |
Message
|
jrsetters |
Posted: Thu Dec 22, 2011 12:41 pm Post subject: Using the translate function in a mapping node |
|
|
 Acolyte
Joined: 24 Aug 2011 Posts: 72 Location: Cincinnati, OH
|
I am trying to figure out the correct syntax for removing the dashes from a social security number in an inbound message. We are using a mapping node and I have added the following (and several variations of) this statement to the target value field without success:
fn:translate( $source/tns1ADT/tns1:PID/tns1:PID.19.SSNNumberPatient , - , '')
Basically when the SSN is in 123-45-6789 format, I want it to map as 123456789 instead.
Anyone have any suggestions? |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu Dec 22, 2011 12:45 pm Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Better to use a Compute Node or a Java Compute Node for this task. Mapping nodes are cumbersome for the task you describe. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
Vitor |
Posted: Thu Dec 22, 2011 12:50 pm Post subject: Re: Using the translate function in a mapping node |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jrsetters wrote: |
I have added the following (and several variations of) this statement to the target value field without success: |
Define "without success" - the SSN still has dashes? Becomes null? Becomes spaces? The flow won't deploy? The flow turns green? A Martian war machine knocks on the window & asks if you know any good remidies for a cold every time you save the code?
Better information, better advice. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jrsetters |
Posted: Thu Dec 29, 2011 6:54 am Post subject: |
|
|
 Acolyte
Joined: 24 Aug 2011 Posts: 72 Location: Cincinnati, OH
|
lancelotlinc wrote: |
Better to use a Compute Node or a Java Compute Node for this task. Mapping nodes are cumbersome for the task you describe. |
Apparently translate is simply not available in the mapping node. Once I got the syntax right, I received a "function not available" message.
I ended up using substrings of the three SSN parts and then the fn:concat function to combine them.
Cumbersome, as you said, but our management explicitly wants all possible data mapping to be performed in mapping nodes and only message filtering and routing to be done via eSQL.
Thanks! |
|
Back to top |
|
 |
Vitor |
Posted: Thu Dec 29, 2011 7:13 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jrsetters wrote: |
Cumbersome, as you said, but our management explicitly wants all possible data mapping to be performed in mapping nodes and only message filtering and routing to be done via eSQL. |
But if this mapping isn't possible because the function isn't availble...
You're also going to find as your data manipulation requirements become more complex the Mapping node becomes increasingly unsuitible. For this fairly simple task you're using multiple mapping functions where a single line of ESQL would achieve the same.
You might want to enquire with your management if they're happy to have huge, cumbersome and hard to maintain mapping nodes in the name of purity. Compute nodes exist for a reason.
Even if the policy isn't changed, when they start to complain that the flows take ages to process data and the problems are impossible to locate you can remind them about the conversation... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|