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

How to terminate your cics pgm when it's in infinite loop?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Fri Aug 26, 2011 1:49 pm
Reply with quote

When the user is using the screen obviously the program gets the information and populates the info to the screen. so during this process when the cics pgm which gets the info goes infinate loop and after some time you acknowledged that the pgm gone infinate loop, at this instance how do you terminate that program or how do you terminate the task???
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Aug 26, 2011 4:25 pm
Reply with quote

Depending upon your system, it may or may not be possible. If you are running on a system with a single CPU dedicated to the LPAR, AND the loop has no EXEC CICS calls in it, your only recourse is to bring down the CICS region -- and if the CICS region won't cancel, an IPL of the system will be needed. If you have a system monitoring tool such as Omegamon or Mainview, you can use them to cancel the task, again depending upon the configuration.

But your single best bet is to get your site support group to provide you with the answer to your question -- they will know how your system is set up and configured, as well as which tools are installed, and may have some very good suggestions on how to do what you want.
Back to top
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 121
Location: Puerto Rico

PostPosted: Fri Aug 26, 2011 8:08 pm
Reply with quote

If you have access to another terminal other than the one that's locked with the transaction in a loop and if you have authorization to issue a CEMT on your system then issue a CEMT I,TASK. locate the terminal that's locked with the loop and on the same line move the cursor after the status, enter F,P then press enter. This should force a purge of the task. If the whole CICS region is locked then follow Roberts advice.
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Mon Aug 29, 2011 1:01 am
Reply with quote

Thanks very much roberts and Jose...
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 29, 2011 8:00 am
Reply with quote

Hello,

In code that has one or more loops, suggest you add code to detect a runaway and self-terminate when an "infinite loop" is detected. For example, if the maximum times thru a loop should be 10,000 add 1 to a ws-counter and termniate when the counter reaches 20,000. . . Or insert an EXEC CICS ASKTIME within the loop(s) so the transaction becomes more easily cancelable.

Once the testing is complete and the problem loop(s) correted, these could be turned into comments or removed.

The system support andor computer operations people will be most unhappy if you run code that takes down cics regions. . .
Back to top
View user's profile Send private message
dilip_bangalore

New User


Joined: 29 Sep 2011
Posts: 27
Location: India

PostPosted: Sun Oct 02, 2011 12:28 pm
Reply with quote

Hello,

One thing you can do is, you can bring down the CICS region by stopping the CICS job and try to restart it.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Oct 02, 2011 12:40 pm
Reply with quote

Hello,

Quote:
you can bring down the CICS region by stopping the CICS job and try to restart it.
Not if you intend to remain employed. . .

Sometimes, it is necessary, but should never be consider the "normal" way to operate.

If this happens more than very rarely, it just shows that the developer(s) need someone to watch over them.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
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
This topic is locked: you cannot edit posts or make replies. REXX - Do - Not able to LOOP CLIST & REXX 10
No new posts Parallelization in CICS to reduce res... CICS 4
Search our Forums:

Back to Top