Killing a CICS transaction.

All sort of Mainframes Interview Questions.
Post Reply
Mainframe Bear
Registered Member
Posts: 26
Joined: Sat Oct 12, 2013 2:30 am

Killing a CICS transaction.

Post by Mainframe Bear »

Hi,

How can we kill a CICS transaction? In case the transaction stuck. may be in a loop or for some other reason then how do you kill that transaction?

Or can we kill the associated task too?

I did not know the answer, as we always approached support group and never it our own.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Killing a CICS transaction.

Post by Robert Sample »

The best, and easiest, way is to use the system monitoring tool (OMEGAMON, MAINVIEW are the main examples) to identify and kill the program. Without one of them, you would have to use CEMT to identify which transaction is the problem and remove it. There are actually three possible looping cases:
1. transaction is executing CICS commands but not doing RETURN TRANSID. This allows you to kill that transaction.
2. transaction is executing CICS commands including RETURN TRANSID. This will be very difficult to kill since the transaction id is constantly changing.
3. transaction is looping without executing CICS commands (also known as a hard loop). Generally without a system monitor the only resolution for this type of loop is to bounce the CICS region.
Mainframe Bear
Registered Member
Posts: 26
Joined: Sat Oct 12, 2013 2:30 am

Re: Killing a CICS transaction.

Post by Mainframe Bear »

Thank you so much Robert Sample.

For point if we kill all the transactions in question, can that work?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Killing a CICS transaction.

Post by Robert Sample »

If you can disable the transaction in question, then it won't be able to do a START (or RETURN) TRANSID and that'll stop the looping. How do you propose to "kill all the transactions in question"? The task number will be constantly changing if a new TRANSID is started via the RETURN (or START).
Mainframe Bear
Registered Member
Posts: 26
Joined: Sat Oct 12, 2013 2:30 am

Re: Killing a CICS transaction.

Post by Mainframe Bear »

But will not there be a single 'master task' for the entire unit of work?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Killing a CICS transaction.

Post by Robert Sample »

But will not there be a single 'master task' for the entire unit of work?
No, there will not. With pseudo-conversational coding, you issue RETURN TRANSID when the program is ready for user input -- which ends the current task and starts a new task with a new task number. I suspect you are confused about "logical unit of work" -- which is a way of identifying when to use SYNCPOINT / ROLLBACK for coordinated updates.
Mainframe Bear
Registered Member
Posts: 26
Joined: Sat Oct 12, 2013 2:30 am

Re: Killing a CICS transaction.

Post by Mainframe Bear »

oh then how would a programmer know for how long a 'unit of work' is going to work?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Killing a CICS transaction.

Post by Robert Sample »

From https://www.ibm.com/support/knowledgece ... vices.html :
If an individual task fails, backout is performed automatically by CICS®. If the CICS system fails, backout is performed as part of the auto start process.

However, for long-running programs, it might not be desirable to have a large number of changes, which have accumulated over a period of time, exposed to the possibility of backout if a task or the system fails. You can avoid this possibility by using the EXEC CICS SYNCPOINT command to split the program into logically separate sections that are called logical units of work (LUWs); the end of an LUW is called a synchronization point (syncpoint).

If failure occurs after a syncpoint but before the task has been completed, only changes that were made after the syncpoint are backed out.

LUWs should be entirely logically independent, not merely with regard to protected resources, but also with regard to execution flow. Typically, an LUW comprises a complete conversational operation bounded by EXEC CICS SEND and EXEC CICS RECEIVE commands. A BROWSE is another example of an LUW. An EXEC CICS ENDBR command must therefore precede the syncpoint.
Hence, a programmer will NOT know "for how long a 'unit of work' is going to work" -- the programmer inserts the EXEC CICS SYNCPOINT where it makes sense to the application. Sometimes this is determined by the update count -- every 10 / 100 / 1000 updates the SYNCPOINT is issued; sometimes other factors are used to determine when the SYNCPOINT is issued.
Mainframe Bear
Registered Member
Posts: 26
Joined: Sat Oct 12, 2013 2:30 am

Re: Killing a CICS transaction.

Post by Mainframe Bear »

Thanks. Can I compare the SYNCPOINT with Checkpoint restart in batch? And that's the reason we don't have checkpoint restart in CICS?
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Killing a CICS transaction.

Post by nicc »

They are synonyms.
Regards
Nic
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: Killing a CICS transaction.

Post by enrico-sorichetti »

SYNCPOINT is a synonym of CHECKPOINT

any idiot can SYNCPOINT/CHECKPOINT 8-)
( it just takes a &couple of calls)

RESTART is a completely different can of worms
it need to be carefully planned and at the end it will considerably
change also the SYNCPOINT/CHECKPOINT process

( a quick and dirty example
You have some items and running totals IN STORAGE/MEMORY ONLY - nothing wrong with it
issuing the SYNCPOINT/CHECKPOINT calls will take care of the database things
but, what about the IN STORAGE/MEMORY ONLY data
how will they be resync when restarting )

the above applies mostly to batch processing
but there are cases where it applies also to CICS transactions
BTDTGTTS

meditate please, meditate
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Interview Questions.”