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 » Checking whether CorrelId is set to all Zeros

Post new topic  Reply to topic
 Checking whether CorrelId is set to all Zeros « View previous topic :: View next topic » 
Author Message
manoj5007
PostPosted: Wed Oct 16, 2013 6:26 am    Post subject: Checking whether CorrelId is set to all Zeros Reply with quote

Acolyte

Joined: 15 May 2013
Posts: 64

Hi. My requirement is to check whether the correlId is set to all zeros. Based on a valid correlId, the message is to be propogated to one terminal and if its all zeros than the message has to be propogated to another node. Could you please help me with the above scenario.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Oct 16, 2013 6:27 am    Post subject: Re: Checking whether CorrelId is set to all Zeros Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

manoj5007 wrote:
My requirement is to check whether the correlId is set to all zeros.


My first thought is to use an IF statement. I imagine that was your first thought as well, so perhaps you could expand a little on where you need help....?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
zpat
PostPosted: Wed Oct 16, 2013 7:06 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Filter node
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Oct 16, 2013 7:19 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

zpat wrote:
Filter node


Which has an IF in it.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Oct 16, 2013 8:14 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

What's the confusion?

You want to determine if the correlID is all zeros, and then take an action based on the result of that.

The way you do that is to write your flow.

There are lots of different ways to do this in WMB.

All of them require that you actually take steps to develop the flow.

So go, take steps, and develop the flow.

Using your knowledge and experience and training and the documentation.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Oct 16, 2013 11:02 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

And check out the meaning and value of the MQCI_XXXX constants. Here XXXX stands for some value...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
manoj5007
PostPosted: Wed Oct 16, 2013 10:08 pm    Post subject: Reply with quote

Acolyte

Joined: 15 May 2013
Posts: 64

I can't use a IF statement for BLOB i.e.

IF InputRoot.MQMD.CorrelId = 00000000000000000000000000000

THEN PROPAGATE TO TERMINAL out

ELSE

PROPAGATE TO TERMINAL out1

The above statement will result in error.

I am not sure how to check the value of BLOB type and the MQCI constant for correlid with all zeors is MQCI_NONE.
Back to top
View user's profile Send private message
Simbu
PostPosted: Wed Oct 16, 2013 10:43 pm    Post subject: Reply with quote

Master

Joined: 17 Jun 2011
Posts: 289
Location: Tamil Nadu, India

manoj5007 wrote:
I can't use a IF statement for BLOB i.e.

IF InputRoot.MQMD.CorrelId = 00000000000000000000000000000

THEN PROPAGATE TO TERMINAL out

ELSE

PROPAGATE TO TERMINAL out1

The above statement will result in error.

I am not sure how to check the value of BLOB type and the MQCI constant for correlid with all zeors is MQCI_NONE.


Quote:
The BLOB data type holds a variable length string of 8-bit bytes. It is commonly used to represent arbitrary binary data. A BLOB literal consists of the letter X, followed by a string of hexadecimal digits enclosed in single quotation marks, as in the following example:

X'0123456789ABCDEF'

There must be an even number of digits in the string, because two digits are required to define each byte. Each digit can be one of the hexadecimal digits 0-9 and A-F. Both the initial X and the hexadecimal letters can be specified in uppercase or lowercase.
Back to top
View user's profile Send private message
dogorsy
PostPosted: Wed Oct 16, 2013 11:13 pm    Post subject: Reply with quote

Knight

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

manoj5007 wrote:
I can't use a IF statement for BLOB i.e.

IF InputRoot.MQMD.CorrelId = 00000000000000000000000000000

THEN PROPAGATE TO TERMINAL out

ELSE

PROPAGATE TO TERMINAL out1

The above statement will result in error.

I am not sure how to check the value of BLOB type and the MQCI constant for correlid with all zeors is MQCI_NONE.

Yes, that will give an error. Have you read the error message ?, even more, not only read it, try to understand what the message is telling you. Then you can see how to fix your code.

Of course, you need to understand the ESQL data types, so it would be a good idea if you start with that
Back to top
View user's profile Send private message
manoj5007
PostPosted: Mon Oct 21, 2013 4:46 am    Post subject: Reply with quote

Acolyte

Joined: 15 May 2013
Posts: 64

Resolved it by declaring a BLOB variable as shown below:

DECLARE temp BLOB ;
SET temp='00000000000000000000' with even number of digits equal to the number of zeros we will be getting when correl Id is set to MQCI_NONE. Then I compare the CorrelId with temp variable.

This does sound little dirty but then I couldn't find a better way.

Its works only with the quotes. Could anyone explain why so??
Back to top
View user's profile Send private message
mgk
PostPosted: Mon Oct 21, 2013 5:02 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

So did you try just using the constant like this:

Code:
IF InputRoot.MQMD.CorrelId = MQCI_NONE THEN
...
END IF;


Kind regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
dogorsy
PostPosted: Mon Oct 21, 2013 5:53 am    Post subject: Reply with quote

Knight

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

manoj5007 wrote:
Its works only with the quotes. Could anyone explain why so??

As I said before, you need to learn about ESQL data types. Then you will know why you need to enclose it in quotes.
Back to top
View user's profile Send private message
reddy2078
PostPosted: Mon Oct 21, 2013 6:01 am    Post subject: Reply with quote

Newbie

Joined: 21 Apr 2013
Posts: 7

manoj5007 wrote:
Resolved it by declaring a BLOB variable as shown below:

DECLARE temp BLOB ;
SET temp='00000000000000000000' with even number of digits equal to the number of zeros we will be getting when correl Id is set to MQCI_NONE. Then I compare the CorrelId with temp variable.

This does sound little dirty but then I couldn't find a better way.

Its works only with the quotes. Could anyone explain why so??



Manoj why dont u try this



Code:
  DECLARE CORREL_ID CHARACTER CAST (InputRoot.MQMD.CorrelId AS CHAR);


Output of Debug:
CORREL_ID:CHARACTER:X'000000000000000000000000000000000000000000000000'

Code:
DECLARE  N1 INTEGER LENGTH(CORREL_ID);

Output of Debug:
N1:INTEGER:51


Code:
DECLARE CORREL_ID_FINL CHARACTER SUBSTRING ( CORREL_ID FROM 3 FOR N1-3) ;



Output of Debug:
CORREL_ID_FINL:CHARACTER:000000000000000000000000000000000000000000000000
Back to top
View user's profile Send private message Send e-mail
gbaddeley
PostPosted: Mon Oct 21, 2013 2:50 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

FWIW, MQCI_NONE is 24 null characters, not 24 numeric 0 characters.
_________________
Glenn
Back to top
View user's profile Send private message
manoj5007
PostPosted: Tue Oct 22, 2013 1:09 am    Post subject: Reply with quote

Acolyte

Joined: 15 May 2013
Posts: 64

@mgk

Thanks a lot mgk. It worked. When I had tried it before, I tried with quotes , my bad i.e. IF InputRoot.MQMD.CorrelId = 'MQCI_NONE' THEN
END IF. .

IF InputRoot.MQMD.CorrelId = MQCI_NONE THEN
ENDIF is working perfectly fine.

Thank you all for the tips.
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 » Checking whether CorrelId is set to all Zeros
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.