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 » Anyone have a COBOL Request-Reply with CorrelId sample.

Post new topic  Reply to topic
 Anyone have a COBOL Request-Reply with CorrelId sample. « View previous topic :: View next topic » 
Author Message
simon.starkie
PostPosted: Mon Sep 08, 2003 12:48 pm    Post subject: Anyone have a COBOL Request-Reply with CorrelId sample. Reply with quote

Disciple

Joined: 24 Mar 2002
Posts: 180

Hi,
I am looking for a sample COBOL program I can give to one of my developers who has no MQ expertise.

The ideal COBOL sample would implement a simple MQ Request-Reply model.

First, a request would be issued by using MQPUT to place the request message on a queue.

Second, the MessageId would be extracted with MQINQ from the message that was previously MQPUT.

Third, a response would be issued to MQGET using a CorrelId set to the MessageId which was previously extracted with MQINQ. This MQGET would also have a timeout.

If anyone has anything like this, I'd sure appreciate getting a copy. Other languages would also be useful except JAVA JMS or AMI (they are both quite different).

Thank you very much.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Mon Sep 08, 2003 8:30 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

A couple of items.

1) Throwing some code at a developer who does not understand MQ, may result in a poor performing application (or worst, non-functioning).

2) You do not do an MQINQ after a MQPUT to get the MessageID.

I would strongly suggest that you send your developer on a MQ programming course (even a basic 2-day programming course).

Also, after an application does a MQPUT, if you want to save the MessageID, you simple move the MQMD-MessageID to your working storage. (no API call is required)

Finally, if source code is what you want, then source code is what you get. At the top of the page is a link to mqseries.net repository. At the following link I have some client / server COBOL type programs:
www.capitalware.biz/sample_mqseries.html#cobolcode

later
Roger...
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
simon.starkie
PostPosted: Tue Sep 09, 2003 5:19 am    Post subject: Reply with quote

Disciple

Joined: 24 Mar 2002
Posts: 180

Roger, thank you very much for correcting me about the MQINQ item. I was wrong. You are right. It should be easy to retrieve the MessageId after the MQPUT as you have indicated.

I'm not "throwing" code at the developer. The reality is that the developer in this case does not have any MQ experience at all and requested a sample. I was hoping to find somebody with decent Request-Reply sample in written in Cobol. I guess I was wrong about that too.

I'm just the design engineer. I don't have any budget $$$ to send developers to MQ programming courses.

If anyone out there has a decent MQ Request-Reply sample written in Cobol, I will pay a small cashg reward. Thanks.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Tue Sep 09, 2003 8:53 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hummm, ok.

Since you still are looking for sample code, then I take it that you did not go to my site.

Under MQ / COBOL, there are 2 programs called MQClient and MQServer (this would be requestor and replier). They are complete samples. The only thing missing from the MQServer is saving the MsgID value and then copying it to the CorrelID before the put.

Therefore, add the following 3 lines to MQServer:
Code:
* In working storage
01 SAVED-MSGID            PIC X(24).
* In section 4500 after MQGET
MOVE MQMD-MSGID TO SAVED-MSGID.
* In section 4000 before MQPUT
MOVE SAVED-MSGID TO MQMD-CORRELID.


MQClient & MQServer is located at
http://www.capitalware.biz/sample_mqseries.html#cobolcode

later
Roger...
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
simon.starkie
PostPosted: Wed Sep 10, 2003 8:22 am    Post subject: Thanks. Reply with quote

Disciple

Joined: 24 Mar 2002
Posts: 180

Thanks Roger

Where should I send the small cash reward? Please PM me. Thanks again.
Back to top
View user's profile Send private message
vennela
PostPosted: Wed Sep 10, 2003 8:42 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

I think part of the reward should go to Brandon for running this site.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
RogerLacroix
PostPosted: Wed Sep 10, 2003 8:40 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Yes, give the entire amount to Brandon for hosting this site.
Go to:
http://www.mqseries.net/donate.php

later
Roger...
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
simon.starkie
PostPosted: Thu Sep 11, 2003 7:33 am    Post subject: Reply with quote

Disciple

Joined: 24 Mar 2002
Posts: 180

I have made a $25 donation to the American Red Cross.
This seemed like an appropriate thing to do this date.
Thanks again Roger.
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 » Anyone have a COBOL Request-Reply with CorrelId sample.
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.