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 » CR in the Element value

Post new topic  Reply to topic
 CR in the Element value « View previous topic :: View next topic » 
Author Message
RocknRambo
PostPosted: Thu Sep 02, 2004 4:25 am    Post subject: CR in the Element value Reply with quote

Partisan

Joined: 24 Sep 2003
Posts: 355

hello everybody!!..

how can we remove a CR (carriage return) in the element value if it exists.


ex:
<a>
2113
</a>
<b>
12.213
</b>

the reason I'm behind is. ..I need to get the product of a and b. (a times b). the way I'm approaching is with a TRIM than cast as decimal and get the mulitiplication. but its throwing an error, invalid casting of char to decimal.

any thoughts to share...

thanks in advance.
sanu
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Sep 02, 2004 4:41 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I think it doesn't like that one of your character strings doesn't have a decimal point in it.

You should look again at the specification for a decimal and what counts as a valid string representation. You might have to add ".0" to it.

Also, you can use TRIM to remove any characters, rather than just space.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
RocknRambo
PostPosted: Thu Sep 02, 2004 5:33 am    Post subject: Reply with quote

Partisan

Joined: 24 Sep 2003
Posts: 355

sorry my typo.

What I found was...the values for both the elements have decimal point.


a = 2113.00
b= 12.213

and what I also found was...If I manually remove the CR in the element value, its working perfect.

but now, the tricky part is the CR in the element is not ALWAYS. I dont see TRIM doing with job for me to remove CR.

any suggestions.. or the hard way to write a new logic to remove CR if one exits.

thanks in advnace.
sanu
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Sep 02, 2004 8:53 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Well, last I knew, you could use TRIM to remove any leading or trailing CRs - without checking to see if they exist first.

But check the documentation for the TRIM function for your version.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
RocknRambo
PostPosted: Thu Sep 02, 2004 9:42 am    Post subject: Reply with quote

Partisan

Joined: 24 Sep 2003
Posts: 355

hi jeff....

I have gone through the pdf and also tested..it..

the pdf says..we can remove trailing, both leading and trailing singletons can be removed.
so its only removing the spaces.



[/img]
Back to top
View user's profile Send private message
PGoodhart
PostPosted: Thu Sep 02, 2004 10:06 am    Post subject: Reply with quote

Master

Joined: 17 Jun 2004
Posts: 278
Location: Harrisburg PA

Ok, my guess is you are not specifying the singleton. Here is an example from the help files:
TRIM('b' FROM 'bbbaaabbb')
returns 'aaa'.

Because Jeff is right, that's the way it works...
_________________
Patrick Goodhart
MQ Admin/Web Developer/Consultant
WebSphere Application Server Admin
Back to top
View user's profile Send private message
RocknRambo
PostPosted: Thu Sep 02, 2004 3:45 pm    Post subject: Reply with quote

Partisan

Joined: 24 Sep 2003
Posts: 355

yes ur correct...

I was able to achieve by

TRIM(LEADING newline FROM InputRoot tree....)


thanks for both of u

sanu
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 » CR in the Element value
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.