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 » Mainframe, CICS, TXSeries » Can I Use Application Defined Message Properties with COBOL?

Post new topic  Reply to topic
 Can I Use Application Defined Message Properties with COBOL? « View previous topic :: View next topic » 
Author Message
joshhighley
PostPosted: Tue Jul 12, 2005 8:17 am    Post subject: Can I Use Application Defined Message Properties with COBOL? Reply with quote

Newbie

Joined: 12 Jul 2005
Posts: 3

I'm modifying an existing COBOL program that reads input from an MQ queue. All input currently comes from the message body text. As part of the enhancement, I need to also get input data from application defined message properties set by a Java program with JMS. In addition, the program will now put the results on an output queue, and needs to set app defined message properties (client name, etc.) on the output message for use by another Java/JMS programs.

The message is put on the input queue by a Java program that uses JMS and, for those of you who know Java, sets the message properties using the Message class method setStringProperty(). This program is simply forwarding a message from another queue. I'm hoping to add some additional info (configuration options for the COBOL program) to the message by setting the app defined properties rather than modifying the message body text itself.

The output message will be handled by a Java program, as well. It also needs some additional info (client name) that I want to set as a property in the COBOL program.

Despite a lot of searching, I haven't found how to set and get the app defined message properties using COBOL. Is it even possible?

Thanks,

Josh
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 12, 2005 10:27 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

It is possible.

It will be a royal pain.

The properties in question are all stored in the MQRFH2 header. You will need to be able to, from your COBOL program, read and update this header. The MQRFH2 header is not a fixed length record nor does it have a fixed length structure.

You will be much better off trying to convince the Java/JMS developers that they need to think outside the J2EE container, and produce messages that are entirely portable in format. XML is a highly recommended standard for such things, and can easily be accessed from both Java and COBOL (with the right tools from IBM).
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Jul 12, 2005 12:59 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Read the new annoucement about the JMS header in a C environment.
You might want to compile this and use it in your Cobol platform.

Otherwise it's as Jeff stated "hello Pain"

Enjoy
Back to top
View user's profile Send private message Send e-mail
joshhighley
PostPosted: Thu Jul 14, 2005 6:54 am    Post subject: Reply with quote

Newbie

Joined: 12 Jul 2005
Posts: 3

Does anyone know of some COBOL code samples showing the use of the MQRFH2 header? I've searched various places, but haven't found much.

Thanks,

Josh
Back to top
View user's profile Send private message
crossland
PostPosted: Thu Jul 14, 2005 7:28 am    Post subject: Reply with quote

Master

Joined: 26 Jun 2001
Posts: 248

There is a COBOL declaration at the end of the MQRFH2 chapter of the Application Programming Reference Guide.

Regards,

Tim Crossland
MQ Integration
Back to top
View user's profile Send private message
joshhighley
PostPosted: Thu Jul 14, 2005 9:35 am    Post subject: Reply with quote

Newbie

Joined: 12 Jul 2005
Posts: 3

Thanks...the guide provided some good info about how the RFH2 header works:

ftp://ftp.software.ibm.com/software/ts/mqseries/library/books/csqzak05.pdf

I'm somewhat new to MQ programming, so now my question is How do I get the RFH2 header for a message? I guessed that MQGET might return it, but the documentation doesn't mention this. Also, the RFH2 header is dynamic length, depending on the number of application defined properties. From the docs, the property data is XML formatted and comes after the end of the RFH2 header definition. How do I define the copybook for this? I guess this is why it's a pain....

Thanks,

Josh
Back to top
View user's profile Send private message
EddieA
PostPosted: Thu Jul 14, 2005 9:37 am    Post subject: Reply with quote

Jedi

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

Quote:
I guessed that MQGET might return it

Correct. The RFH2 will be the first part of the message payload received. The actual message data will follow it.
Quote:
I guess this is why it's a pain....

Exactly.

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 » Mainframe, CICS, TXSeries » Can I Use Application Defined Message Properties with COBOL?
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.