How avoid endless loops in ACL?

Document ID : KB000010628
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

In programming the likelihood of creating unwanted endless loops is high, especially during creation and test of a program. In ACL there are two ways to avoid these CPU-consuming loops.

Instructions:

Here are the two ways to avoid endless loops in ACL programs:

1. Restrict the total number of statements

With Statement

  OPTION MAXI,nnnn

you restrict the number of statements executed in the ACL to the number specified after "MAXI". When you specify
  OPTION MAXI,0

there is no limit.

2. Set a Runaway Limit

Beside the MAXI-Option there is another way to avoid ACLs in uncontrolled loops can be influenced by parameter "ACL Runaway Limit" in the first panel of the SMRT.

smrt-1.png

The default of this parameter is 10000 and can be changed to a value between 200 and 20000. What does this number mean?
With this number you specify the maximum value a "counter for the runaway statement limit" can reach. For each ACL statement that does not need external intervention this counter is increased by one. Those statements are for example ADD, SUB, KEY, SEARCH, BRANCH, TABF, TABB, HOME, UDEFINE, VDEFINE. They all do not need intervention by the user or wait on data streams from the application. When such a statement has finished the next one is executed. But when a statement which hands over control to the user, the terminal or the application then the counter is set back to zero. Examples of those statements are ENTER, PF, PA, INPUT, PAUSE, SEND, WINP. This picture shows the values of the counter for a typical ACL. The counter is increases as long as ACL statements are executed which need no intervention. The first statement which need intervention, here it is WINP which waits for input from the application, reset the counter to zero.

acl.png

If the Runaway Limit is reached, the ACL ends with this message

fehlermeldung.png