View previous topic :: View next topic
|
Author |
Message |
shradhaz
New User
Joined: 28 Jun 2010 Posts: 2 Location: kolkata
|
|
|
|
I will be using a COBOL-MQSeries driver program. Is it necessary to populate the reply string in the driver program before invoking the function call? Is it okay to do the same in the called program? |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Quote: |
Is it necessary to populate the reply string in the driver program before invoking the function call? Is it okay to do the same in the called program? |
You haven't given enough information about what you're trying to achieve.
IF you're sending a reply, you would need to populate the reply message before issuing MQPUT/MQPUT1 - if you're not sending a reply, you have no need to do anything with a reply string.
What is the called program? What is its purpose? Is the driver sending the reply or is the called program?
Garry. |
|
Back to top |
|
|
shradhaz
New User
Joined: 28 Jun 2010 Posts: 2 Location: kolkata
|
|
|
|
The driver program is an existing program in which the commarea has been redefined by different copybooks. Each copybook is for a separate function call and contains a set of request and reply strings.
I have added a new function call and a new copybook. The norm followed in this program is that after MQGET, the reply string is populated with values from the request string.
MOVE MQMD-MSGID TO REQUEST-MQ-MSGID
MOVE MQMD-CORRELID TO REQUEST-MQ-CORRELID
MOVE MQMD-REPLYTOQ TO REQUEST-MQ-REPLYTOQ
MOVE MQMD-REPLYTOQMGR
TO REQUEST-MQ-REPLYTOQMGR
MOVE REQUEST-MQ-COMMAND
TO REPLY-MQ-COMMAND
MOVE REQUEST-MEMBER-ID
TO REPLY-MEMBER-ID
MOVE REQUEST-USER-ID
TO REPLY-USER-ID
.
.
.
What is the significance of the above MOVE statements? Is this necessary since I am populating the reply string in my caled program? |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Your terminology is incorrect.
The fields MQMD-*
Code: |
MQMD-MSGID TO REQUEST-MQ-MSGID
MOVE MQMD-CORRELID TO REQUEST-MQ-CORRELID
MOVE MQMD-REPLYTOQ TO REQUEST-MQ-REPLYTOQ
MOVE MQMD-REPLYTOQMGR
TO REQUEST-MQ-REPLYTOQMGR
|
relate to the MEssage Descriptor and are not part of the reply string, they are contained in the Message Descriptor. These fields are needed so that the reply message can be sent to, and identified by, the application that issued the request.
Code: |
MOVE REQUEST-MQ-COMMAND
TO REPLY-MQ-COMMAND
MOVE REQUEST-MEMBER-ID
TO REPLY-MEMBER-ID
MOVE REQUEST-USER-ID
TO REPLY-USER-ID
|
look like they relate to the reply message and why they are being moved is entirely application dependent.
How and where you assign these fields is up to your application.
Garry. |
|
Back to top |
|
|
|