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 Index » WebSphere Message Broker (ACE) Support » How to remove the '-' sign when we have a negative sign

Post new topic  Reply to topic
 How to remove the '-' sign when we have a negative sign « View previous topic :: View next topic » 
Author Message
m.arunprasad1
PostPosted: Wed Mar 27, 2013 11:27 pm    Post subject: How to remove the '-' sign when we have a negative sign Reply with quote

Novice

Joined: 11 Feb 2013
Posts: 19

Hi

I am using Message Broker 6.0.2 version and I am generating a fixed length format message where I have got an requirement that Amount whose length is 13 digits. Whenever I receive a negative value(eg:-2500 is coming as -000000002500 where as I need as 0000000002500). Basically, I need to ignore the negative '-' sign in the output message but I am getting an '-' sign. I have highlighted the values in bold

Acutal Output Message:

Code:
EUROX0090724100400000220000103012GB911412765   [b]-000000003000[/b][b]-000000002500[/b] 00000000[b]-000000002600[/b]


Expected Output Message:
Code:
EUROX0090724100400000220000103012GB911412765   [b]0000000003000[/b][b]0000000002500[/b] 00000000[b]0000000002600[/b]


Please Help [/b]
Back to top
View user's profile Send private message
praj1740
PostPosted: Thu Mar 28, 2013 1:00 am    Post subject: Reply with quote

Apprentice

Joined: 05 Feb 2013
Posts: 29
Location: INDIA

Hi,
Use the trim function For removing negative sign when mapping the input root to output Root.
For example
Code:
TRIM('b' FROM 'bbbaaabbb')

returns 'aaa'.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Mar 28, 2013 1:37 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I am generating a fixed length format message
Some questions:
- which domain are you using?
- if domain is MRM, state whether CWF or TDS
- what is the simple type of this element ( string/integer/decimal )?

praj1740: If the OP is using the MRM domain to write this message format then the field in OutputRoot might not be a string, in which case the TRIM function would not be an option
Back to top
View user's profile Send private message
m.arunprasad1
PostPosted: Thu Mar 28, 2013 2:43 am    Post subject: Reply with quote

Novice

Joined: 11 Feb 2013
Posts: 19

Quote:

Some questions:
- which domain are you using?
- if domain is MRM, state whether CWF or TDS

I am using MRM Domain with TDS
Quote:
- what is the simple type of this element ( string/integer/decimal )?

I have defined the simple type as INTEGER

Solution which I tried out and is working:

In the message set, I have made the negative sign as '0' instead of '-'
Kimbert, Please let know this is a right way of acheiving the expected output?
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Mar 28, 2013 2:53 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
In the message set, I have made the negative sign as '0' instead of '-'
Kimbert, Please let know this is a right way of acheiving the expected output?
So you are
- putting a negative integer value into OutputRoot.MRM
- telling the TDS parser that the field is signed
- telling the TDS parser to write the sign as '0' instead of '-'

Well, that will work, I guess. It wouldn't be my first choice, though. The straightforward solution would be
- Use the ABS function to create an unsigned value in OutputRoot.MRM
- tell the TDS parser that the number is unsigned
- set the pad character to '0' ( probably already done )
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to remove the '-' sign when we have a negative sign
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.