ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportExtract Decimal Part in Unit _WTX

Post new topicReply to topic
Extract Decimal Part in Unit _WTX View previous topic :: View next topic
Author Message
nick009
PostPosted: Wed Mar 08, 2017 10:18 am Post subject: Extract Decimal Part in Unit _WTX Reply with quote

Newbie

Joined: 08 Mar 2017
Posts: 6

Team,

As part of my mapping I have a requirement to select the integer part and fractional part from the same input value. For the INT part I got the function, I could not find how to address the fractional part issue.



Input - Unit field : 123.05

Output - Unit-I : 123

Unit-F : 05



Unit -I is taken care of with the INT () function. Just need to handle the fractional part. Please drop your ideas.

Regards,

Nick
Back to top
View user's profile Send private message
timber
PostPosted: Wed Mar 08, 2017 10:30 am Post subject: Reply with quote

Yatiri

Joined: 25 Aug 2015
Posts: 614

See answer in http://www.mqseries.net/phpBB2/viewtopic.php?t=73693
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Mar 08, 2017 10:30 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24301
Location: Ohio, USA

Isn't the fractional part what's left after you subtract the results of the INT() from the original number?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Mar 08, 2017 10:31 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24301
Location: Ohio, USA

timber wrote:
See answer in http://www.mqseries.net/phpBB2/viewtopic.php?t=73693


And there's that of course
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
nick009
PostPosted: Wed Mar 08, 2017 10:40 am Post subject: Reply with quote

Newbie

Joined: 08 Mar 2017
Posts: 6

That's Right Vitor.

When you use INT () function, it drops the fractional part and passes only the integer value.

EX : INT(234.0 will pass only 234 value.

In WTX, I am not 100% sure if I can save the input value just like we can do in MB and then use the logic to extract the required.

NICK
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Mar 08, 2017 11:43 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24301
Location: Ohio, USA

nick009 wrote:
In WTX, I am not 100% sure if I can save the input value just like we can do in MB and then use the logic to extract the required.


You can certainly refer back to the original value.

And behold another good reason to use MB not WTX. Seriously. WTX is the preserve of complex, multi-level validation and transformations at the bit level. If all you're doing is converting XML to a copybook, then not only are you making it much harder for yourself but you're wasting the money that you're spending on WTX license (both for the design studio and the runtime). We have WTX on this site, so I speak with authority on cost.

If your immediate response is, "well we have other transformations that require WTX" then my retort is you don't need to use WTX for every single transaction given MB's routing capability.

Or to put it another way - if you really, believe you need WTX for all transformations, run it in standalone mode and cut MB out of the equation.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportExtract Decimal Part in Unit _WTX
Jump to:



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
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.