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 » RFH2 header

Post new topic  Reply to topic
 RFH2 header « View previous topic :: View next topic » 
Author Message
wgiessen
PostPosted: Sat Jan 15, 2011 6:37 am    Post subject: RFH2 header Reply with quote

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
View user's profile Send private message
mvic
PostPosted: Sat Jan 15, 2011 6:42 am    Post subject: Re: RFH2 header Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

Writing your own code in C for this is not much fun.

What type of app is reading this message? JMS, XMS?

It might be better to try to use the message properties APIs introduced in MQ v7.

Start here: http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzal.doc/fg20530_.htm
Back to top
View user's profile Send private message
mqjeff
PostPosted: Sat Jan 15, 2011 8:10 am    Post subject: Reply with quote

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
View user's profile Send private message
mvic
PostPosted: Sat Jan 15, 2011 9:51 am    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Sat Jan 15, 2011 9:59 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Sat Jan 15, 2011 10:59 pm    Post subject: Re: RFH2 header Reply with quote

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
View user's profile Send private message Send e-mail
wgiessen
PostPosted: Sun Jan 16, 2011 6:31 am    Post subject: Reply with quote

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
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 » IBM MQ API Support » RFH2 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.