Author |
Message
|
wgiessen |
Posted: Sat Jan 15, 2011 6:37 am Post subject: RFH2 header |
|
|
Newbie
Joined: 09 Dec 2002 Posts: 5
|
We have a program written in the C language where we can write the filename into the RFH2 header using the <usr> folder. This functionality works fine from windows to windows or from unix to windows when we enable conversion on the channel.
Right now I can not use the conversion on the channel and the processing of the header is failing. The program is not able to determine the structurelength in this situation. Tried various things like changing CCSID on sending msg but nothing seems to work. Using the default values from MQRFH2_DEFAULT with updated StrucLength and Format set as MQFMT_STRING
Can someone maybe explain what I might be doing wrong or overlooking in this situation. |
|
Back to top |
|
 |
mvic |
Posted: Sat Jan 15, 2011 6:42 am Post subject: Re: RFH2 header |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
|
Back to top |
|
 |
mqjeff |
Posted: Sat Jan 15, 2011 8:10 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There are only certain specific CCSIDs that an MQRFH2 is allowed to be in. The best thing to do in all cases is put it in 1200 or 1208. Then you don't have to convert it, and you know that both sides will be able to process it and you know you'll be able to send any legal Unicode Character.
The MQMD CCSID must indicate the CCSID of the MQRFH2, which will allow you to determine how to cast the data so it makes sense. Likewise the CCSID on the MQRFH2 must indicate the CCSID of the next piece of the message.
Message Properties is a simpler programming task and the better approach moving forward. However, there's no good way that I know of to indicate what CCSID they are in - without setting a second property... ? I'm sure that's just because I haven't properly read the linked page mvic has kindly posted. |
|
Back to top |
|
 |
mvic |
Posted: Sat Jan 15, 2011 9:51 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
mqjeff wrote: |
However, there's no good way that I know of to indicate what CCSID they are in |
I haven't done this myself for real, but just reading the manual pages for MQSETMP it looks like the property name is in an MQCHARV (contains a ccsid) and the property value is qualified by the MQSMPO structure (contains encoding/ccsid fields) that you pass to MQSETMP. |
|
Back to top |
|
 |
mqjeff |
Posted: Sat Jan 15, 2011 9:59 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
mvic wrote: |
mqjeff wrote: |
However, there's no good way that I know of to indicate what CCSID they are in |
I haven't done this myself for real, but just reading the manual pages for MQSETMP it looks like the property name is in an MQCHARV (contains a ccsid) and the property value is qualified by the MQSMPO structure (contains encoding/ccsid fields) that you pass to MQSETMP. |
As I said, I've not read the documentation. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jan 15, 2011 10:59 pm Post subject: Re: RFH2 header |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
wgiessen wrote: |
This functionality works fine from windows to windows or from unix to windows when we enable conversion on the channel.
Right now I can not use the conversion on the channel and the processing of the header is failing. The program is not able to determine the structurelength in this situation. Tried various things like changing CCSID on sending msg but nothing seems to work. Using the default values from MQRFH2_DEFAULT with updated StrucLength and Format set as MQFMT_STRING
Can someone maybe explain what I might be doing wrong or overlooking in this situation. |
I suspect your problem does not originate from the lack of conversion as a CCSID problem but from conversion looking at endianness...
You have to analyze the length returned by your program. It could well be that you are looking at a little endian number whereas you program treats it as a big endian number, or the other way round. Endianness is given in the MQMD Encoding field. There is also such a field on the RFH2 header.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
wgiessen |
Posted: Sun Jan 16, 2011 6:31 am Post subject: |
|
|
Newbie
Joined: 09 Dec 2002 Posts: 5
|
Things like this keeps mulling in my head yesterday evening I had come up with the endian issue as well and it turns out to be the case. Right now I have solved the issue in a dirty way by doing byte swaps on struclength and namevaluelength because this interface needs to be tested tomorrow. Need to look closer into encoding etc and the handling of RFH2 headers and behaviour of MQ in general to come up with something more generic that will work both ways.
Thanks very much for the responses |
|
Back to top |
|
 |
|