View previous topic :: View next topic
|
Author |
Message |
Gurumanoj Gurusamy
New User
Joined: 11 Nov 2010 Posts: 22 Location: Mumbai
|
|
|
|
Hi,
I am writing a cobol program to get the messages from MQ and extract specific details from the message using INSPECTclause.
I have used below logic to convert RFH2 message to String format but its not working. Could you please suggest the correct encoding and CodedCharSetId.
MOVE MQMD-VERSION-1 TO MQMD-VERSION.
MOVE MQMI-NONE TO MQMD-MSGID.
MOVE MQCI-NONE TO MQMD-CORRELID.
MOVE 785 TO MQMD-ENCODING.
MOVE 285 TO MQMD-CODEDCHARSETID.
MOVE 4 TO MQMD-PRIORITY.
MOVE MQFMT-STRING TO MQMD-FORMAT.
MOVE MQPER-PERSISTENT TO MQMD-PERSISTENCE.
The data in MQ is in below format:
Message Descriptor
StrucId : 'MD '
Version : 000000001
Report : 000000000
MsgType : 000000008
Expiry : -00000001
Feedback : 000000000
Encoding : 000000273
CodedCharSetId : 000000500
Format : 'MQHRF2 '
Priority : 000000004
Persistence : 000000001
MsgId : 'C3E2D840D4D8E3F24040404040404040C8DB86F1D683C008'X
CorrelId : '757569643A38616661373630302D326336332D313165312D'X
BackoutCount : 000000004
ReplyToQ : ' '
ReplyToQMgr : 'MQT2 '
UserIdentifier : 'STCEDAFD '
AccountingToken :
'0000000000000000000000000000000000000000000000000000000000000000'X
ApplIdentityData :
Many Thanks |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I have no idea what is wrong. You haven't mentioned what it is that is not working, and haven't shown any data definitions. If you want some assistance we need more information, please. |
|
Back to top |
|
|
Gurumanoj Gurusamy
New User
Joined: 11 Nov 2010 Posts: 22 Location: Mumbai
|
|
|
|
The RFH format is not getting converted into string because of which INSPECT clause is not working.
Here is the sysout from spool where i have displayed the message get from MQ:
WS-MSGBUFFER:RFH ü ½ ½ _ÄÀ (ËÀ ¦_ˬÂ`ÈÁË (ËÀ
èá+è¬(åê êáë& àËÈ è_Ë è_Ë äÑÀ ÍÍÑÀ /Ã/ Ä Á / /à /
ÁÊËÑ?> Á>Ä?ÀÑ>Å íèã Ë?/øÁ>Î á>ÎÁ%?øÁ Ì_%>Ë Ë?/øÁ>Î ÇÈÈø ËÄÇÁ_/Ë Ì
Èø ÏÏÏ Ï ?ÊÅ ì(<ëÄÇÁ_/ Ì_%>Ë ÌËÑ ÇÈÈø ÏÏÏ Ï ?ÊÅ ì(<ëÄÇÁ_/ Ñ>ËÈ
Ê ÇÈÈø ËÄÇÁ_/Ë Ì_%Ë?/ø ?ÊÅ Ë?/ø /ÄÈ?Ê >ÁÌÈ Ë?/øÁ>Î |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I'm not sure what you mean by "converted into [a] string", or where INSPECT comes into it.
You DISPLAY is simply showing a lump of binary data, with the code-page that you are using. If you use something with the correct code-page, then you will be able to "see" the characters, but there is no problem with the data just being like that until you need to see it.
So, where do you need to see it? DISPLAY is not normally used for "real" output, stuff that users will see. So what is the user going to see? |
|
Back to top |
|
|
Gurumanoj Gurusamy
New User
Joined: 11 Nov 2010 Posts: 22 Location: Mumbai
|
|
|
|
actually i want to convert this RFH format data received from MQ into string format so that it is readable by us. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Doesn't the documentation from IBM tell you how to do this?
If you just want to see the byte values for checking, put HEX ON when you look at the list output.
Or, use the Junk Buster, aka BBHEXD. Search this forum. |
|
Back to top |
|
|
hikaps14
Active User
Joined: 02 Sep 2005 Posts: 189 Location: Noida
|
|
|
|
Hi,
I am trying to write a MQ message with RFH2 Header in COBOL. I searched this forum & IBM site and found out the cobol declaration with default values.
I am not able to understand those parameters and how to use it in PUT statement.
Is there any link for me to start with.
Any kind of help would be appreciated.
Thanks. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
hikaps14
Active User
Joined: 02 Sep 2005 Posts: 189 Location: Noida
|
|
|
|
I did go thru the above link. It was mostly related to MQ installation. I could not find much related to COBOl coding for this Header MQ.
Is there any specific documentation for COBOL. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
sorry, application manuals are written with the concept of the application in mind,
examples are given for different programming languages.
look at the MQS programmers guide. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
How about using the DISPLAY-OF and NATIONAL-OF intrinsic functions of COBOL? See the example in section 1.7.5.6 of the COBOL Programming Guide manual (link at the top of this page) -- would that not do what you want? |
|
Back to top |
|
|
rakesh1155
New User
Joined: 21 Jan 2009 Posts: 84 Location: India
|
|
|
|
@Gurumanoj Gurusamy - Did you use MQGMO-CONVERT during the MQGET in the COBOL program ?
Or as Mr Robert suggested, the DISPLAY-OF and NATIONAL-OF functions will help to convert if not converted during the MQGET. |
|
Back to top |
|
|
hikaps14
Active User
Joined: 02 Sep 2005 Posts: 189 Location: Noida
|
|
|
|
Hi,
I lost a bit of track on this.
Purpose: Write a MQ message with RFH2 Header in Cobol & populate the USR folder with an XML string.
Progress:
Found the MQ RFH2 Structure to be declared.
PUT Message: Is it a regular MQ PUT call or do we need any other fields to set apart from setting MQMD-FORMAT as RFH2-HEADER.
USR Folder. There is a MQ variable 'MQRFH2-USER-FOLDER'. I know I need to insert data into this folder. This variable simply points to it it. I am not able to find the variable, which I need to populate finally.
Have gone thru MQS & Cobol programming guide. Didn't find anything useful. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I google for MQRFH2-USER-FOLDER. Google suggested MQRFH2-USR-FOLDER was better. Got hits. Didn't wade into it as you know more about it than I do. |
|
Back to top |
|
|
hikaps14
Active User
Joined: 02 Sep 2005 Posts: 189 Location: Noida
|
|
|
|
Bill,
I also got the same message from Google but none of the links were fruitful with suggested search. |
|
Back to top |
|
|
hikaps14
Active User
Joined: 02 Sep 2005 Posts: 189 Location: Noida
|
|
|
|
I am trying few things. I have a question ?
Do we need to write the USR folder literals in some other encoding to get it populated successfully on MQ? |
|
Back to top |
|
|
|