Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to put the messages back to the MQ if abend?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
View previous topic :: :: View next topic  
Author Message
raveeshk17

New User


Joined: 29 Jul 2010
Posts: 2
Location: Hyderabad

PostPosted: Thu Aug 26, 2010 5:26 pm    Post subject: How to put the messages back to the MQ if abend?
Reply with quote

HI,

I am new working on MQ series.

I have a scenario where I am reading a MQ. AFter the message is successfully get from the MQ, and while processing the message and trying to insert it into DB2 tables, I got SOC4. When I see the message via MQmenu, I found that message deleted from the queue.

Is there any way I can roll back the MQGET call when I incur abend in the program?

Thanks in advance
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 26, 2010 5:45 pm    Post subject:
Reply with quote

are you using RRSAF?

If not, how are you scheduling your COMMITs with db2 and mqs?
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Aug 26, 2010 5:53 pm    Post subject:
Reply with quote

This is fairly standard MQ processing.

Issue the MQGET with MQGMO-SYNCPOINT . If the application abends or issues a rollback, then the message is still available on the queue with the Backoutcount incremented. After a successful MQGET you should check the Backoutcount and, if => 1, then move the message elsewhere for action.

When an MQGET is issued, MQ just marks the message as 'unavailable' on the queue and doesn't remove it until the MQCMIT (or CICS SYNCPOINT &c.). In the event of a failure or rollback, the message is in simply marked 'available' and is in the exact same location as it had been previously.

A backoutcount > 1 suggests that this message has failed twice and is possibly the cause of the abend. As the message is likely now at the head of the queue, no further mesages will be processed until it has been removed (by issuing a commit).

Garry.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 26, 2010 6:19 pm    Post subject:
Reply with quote

also, what environment? Batch, CICS?
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Aug 26, 2010 6:26 pm    Post subject:
Reply with quote

Processing is the same regardless of environment. Use environment's two-phase commit where available.

Garry.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 26, 2010 7:05 pm    Post subject:
Reply with quote

Quote:
Processing is the same regardless of environment. Use environment's two-phase commit where available


No, it is not.
in cics you handle things much differently than in batch;
syncpoints is a very big difference, since they don't like you issuing COMMITs in CICS.
and that is why I asked about RRSAF.

and obviously, you always attempt to use the two-phase commit.........
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Aug 26, 2010 7:13 pm    Post subject:
Reply with quote

Dick,

The MQ process is the same. In CICS use an EXEC CICS SYNCPOINT which is that environment's two-phase commit (or EXEC CICS SYNCPPOINT ROLLBACK, if rolling back).

Garry.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 26, 2010 7:28 pm    Post subject:
Reply with quote

The TS is working with MQS and DB2.
Back to top
View user's profile Send private message
raveeshk17

New User


Joined: 29 Jul 2010
Posts: 2
Location: Hyderabad

PostPosted: Fri Aug 27, 2010 12:24 pm    Post subject:
Reply with quote

Thanks a lot for the info.

It works now.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts hot to get details when "EXEC CI... Andi1982 CICS 11 Tue Sep 20, 2016 5:01 pm
No new posts S213-14 ABEND explantion Apurva Mehta JCL & VSAM 5 Thu Jul 07, 2016 10:56 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us