Discussion:
Using your own message-id on a get with correlation-id.
John J. Leonard
2014-03-18 15:00:04 UTC
Permalink
We have an application which generates its own 24 byte all character
message-id. Example ‘123456789012345678901234’ . Before the put the
application moves the character message-id to MQMD-MSGID defined in the
MQMD copybook. Than it does the put. Next the application takes the
character message-id and places it in the body of a second message. Then it
puts the second message on a queue.
The second message is picked up by a distributed application. The distributed
application takes the message-id ‘123456789012345678901234’ from the body
of the message and uses it as the correlation id to do a get by correlation-id
to read the first message. That get by correlation-id fails no-message
available.
The only way we can make that get by correlation-id work is preface each
number with F? End up with this
X’F1F2F3F4F5F6F7F8F9F0F1F2F3F4F5F6F7F8F9F0F1F2F3F4’.
Yes I am aware F1 is EBCIDIC for ‘1’ etc…but I don’t understand why the
distributed application can’t just use the character message-id as is.
<br><hr><center><font size=-1>
<a href="http://listserv.meduniwien.ac.at/archives/mqser-l.html">List Archive</a> -
<a href="http://listserv.meduniwien.ac.at/cgi-bin/wa?SUBED1=mqser-l&A=1">Manage Your List Settings</a> -
<a href="mailto:LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org?subject=Unsubscribe&BODY=signoff%20mqseries">Unsubscribe</a>
</font><font size=-1><p>
Instructions for managing your mailing list subscription are provided in the Listserv General Users Guide available at <a href="http://www.lsoft.com/resources/manuals.asp">http://www.lsoft.com</a>
</p></font>
</center>
Roger Lacroix
2014-03-18 15:34:18 UTC
Permalink
Hi,

This falls into the 'why are you doing that' category.

(1) Why are you generating your own character
string and using it as a message id?

(2) Where does message # 1 fit into the picture
(where you set the MsgID equal to your own character string)?

