You have a COBOL program that reads MQ queue and writes data to files; but program abends,
so how do you make sure that when you restart the program after fixing the abend the data is correct from the MQ.
Tough Interview Question need answer
-
- Posts: 28
- Joined: Wed Sep 19, 2018 8:20 pm
- Skillset: CICS, HLASM, DFSORT, REXX, PL/1
- Referer: Self-referred
Re: Tough Interview Question need answer
Not so tough.
First, to ensure that the MQ message survives across a possible restart of the MQ Queue Manager, the message should be persistent. This is set at the time the message is put to the queue. Non-persistent messages are lost on Queue Manager restart.
Next, your Cobol program that gets (not reads) the message must get the message in syncpoint (MQGMO-SYNCPOINT) so that, in the event of a failure, the message is reinstated on the queue. If the get is with MQGMO-NO-SYNCPOINT, the message cannot be reinstated. On successful processing of the message (or set of messages) a commit is to be issued.
Finally, to ensure that a bad message does not result in an infinite loop of retries, the program should check the message's backoutcount and take appropriate action if this exceeds a pre-determined threshold.
Garry.
First, to ensure that the MQ message survives across a possible restart of the MQ Queue Manager, the message should be persistent. This is set at the time the message is put to the queue. Non-persistent messages are lost on Queue Manager restart.
Next, your Cobol program that gets (not reads) the message must get the message in syncpoint (MQGMO-SYNCPOINT) so that, in the event of a failure, the message is reinstated on the queue. If the get is with MQGMO-NO-SYNCPOINT, the message cannot be reinstated. On successful processing of the message (or set of messages) a commit is to be issued.
Finally, to ensure that a bad message does not result in an infinite loop of retries, the program should check the message's backoutcount and take appropriate action if this exceeds a pre-determined threshold.
Garry.
-
- Posts: 5
- Joined: Tue Nov 20, 2018 1:55 am
- Skillset: Mainframe, COBOL, CICS, JCL
- Referer: Internet search
Re: Tough Interview Question need answer
Thanks Gary - that helps a lot.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 2
- 2248
-
by Pedro
View the latest post
Tue Feb 27, 2024 4:44 am