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 Discussion » Sample Code Required For Setting PAN and NAN

Post new topic  Reply to topic
 Sample Code Required For Setting PAN and NAN « View previous topic :: View next topic » 
Author Message
dbassi
PostPosted: Thu Jun 10, 2004 10:52 am    Post subject: Sample Code Required For Setting PAN and NAN Reply with quote

Newbie

Joined: 04 Jun 2004
Posts: 7

I need Sample Code For Setting PAN and NAN just before sending the reply message.

Will it be a simple SET command that SET MQFB_PAN or MQFB_NAN to true?

Also what will be code changes required for getting the message which has requested for PAN and NAN i.e. will there be any change while computing MGMO-OPTIONS.
Back to top
View user's profile Send private message
EddieA
PostPosted: Thu Jun 10, 2004 11:17 am    Post subject: Reply with quote

Jedi

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

Take a look at: http://www.mqseries.net/phpBB2/viewtopic.php?t=15809&highlight=pan+nan
All you are dealing with are 'regular' application messages.

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
dbassi
PostPosted: Thu Jun 10, 2004 12:47 pm    Post subject: Sample Code Required For Setting PAN and NAN in COBOL Reply with quote

Newbie

Joined: 04 Jun 2004
Posts: 7

Hi Eddie

I looked at the discussion topic to which you have pointed, before I posted this query.

The situtaion is like this:

We will receive messages from some X application. Our application will process each message and for every message we need to send PAN or NAN to X application depending upon message was processed successfully or not.

Now I just need sample code to SET the PAN or NAN.

In MQ copybooks I have seen 2 fields for PAN i.e. MQRO_PAN and MQFB_PAN. Everywhere it is written that if message is successfully processed by application SET the PAN. But which field needs to be SET; I suppose it must be MQFB_PAN.

Also MQFB_PAN and MQRO_PAN are defined at level 10 in COBOL copybook i.e. they are not 88-Level fields, so how to set them.

The queries may seem to be trivial but I am working first time on MQ-Series and was unable to find the refernce source code for the same.
Back to top
View user's profile Send private message
EddieA
PostPosted: Thu Jun 10, 2004 2:11 pm    Post subject: Reply with quote

Jedi

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

Quote:
We will receive messages from some X application

This is the application that should set the NAN or PAN option in the MQMD Report Options.

Quote:
Our application will process each message

And it should check the Report Options to see if you should be sending a Report message back to the sending application.

Quote:
for every message we need to send PAN or NAN to X application depending upon message was processed successfully or not

Are you going to do this based on the incoming Report options, or is this an "agreement" between the sender/receiver.

Quote:
Now I just need sample code to SET the PAN or NAN.

As was said previously. There is nothing to set. The NAN or PAN message is just a message. The format of which is agreed upon by the sender/receiver.

All MQ does is allow the sender to set a flag (NAN or PAN in the Report options) that the receiver can check and perform whatever actions he wants to.There is no MQ defined NAN or PAN message format.

Quote:
MQFB_PAN and MQRO_PAN are defined at level 10 in COBOL copybook

That surprises me. Unless it contains a value, in which case it's intended as the source of a MOVE to another field. The Feedback codes are values, not fields. I couldn't find either in the COBOL directory installed on Windows to check.

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
dbassi
PostPosted: Thu Jun 10, 2004 2:38 pm    Post subject: Sample Code Required For Setting PAN and NAN in COBOL Reply with quote

Newbie

Joined: 04 Jun 2004
Posts: 7

Hi Eddie

First of all thanks for your detailed answer. But Still I have some doubts:

1. Yes, our application needs to send PAN or NAN for each message coming from X depending upon that message got successfully processed by our application or not. As it is agreed upon that we have to send NAN or PAN for each message, our application need not check that whether application X has requested PAN or NAN in its MQMD report options or not (ofcourse they will set them for every message).

2. Now flow of my program is:

A. Open the Request Queue (which contains messages from application X)

B. Get the Message from Queue that comes from application X

C. Process that message

D. Put the reply to the message in reply queue.

