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 » General IBM MQ Support » encoding/copying of mqrfh2 header

Post new topic  Reply to topic
 encoding/copying of mqrfh2 header « View previous topic :: View next topic » 
Author Message
fde
PostPosted: Wed Apr 09, 2008 3:38 am    Post subject: encoding/copying of mqrfh2 header Reply with quote

Acolyte

Joined: 05 Jul 2007
Posts: 65

Hi folks,

environment:
WMB 6.1, MQ 6 on AIX 5.3

During my flow, I create a mqrfh2 header and insert name-value pairs in the usr folder of mqrfh2. Other fields of mqrfh2 are populated automatically, e.g. the mcd folder. Than the message is written to a queue using mq-output.
If I look at my message using RFHUtil I can see all fields of the mqrfh2header. If I save the message to a file with RFHUtil and open the file in an editor, I can see the rfh2folders too (<mcd>xyz</mcd>...).

Now in my AIX programm, which issues an mqget, I dont find any readable strings in the headersection. Only the message data is readable.

Message
-MessageBroker Propertiesheader
-MQMD (Codepage=850)
-MQRFH2(Format=MQSTR)
-MRM

I want to copy the mqrfh2 header into another message to invoke another flow which expects the mqrfh2 header.
To copy the header, IMO I need either tags, to identify the header, or a structure description of the mqrfh2 header.
Due to the dynamical content of mqrfh2 (different strings in mcd and usr folders), I should not be able to create such a structure description.

Do you have any suggestions regarding the format of mqrfh2 or how to copy mqrfh2?
_________________
Global warming is an unintentional side effect of SOA's hotness.
-- http://soafacts.com/
a business integration methodology
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Apr 09, 2008 3:44 am    Post subject: Re: encoding/copying of mqrfh2 header Reply with quote

Grand High Poobah

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

fde wrote:
Now in my AIX programm, which issues an mqget, I dont find any readable strings in the headersection. Only the message data is readable.


Worth underlining that the only "header" returned by an MQGET call is the MQMD; the RFH2 will be in the message buffer with the application data. If the data's truely unreadable (remembering that part of it is not text anyway!) check the RFH2's data CCSID is set correctly.

The variable part of the RFH2 (mcd, usr, etc) is always directly after the fixed portion of the header, which itself contains the length of the variable portion. You don't mention what you're running on AIX but if it's non-Java consider using XMS to handle the RFH2. Or JMS if it's Java.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fde
PostPosted: Wed Apr 09, 2008 5:19 am    Post subject: Re: encoding/copying of mqrfh2 header Reply with quote

Acolyte

Joined: 05 Jul 2007
Posts: 65

Vitor wrote:

Worth underlining that the only "header" returned by an MQGET call is the MQMD; the RFH2 will be in the message buffer with the application data. If the data's truely unreadable (remembering that part of it is not text anyway!) check the RFH2's data CCSID is set correctly.

Thanks for clarification. I found the dynamical part of rfh2 (usr, mcd folders) readable using tools like rfhutil. Being able to substring or indexof the readable part would be sufficient for my requirements.

I am not so familar with CCSID. Is there a "correct" value for CCSID for a specific system like iSeries?
Currently the CCSID field of mqrfh2 contains '1208' which i googled to "UTF-8 with IBM PUA". What would I use for a german iSeries system?

Vitor wrote:

The variable part of the RFH2 (mcd, usr, etc) is always directly after the fixed portion of the header, which itself contains the length of the variable portion. You don't mention what you're running on AIX but if it's non-Java consider using XMS to handle the RFH2. Or JMS if it's Java.


I missunderstanded something. The program is running on iSeries not AIX and is written in RPG.
The part of the program, which accesses the queue seems to use a native MQGET. One of the MQGET parameters contains the MQGMO_CONVERT mentionend in http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzak.doc/js00862.htm
_________________
Global warming is an unintentional side effect of SOA's hotness.
-- http://soafacts.com/
a business integration methodology
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Apr 09, 2008 5:58 am    Post subject: Re: encoding/copying of mqrfh2 header Reply with quote

Grand High Poobah

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

fde wrote:
I am not so familar with CCSID. Is there a "correct" value for CCSID for a specific system like iSeries?
Currently the CCSID field of mqrfh2 contains '1208' which i googled to "UTF-8 with IBM PUA". What would I use for a german iSeries system?


I know neither iSeries nor German.


_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Apr 09, 2008 6:01 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The CCSID of the MQRFH2 indicates the CCSID of the *next* section of the message, in this case your message body.

The NameValueCCSID of the MQRFH2 indicates the CCSID of the variable length section, which can only be in one of a few different codepages (1208 is one).

If your RPG program is not expecting the MQRFH2, then it's trying to read that as your message data. This is likely causing problems.

If your RPG program *is* expecting the MQRFH2, and doing the right things to process it, then the convert should be doing the "right" things with your data.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fde
PostPosted: Wed Apr 09, 2008 6:53 am    Post subject: Reply with quote

Acolyte

Joined: 05 Jul 2007
Posts: 65

I solved something. You guys are great!

I messed around in the debugsession, trying out different CCSID values.
CCSID 273 (http://www-306.ibm.com/software/globalization/ccsid/ccsid273.jsp)
ends up readable from the folder section on in the RGP program.

Now I am able to work with the rfh2header, especially searching for the end of the rfh2 header.

Minor issues remain, like why are there 2 blanks between mqrfh2 and the message data (Headers have always a length of a multiply of 4?).

Anyway, thanks for valuable input!
_________________
Global warming is an unintentional side effect of SOA's hotness.
-- http://soafacts.com/
a business integration methodology
Back to top
View user's profile Send private message
EddieA
PostPosted: Wed Apr 09, 2008 9:32 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

fde wrote:
Headers have always a length of a multiply of 4?

Yes.

But there is also a length field, in the RFH2, that tells you how long the complete header is, without having to "deduce" the end.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
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 » General IBM MQ Support » encoding/copying of mqrfh2 header
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.