Tough Interview Question need answer



Tough Interview Question need answer

Postby poloman » Wed Nov 21, 2018 1:32 am

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.
poloman
 
Posts: 5
Joined: Tue Nov 20, 2018 1:55 am
Has thanked: 0 time
Been thanked: 0 time

Re: Tough Interview Question need answer

 

Re: Tough Interview Question need answer

Postby Garry F Carroll » Wed Nov 21, 2018 2:44 pm

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.
Garry F Carroll
 
Posts: 7
Joined: Wed Sep 19, 2018 8:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Tough Interview Question need answer

Postby poloman » Thu Nov 29, 2018 2:58 am

Thanks Gary - that helps a lot.
poloman
 
Posts: 5
Joined: Tue Nov 20, 2018 1:55 am
Has thanked: 0 time
Been thanked: 0 time


Return to Interview Questions

 


  • Related topics
    Replies
    Views
    Last post