IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
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
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
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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Aug 26, 2010 5:53 pm
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
Reply with quote

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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Aug 26, 2010 6:26 pm
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
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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Aug 26, 2010 7:13 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts Abend S0C4 11 (Page Translation Excep... PL/I & Assembler 16
No new posts WER999A - UNSUCCESSFUL SORT 8ED U Ab... SYNCSORT 5
No new posts the system or user abend SF0F R=NULL COBOL Programming 0
Search our Forums:

Back to Top