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 » Case sensitive compare of strings ?

Post new topic  Reply to topic
 Case sensitive compare of strings ? « View previous topic :: View next topic » 
Author Message
ydeonia
PostPosted: Tue Aug 13, 2013 1:10 am    Post subject: Case sensitive compare of strings ? Reply with quote

Acolyte

Joined: 29 Oct 2012
Posts: 74

Hi

I want to compare strings as case sensitive like

POSITION ( 'RT' IN lDesc) <> '0'

even If lDesc = 'TERT' or lDesc = 'terT' , it passes the condition .

Please help me in this so that it allows only of it maches uppercase 'RT'

Thanks
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Aug 13, 2013 1:19 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Have you looked at the CONTAINS function.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
ydeonia
PostPosted: Tue Aug 13, 2013 1:24 am    Post subject: Reply with quote

Acolyte

Joined: 29 Oct 2012
Posts: 74

smdavies99 wrote:
Have you looked at the CONTAINS function.


I tried but its not working because of my WMB version so I have to with POSITION function instead

Any help in position one please
Back to top
View user's profile Send private message
dogorsy
PostPosted: Tue Aug 13, 2013 1:39 am    Post subject: Re: Case sensitive compare of strings ? Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

ydeonia wrote:
Hi

I want to compare strings as case sensitive like

POSITION ( 'RT' IN lDesc) <> '0'

even If lDesc = 'TERT' or lDesc = 'terT' , it passes the condition .

Please help me in this so that it allows only of it maches uppercase 'RT'

Thanks


if IDesc is 'TERT' then the function will return 3
for 'terT' should return 0

I doubt it is returning the wrong value. Please run a user trace and post the relevant bit to prove what you are saying.
Back to top
View user's profile Send private message
ydeonia
PostPosted: Tue Aug 13, 2013 1:43 am    Post subject: Reply with quote

Acolyte

Joined: 29 Oct 2012
Posts: 74

@dogorsy so does that mean it will consider the case sensitive values. If yes, no its not. Its still passes.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Aug 13, 2013 1:44 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

What version of broker are you using?
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
ydeonia
PostPosted: Tue Aug 13, 2013 1:48 am    Post subject: Reply with quote

Acolyte

Joined: 29 Oct 2012
Posts: 74

smdavies99 wrote:
What version of broker are you using?


Version 6.1.0.3

I read here that its BUG in the toolkit to accept the CONTAINS fuction
Back to top
View user's profile Send private message
dogorsy
PostPosted: Tue Aug 13, 2013 1:55 am    Post subject: Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

ydeonia wrote:
@dogorsy so does that mean it will consider the case sensitive values. If yes, no its not. Its still passes.

On what basis you assert that it is failing ? Please run a user trace.
Below are the results in my system. so it is very likely that your code is wrong.

Code:
Evaluating expression ''POSITION('RT' IN IDesc)'' at ('.test_Compute.Main', '5.17'). This resolved to ''POSITION('RT' IN 'TERT')''. The result was ''3''


Code:
Evaluating expression ''POSITION('RT' IN IDesc)'' at ('.test_Compute.Main', '7.17'). This resolved to ''POSITION('RT' IN 'terT')''. The result was ''0''


As I said in my previous post, run a user trace. If you don't know how to do that, look in the infocenter, it explains how to do that.
Back to top
View user's profile Send private message
ydeonia
PostPosted: Tue Aug 13, 2013 2:02 am    Post subject: Reply with quote

Acolyte

Joined: 29 Oct 2012
Posts: 74

dogorsy wrote:


As I said in my previous post, run a user trace. If you don't know how to do that, look in the infocenter, it explains how to do that.




Thanks for clarification
here is what I am using the code to validate the presence of string in the value

Code:
IF    Nature IN ('EA','EM') AND  POSITION  ( 'P720' IN lDesc) <> '0' AND POSITION ( 'RT' IN lDesc)<> '0' THEN   
     SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName ='WMB.9D1.ASUB_PRODUCT';    


And my lDesc value is
Code:
BR RM EU XTE2 320 B 3.51 PAO P720rT


And I got the message in the Queue.

IF lDesc is
Code:
BR RM EU XTE2 320 B 3.51 PAO P720

I dont get the message which is expected.

When lDesc is
Code:
BR RM EU XTE2 320 B 3.51 PAO P720 RT

I got the message.

So where I am doing wrong?
Back to top
View user's profile Send private message
dogorsy
PostPosted: Tue Aug 13, 2013 2:08 am    Post subject: Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

ydeonia wrote:
dogorsy wrote:


As I said in my previous post, run a user trace. If you don't know how to do that, look in the infocenter, it explains how to do that.




Thanks for clarification
here is what I am using the code to validate the presence of string in the value

Code:
IF    Nature IN ('EA','EM') AND  POSITION  ( 'P720' IN lDesc) <> '0' AND POSITION ( 'RT' IN lDesc)<> '0' THEN   
     SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName ='WMB.9D1.ASUB_PRODUCT';    


And my lDesc value is
Code:
BR RM EU XTE2 320 B 3.51 PAO P720rT


And I got the message in the Queue.

IF lDesc is
Code:
BR RM EU XTE2 320 B 3.51 PAO P720

I dont get the message which is expected.

When lDesc is
Code:
BR RM EU XTE2 320 B 3.51 PAO P720 RT

I got the message.

So where I am doing wrong?


RUN A USER TRACE ... what part of that you don't understand ?!

As far as I can see, there is nothing wrong with POSITION or with ESQL. You have a problem with the LOGIC, and there is nothing people in this forum can do about it. It is up to you to work the logic needed for your business.
Back to top
View user's profile Send private message
NealM
PostPosted: Thu Aug 15, 2013 12:45 pm    Post subject: Reply with quote

Master

Joined: 22 Feb 2011
Posts: 230
Location: NC or Utah (depends)

Remove the quotes around both of your 0's. POSITION returns an integer, not a char.
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 » Case sensitive compare of strings ?
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.