(3) If you put a character string in the message
body of message # 2 then when the distributed
application does a MQGET with convert, of course,
your character string will get converted too
(because it is in the message body). The
application did exactly what you wanted of them
(saved your character string from the message
body and put it in the reply message's CorrelId).

Why don't you do it the normal way?

- The mainframe application lets the queue
manager generate the MsgId and the mainframe
applications saves it after the MQPut
- The distributed application gets the message,
saves the MsgId and on the reply message, puts
the MsgId in the CorrelId field of the reply message
- The mainframe application performs a MQGet by
CorrelId (using the saved MsgId) and receives the reply message.

This is so much simpler and your character string
will not get converted (from EBCDIC to ASCII)
when the distributed application does a MQGet with convert.

Regards,
Roger Lacroix
Capitalware Inc.

At 11:00 AM 3/18/2014, you wrote:
>We have an application which generates its own
>24 byte all character message-id. Example
>‘123456789012345678901234’ . Before the put the
>application moves the character message-id to
>MQMD-MSGID defined in the MQMD copybook. Than it
>does the put. Next the application takes the
>character message-id and places it in the body
>of a second message. Then it puts the second
>message on a queue. The second message is picked
>up by a distributed application. The distributed
>application takes the message-id
>‘123456789012345678901234’ from the body of the
>message and uses it as the correlation id to do
>a get by correlation-id to read the first
>message. That get by correlation-id fails
>no-message available. The only way we can make
>that get by correlation-id work is preface each
>number with F? End up with this
>X’F1F2F3F4F5F6F7F8F9F0F1F2F3F4F5F6F7F8F9F0F1F2F3F4’.
>Yes I am aware F1 is EBCIDIC for ‘1’ etc…but I
>don’t understand why the distributed application
>can’t just use the character message-id as is.
>
>----------
><http://listserv.meduniwien.ac.at/archives/mqser-l.html>List
>Archive -
><http://listserv.meduniwien.ac.at/cgi-bin/wa?SUBED1=mqser-l&A=1>Manage
>Your List Settings -
><mailto:LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org?subject=Unsubscribe&BODY=signoff%20mqseries>Unsubscribe
>
>
>Instructions for managing your mailing list
>subscription are provided in the Listserv
>General Users Guide available at
><http://www.lsoft.com/resources/manuals.asp>http://www.lsoft.com

To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and,
in the message body (not the subject), write: SIGNOFF MQSERIES
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html
Tim Zielke
2014-03-18 15:38:46 UTC
Permalink
Hi John,

I believe what you are describing is explained by this blurb in the MQ manual for CORELID (same applies for MSGID) -> http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/topic/com.ibm.mq.ref.dev.doc/q097470_.htm?resultof=%22%4d%51%50%4d%4f%5f%4e%45%57%5f%43%4f%52%52%45%4c%5f%49%44%22%20

"Because the correlation identifier is a byte string and not a character string, the correlation identifier is not converted between character sets when the message flows from one queue manager to another."

If your original putting application was a mainframe application using an EBCDIC code page to PUT '123456789012345678901234' to the MQMD-MSGID (and you are also setting the MQMD-CORRELID to the value, too?), that would be put in hex as 'F1F2F3...'. Since the CORELID (or MSGID) is not converted when the distributed application does a GET, the CORELID field in the message descriptor for the distributed application would appear as x'F1F2F3...'.

Thanks,
Tim Zielke
CICS/MQ Systems Programmer
Aon

From: MQSeries List [mailto:MQSERIES-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org] On Behalf Of John J. Leonard
Sent: Tuesday, March 18, 2014 10:00 AM
To: MQSERIES-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org
Subject: Using your own message-id on a get with correlation-id.

We have an application which generates its own 24 byte all character message-id. Example '123456789012345678901234' . Before the put the application moves the character message-id to MQMD-MSGID defined in the MQMD copybook. Than it does the put. Next the application takes the character message-id and places it in the body of a second message. Then it puts the second message on a queue. The second message is picked up by a distributed application. The distributed application takes the message-id '123456789012345678901234' from the body of the message and uses it as the correlation id to do a get by correlation-id to read the first message. That get by correlation-id fails no-message available. The only way we can make that get by correlation-id work is preface each number with F? End up with this X'F1F2F3F4F5F6F7F8F9F0F1F2F3F4F5F6F7F8F9F0F1F2F3F4'. Yes I am aware F1 is EBCIDIC for '1' etc...but I don't understand why the distributed application can't just use the character message-id as is.
________________________________
List Archive<http://listserv.meduniwien.ac.at/archives/mqser-l.html> - Manage Your List Settings<http://listserv.meduniwien.ac.at/cgi-bin/wa?SUBED1=mqser-l&A=1> - Unsubscribe<mailto:LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org?subject=Unsubscribe&BODY=signoff%20mqseries>

Instructions for managing your mailing list subscription are provided in the Listserv General Users Guide available at http://www.lsoft.com<http://www.lsoft.com/resources/manuals.asp>

To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and,
in the message body (not the subject), write: SIGNOFF MQSERIES
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html
Ard van der Leeuw
2014-03-18 15:09:17 UTC
Permalink
John,

the message-id is a BYTE field, and therefor not considered as
character-data, even if you think you put characterdata in.

This would probably work, if you performed the 'read' action on an EBCDIC
oriented host as well, but since you're reading on a distributed platform,
chances are that this is using an ASCII based encodig. So the application
reads the character string from the message body, converting it to bytes as
ASCII representation, causing the mismatch you're seeing.

A workaround for this? Don't consider the message-id a text-string, so when
you're putting it in the message-body, do NOT specify MQSTR as message
format, so that it will not be converted. Then you can use the contents of
the message as bytes and making the match with the message-id should be
possible.

Regards,

Ard


2014-03-18 16:00 GMT+01:00 John J. Leonard <johnleonard-***@public.gmane.org>:

> We have an application which generates its own 24 byte all character
> message-id. Example ‘123456789012345678901234’ . Before the put the
> application moves the character message-id to MQMD-MSGID defined in the
> MQMD copybook. Than it does the put. Next the application takes the
> character message-id and places it in the body of a second message. Then it
> puts the second message on a queue. The second message is picked up by a
> distributed application. The distributed application takes the message-id
> ‘123456789012345678901234’ from the body of the message and uses it as the
> correlation id to do a get by correlation-id to read the first message.
> That get by correlation-id fails no-message available. The only way we can
> make that get by correlation-id work is preface each number with F? End up
> with this X’F1F2F3F4F5F6F7F8F9F0F1F2F3F4F5F6F7F8F9F0F1F2F3F4’. Yes I am
> aware F1 is EBCIDIC for ‘1’ etc
but I don’t understand why the distributed
> application can’t just use the character message-id as is.
> ------------------------------
> List Archive <http://listserv.meduniwien.ac.at/archives/mqser-l.html> - Manage
> Your List Settings<http://listserv.meduniwien.ac.at/cgi-bin/wa?SUBED1=mqser-l&A=1>-
> Unsubscribe<LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org?subject=Unsubscribe&BODY=signoff%20mqseries>
>
> Instructions for managing your mailing list subscription are provided in
> the Listserv General Users Guide available at http://www.lsoft.com<http://www.lsoft.com/resources/manuals.asp>
>

To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and,
in the message body (not the subject), write: SIGNOFF MQSERIES
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html
Thomas Dunlap
2014-03-18 16:12:53 UTC
Permalink
John,

The MQMD-MSGID and MQMD-CORRELID and both defined as MQBYTE24. Fields
defined as MQBYTE do not participate in normal data conversion. The
distributed application would have to process the MQMD-CORRELID as the
EBCDIC data equivalent and not the ASCII form.


On 3/18/2014 11:00 AM, John J. Leonard wrote:
> We have an application which generates its own 24 byte all character
> message-id. Example ‘123456789012345678901234’ . Before the put the
> application moves the character message-id to MQMD-MSGID defined in
> the MQMD copybook. Than it does the put. Next the application takes
> the character message-id and places it in the body of a second
> message. Then it puts the second message on a queue. The second
> message is picked up by a distributed application. The distributed
> application takes the message-id ‘123456789012345678901234’ from the
> body of the message and uses it as the correlation id to do a get by
> correlation-id to read the first message. That get by correlation-id
> fails no-message available. The only way we can make that get by
> correlation-id work is preface each number with F? End up with this
> X’F1F2F3F4F5F6F7F8F9F0F1F2F3F4F5F6F7F8F9F0F1F2F3F4’. Yes I am aware F1
> is EBCIDIC for ‘1’ etc…but I don’t understand why the distributed
> application can’t just use the character message-id as is.
> ------------------------------------------------------------------------
> List Archive <http://listserv.meduniwien.ac.at/archives/mqser-l.html>
> - Manage Your List Settings
> <http://listserv.meduniwien.ac.at/cgi-bin/wa?SUBED1=mqser-l&A=1> -
> Unsubscribe
> <mailto:LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org?subject=Unsubscribe&BODY=signoff%20mqseries>
>
>
> Instructions for managing your mailing list subscription are provided
> in the Listserv General Users Guide available at http://www.lsoft.com
> <http://www.lsoft.com/resources/manuals.asp>
>


--
_______________________________________________________________
Regards,
Thomas Dunlap Chief Technology Officer tomd-lQL1WHg3ccB8UrSeD/***@public.gmane.org
Themis, Inc. http://www.themisinc.com 1 (800) 756-3000


To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and,
in the message body (not the subject), write: SIGNOFF MQSERIES
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html
Loading...