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

Purge CICS transaction after a time limit


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Thu Aug 30, 2018 4:34 am
Reply with quote

Hi,

Is there anyway to kill/PURGE a CICS transaction that has been running for over a certain elapsed time limit/CPU time limit.

We have Mainview for CICS

Regards,
Vasanth.S
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Aug 30, 2018 3:44 pm
Reply with quote

Did you check the "MainView Threshold Management Guide" ?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Aug 31, 2018 12:46 am
Reply with quote

I will check this. I don't know if we have that product licensed.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Aug 31, 2018 11:51 pm
Reply with quote

Thanks for the link, but I am unable to find the Threshold Advisor from the Mainview menu. I suspect we are not licensed for it.

These are the available options, I did look into each option, but no mention of Thresholds icon_sad.gif
Code:
--------------------------- MAINVIEW Selection Menu -------
OPTION  ===>                                               
                                                           
      0    Parameters and Options                         
      E    Alerts and Alarms                               
      P    PLEX Management (PLEXMGR)                       
      U    Utilities, Tools, and Messages                 
                                                           
   Solutions for:                                         
      A    Automated Operations                           
      C    CICS                                           
      D    DB2                                             
      I    IMS                                             
      J    JAVA Environments                               
      L    Linux and z/VM                                 
      N    Network Management                             
      O    Cost Optimization                               
      S    Storage Management                             
      T    Application Management and Performance Tuning   
      W    MQ and WAS                                     
      Z    z/OS and USS                                   
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Sat Sep 01, 2018 12:54 am
Reply with quote

You control them using ICVR per CICS Region.
Or check Task Time-Out Management function within MainView Product.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Sep 05, 2018 12:02 am
Reply with quote

Thanks, We have ICVR set to 20000 - 20 seconds, but the transactions just keep running over 20 minutes, if they are looping. I think there is a specific criteria that needs to be met to satisfy the ICVR time and for a transaction to be cancelled. It is very confusing.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 05, 2018 12:10 am
Reply with quote

define loop please ?

the ICVR definition is

Quote:
CICS might purge a task if it has not given up control after the RUNAWAY interval for the transaction (or ICVR if the transaction definition specified RUNAWAY=SYSTEM).


and applies to a CPU loop, but if the loop contains cics calls the ICVR does not apply
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Sep 05, 2018 12:18 am
Reply with quote

Thank you for looking into this.
Quote:
but if the loop contains cics calls the ICVR does not apply

I honestly have no idea how the handover between CICS and DB2 takes place, when there is a CICS transaction accessing DB2.

In my scenario, there is a CICS transaction that accesses DB2 table and looks for a row, if the row is not found then the program keeps looking for the row indefinitely(this is what I perceived as looping).
The transaction was running for like 15 minutes before it was cancelled. Would ICVR value apply in this case?

I understand that this is a program fault & needs to be corrected, but I am trying to address it from CICS perspective to handle such (rare)buggy transactions.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 05, 2018 2:44 am
Reply with quote

unfortunately that' s not cics point of view icon_smile.gif

Quote:
The transaction was running for like 15 minutes before it was cancelled. Would ICVR value apply in this case?

NO, if the program relinquishes control, for cics is not CPU looping

and how in heaven can cics distinguish a legitimate long running task
from a faulty one ?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Sep 05, 2018 3:33 am
Reply with quote

Quote:
and how in heaven can cics distinguish a legitimate long running task
from a faulty one ?
You are right, it makes sense now. Thank you.
I was looking for a parameter like DB2-Resource Limit Facility in CICS. Many sites say that a monitor is needed and there is no inherent way to limit CPU.
I wish there was an in-built one
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Wed Sep 05, 2018 4:30 am
Reply with quote

Quote:
I was looking for a parameter like DB2-Resource Limit Facility in CICS. Many sites say that a monitor is needed and there is no inherent way to limit CPU.
I wish there was an in-built one
should ASUTIME set in DB2 gives you -904 in your cics db2 program and then you do a proper error handling to end the current running task ? That’s being followed by almost everyone since it’s one of the bad sqlcode and most common one .
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Sep 05, 2018 5:27 am
Reply with quote

Quote:
should ASUTIME set in DB2 gives you -904 in your cics db2 program and then you do a proper error handling to end the current running task ? That’s being followed by almost everyone since it’s one of the bad sqlcode and most common one .

AFAIK, the program does not receive a -904 for record not found. The row is 'logically' not found by the program. The program looks for a column with a selective value and just reads sequentially, it is a program logic and not a straight up query.

We are unable to set a limit on DB2 side because
1. It is very hard to identify each stuff that runs on DB2 and set a limit for them. There are just too many variety of things.
2. Queries initiated by CICS are the main culprits, because they run with very high service class and causes outages.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Wed Sep 05, 2018 4:43 pm
Reply with quote

I mean my point is any sql query being issued it must finish it up in Less than or equal to ASUTIME even if row not found situation else it should give you -904.If it’s not a DB2 thread and some other looping issue in the program then that program needs a emergency fix.

Moreover, I am not sure but you can able to lower the priority of the long running task.
Back to top
View user's profile Send private message
John Poulakos

Active User


Joined: 13 Jun 2012
Posts: 178
Location: United States

PostPosted: Fri Oct 12, 2018 8:13 pm
Reply with quote

Are you sure the CICS transaction is actually running and consuming CPU, or is it just waiting? If you kill the transaction, you should see if you can find a TRU exit in the dump. I have seen transactions hang many times when a TRU exit is present, because a TCB gets posted under the wrong storage key. TRU exits are fairly common with DB2 under CICS.

If you aren't familiar with TRU exits, google "CICS TRUE".
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Sat Oct 13, 2018 2:18 am
Reply with quote

Hi John,
I do not know CICS TRUE, I will look it up. Thanks.

Quote:
Are you sure the CICS transaction is actually running and consuming CPU, or is it just waiting?
Yes the transaction was actually running because of a program bug. The program was supposed to loop through a DB2 table and find an available number between 1 and 999.
But for that scenario, there happened to be no free numbers.

This scenario was not handled and the program kept looking for available numbers till eternity.
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
Search our Forums:

Back to Top