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 » IBM MQ API Support » 2033 error while trying to get message matching MsgId

Post new topic  Reply to topic
 2033 error while trying to get message matching MsgId « View previous topic :: View next topic » 
Author Message
MQThink
PostPosted: Tue Dec 16, 2008 11:54 pm    Post subject: 2033 error while trying to get message matching MsgId Reply with quote

Newbie

Joined: 06 Feb 2008
Posts: 9

Hi,

I have been experiencing problem in getting a message on z/OS matching the MsgId sent from Solaris side.

I have specified match options as below:
Code:
GetMsgOpts.MatchOptions = MQMO_MATCH_MSG_ID + MQMO_MATCH_CORREL_ID;


The same mechanism works fine with Unix and VMS Platforms. Where as in z/OS it fails to fetch the message matching the msgID.
Am passing the message ID from a Java application in Unix and receiving through a C program on z/OS. Is this related to any ASCII to EBCDIC code conversion problem?

Please send you suggestions / advice on this.

Thanks.
Back to top
View user's profile Send private message
zpat
PostPosted: Wed Dec 17, 2008 12:27 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

These ids are not subject to codepage conversion.

You have asked to match both the msgid and the correlid, which means both of them must match the values in your MQMD.

Is that what you wanted? Check out your correlid value in the program MQMD versus the message MQMD or remove that match option.
Back to top
View user's profile Send private message
MQThink
PostPosted: Wed Dec 17, 2008 4:12 am    Post subject: Reply with quote

Newbie

Joined: 06 Feb 2008
Posts: 9

Thanks for your suggestion.

I have removed the Correlation ID matching part. But still i got 2033. When i tried to print the copied Message ID (local) in Hex. The copied Message ID(local) displays different one from that of Message ID in message descriptor.

Find below the code:
Code:
    unsigned char CorrelId[MQ_CORREL_ID_LENGTH];

//TERN_LENGTH = 19
for (i = 0;i < TERN_LENGTH; i++)
    CorrelId[i] = pMsgDesc->CorrelId[i];

printf("CorrelID (In/Cpy):");
for (i = 0; i < MQ_CORREL_ID_LENGTH; i++)
    printf("%02X",&CorrelId[i]);

printf("'X\n");

i = TERN_LENGTH;

printf ("Ptoken len:%d\n", strlen(pToken));
while (pToken[j] != '\0')
{
    printf ("pToken[%d]:%c\n", j,pToken[j]);
    CorrelId[i] = (unsigned char) pToken[j];
    i++;
    j++;
}
printf("CorrelID (Cpy/WPtok):");
for (i = 0; i < MQ_CORREL_ID_LENGTH; i++)
    printf("%02X",&CorrelId[i]);

printf("'X\n");

IdLen = TERN_LENGTH + strlen(pToken); //19 + 4 = 23

for (i=0;i < IdLen ; i++)
{
    MsgDesc.MsgId[i] = CorrelId[i];
    MsgDesc.CorrelId[i] = CorrelId[i]
}
printf("MsgID (Cpy/ToMsg):");
for (i = 0; i < MQ_CORREL_ID_LENGTH; i++)
    printf("%02X",&MsgDesc.MsgId[i]);

printf("'X\n");

printf("CorrelID (Cpy/ToMsg):");
for (i = 0; i < MQ_CORREL_ID_LENGTH; i++)
    printf("%02X",&MsgDesc.CorrelId[i]);

printf("'X\n");


In the above case my both am having a local unsigned char array "CorrelID" to which am copying the 'CorrelID' from descriptor to a certain length (TERN_LENGTH). Then I concat "2.03" (pToken ) string to it and then copy to the MsgID and CorrelID of Descriptor.

Now i have given only
Code:
GetMsgOpts.MatchOptions = MQMO_MATCH_MSG_ID


But the resultant MsgId is not getting copied correctly. I tried with memcpy and strncpy , but no luck. So i tried to move byte by byte, even this is failing.

Please let me know how should i do my copy. This is where am clueless. strncpy worked fine in Solaris and VMS am changing code especially for Mainframe.

Sorry for this big email, but i have no other choice right now.


Thanks.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Dec 17, 2008 4:24 am    Post subject: Reply with quote

Grand High Poobah

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

MQThink wrote:
Then I concat "2.03" (pToken ) string to it and then copy to the MsgID and CorrelID of Descriptor.