Now between Step C and Step D , I need to set PAN or NAN depending upon that message got successfully processed by our application or not.
How to do that?

Also application X want only PAN or NAN in reply to the message that they have sent.

So suppose my application has processed the message successfully and now I need to send PAN to application X. How should I achieve that?

I know these questions may sound very basic but I don't have any clue.
Back to top
View user's profile Send private message
EddieA
PostPosted: Thu Jun 10, 2004 3:49 pm    Post subject: Reply with quote

Jedi

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

Quote:
Now between Step C and Step D , I need to set PAN or NAN
How should I achieve that

We can't help you with that. What does the receiving application expect back when it worked. What do they expect back when it fails. Do they expect reply messages, or report messages. Those messages are the NAN and PAN.

From the MQ Manual, regarding the Report options NAN and PAN (my emphasis):
Quote:
This type of report is generated by the application that retrieves the message and acts upon it. It indicates that the action requested in the message has been performed successfully. The application generating the report determines whether or not any data is to be included with the report.

Quote:
Other than conveying this request to the application retrieving the message, the queue manager takes no action based upon this option. It is the responsibility of the retrieving application to generate the report if appropriate.


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
dbassi
PostPosted: Thu Jun 10, 2004 4:19 pm    Post subject: Sample Code Required For Setting PAN and NAN in COBOL Reply with quote

Newbie

Joined: 04 Jun 2004
Posts: 7

Thanks Eddie for spending your precious time on this query.
Back to top
View user's profile Send private message
kevinf2349
PostPosted: Fri Jun 11, 2004 5:14 am    Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

I am a little confused here(situation normal)

If you want the application to say whether it successfully received the message or not? Why use a report message at all? Why not just send a 'got it' message back from the application?

If you want some assurance that the message actually made it to the remote queue and is ready for selection you could use COA or COD I would have thought.

Maybe I haven't got a full grip on the application requirements but I would have thought that a combination of both the above approaches would give you a pretty good starting point.
Back to top
View user's profile Send private message
dbassi
PostPosted: Fri Jun 11, 2004 7:57 am    Post subject: Sample Code Required For Setting PAN and NAN in COBOL Reply with quote

Newbie

Joined: 04 Jun 2004
Posts: 7

Hi Kevin

As per our requirement we need to do some processing after receiving the message and depending on whether that processing is successful or not we need to send PAN or NAN. COD and COA are just for message received or delievered successfully. These are not required as per requirement.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Jun 11, 2004 8:24 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

PAN and NAN are almost never used. What really happens most often is the responding app always needs to send back some sort of response, so why bother looking for PAN/NAN in the MQMD_Report? Just always send the response.

One scenario where PAN/NAN make sense is when the app is handling requests from many different clients / apps. Some want to know what happened, others dont care. In this case, it kinda makes sense for the responding app to look for PAN/NAN, and if found, send it, and if not, don't, saving resources.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
dbassi
PostPosted: Fri Jun 11, 2004 8:29 am    Post subject: Sample Code Required For Setting PAN and NAN in COBOL Reply with quote

Newbie

Joined: 04 Jun 2004
Posts: 7

Hi Peter

We are now thinking of same, i.e. to send the response in reply queue.

Thanks.
Back to top
View user's profile Send private message
kevinf2349
PostPosted: Fri Jun 11, 2004 10:14 am    Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

dbassi

I wrote:

Quote:
Why not just send a 'got it' message back from the application?


Maybe I should expand on this. We have an application that requires that we always send a response back to the requestor. This can be one of three responses, "Yes", "No" or "Needs investigation". So the application will always send one of those replies back. In our case the application is to allow us to conform to the government's OFAC requirement as part of the Patriot act.

The turnaround within the OFAC system is such that the "Yes", "no" or "Investigate" message gets back to the requesting application within a second or two. If this were to change we would probably just send an immediate message back to the requestor with some kind of 'got it - please wait' message so that the application can make the choice of whether to continue to wait or not. The basis for this would be that the MQ side of things was fine, the delay is in the serving application'
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 Discussion » Sample Code Required For Setting PAN and NAN
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.