That's not going to work. The string "2.03" is 2 different hex values on Unix & mainframe. Hence the CorrelId won't match up.

This is exactly why there are so many warnings about treating ids as strings.

MQThink wrote:
strncpy worked fine in Solaris and VMS am changing code especially for Mainframe.


It probably would, because they share a code page.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
MQThink
PostPosted: Wed Dec 17, 2008 4:53 am    Post subject: Reply with quote

Newbie

Joined: 06 Feb 2008
Posts: 9

Quote:
It probably would, because they share a code page.


In the previous email it stated that Correlation ID and Message ID doesn't get affected by Code page Conversion.

In that case, i should be able to get the message correctly. Am very much doubtful about the way i copy the fields. Is there any other way to copy the fields in a proper manner.

Thanks.[/quote]
Back to top
View user's profile Send private message
zpat
PostPosted: Wed Dec 17, 2008 5:01 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

What I meant was that MQGMO_CONVERT does not convert the ids during conversion to/from EBCDIC/ASCII.

Obviously if you mess around with them in your code they are affected!
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Dec 17, 2008 5:20 am    Post subject: Reply with quote

Grand High Poobah

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

MQThink wrote:
In the previous email it stated that Correlation ID and Message ID doesn't get affected by Code page Conversion.


This is true they don't. But if you're building them from strings then those strings will be in the local code page. So if the Unix app adds a token "2.03", and the mainframe adds a token "2.03", the same token will not be added on the 2 platforms.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Dec 17, 2008 5:51 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9470
Location: US: west coast, almost. Otherwise, enroute.

MsgId and CorelId fields are 24 bytes (not 24 characters), a 24 byte long bitstring. MQBYTE fields are not converted based on CCSID.

The usual use of msgid and correlid is in the request-reply model.

Program A (on any platform) asks its qmgr to create a unique msgid, then sends a request message to program B (on any platform). Program A then waits for the reply message from program B.

Program B gets the request message, copies the inbound msgid field to the correlid field of the outbound reply message, then puts it to the reply-to-queue.

Program A compares the outbound msgid to the inbound correlid. If they match, it is a reply to A's request.

Are you using msgid and correlid fields for this type of application?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
MQThink
PostPosted: Wed Jan 07, 2009 2:30 am    Post subject: Reply with quote

Newbie

Joined: 06 Feb 2008
Posts: 9

I find the problem is with adding string "2.03" to the message ID field on z/OS platform. When tested between ascii systems they worked fine but when it comes to ASCII to EBCDIC machines they are not.

But we designed our application in this way, so as a fix is it okay if we append the ASCII equivalent for EBCDIC "2.03" in z/OS so that it will match with incoming message ID from ASCII system.

please advise

Thanks.
Back to top
View user's profile Send private message
zpat
PostPosted: Wed Jan 07, 2009 2:35 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

I have to say this looks like a bad design.

Whatever you do, make sure it will work on all platforms.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jan 07, 2009 2:50 am    Post subject: Reply with quote

Grand High Poobah

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

MQThink wrote:
I find the problem is with adding string "2.03" to the message ID field on z/OS platform. When tested between ascii systems they worked fine but when it comes to ASCII to EBCDIC machines they are not.


As I indicated further up this thread.

MQThink wrote:
But we designed our application in this way, so as a fix is it okay if we append the ASCII equivalent for EBCDIC "2.03" in z/OS so that it will match with incoming message ID from ASCII system.


It might work short term, but it's a bad design even between ASCII machines. What requirement are you meeting by messing with the ids like this? Various people in this thread (and elsewhere in the forum) have posted on the woes of setting (or in your case partially setting) the message id.

User data, like this token, should be in user fields.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jan 07, 2009 3:34 am    Post subject: Reply with quote

Grand High Poobah

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

Worse then anything else you are still thinking in terms of char ....
What you have is a byte[24]
Each byte can have any value from x00 to xFF.
x00 is typically a string terminator in C maybe also C++.
Here it will not give you ANY clue as to the value of the following bytes.

Part of the 10 commandements of MQ are
  • Thou shalt not mess with the MessageId
  • Thou shalt let the QMGR assign the messageId
  • Thou shalt learn the anonymous identifier pattern... (as you don't care the value of the identifier as long as it is provided to you i.e. messageId to correlationId)


Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » 2033 error while trying to get message matching MsgId
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.