The Control-O AutoEdit facility is also available under KOA. All AutoEdit functions available under Control-O rules are supported. This expands the versatility of KOA and provides an additional communication path (method of sending information) to Control-O. The following AutoEdit commands are available:
SETOLOC %%cto-var = expression
SETOGLB %%cto-var = expression
SETVAR %koa-var DATA expression
where expression is any valid Control-O AutoEdit expression, which may contain KOA variables. KOA variables are resolved first.
Since KOA scripts can be executed independently of the Control-O monitor, the following restrictions apply:
The following sample script illustrates the use of AutoEdit and KOA variables in a KOA script. The script tracks the number of times CPU usage was higher than 90% (according to information from a performance monitor).
Table 24 KOA Sample Script Using AutoEdit and KOA Variables
Command |
Explanation |
---|---|
SETVAR %CPU SCREEN 7 12 2 |
Set KOA variable %CPU to the two screen characters at line 7, column 12. At this screen position, CPU usage is displayed. |
IFVAR %CPU LT 90 GOTO CHKAGAIN |
Determine if CPU usage (%CPU) is less than 90%. If less than 90%, proceed to label CHKAGAIN. If not, proceed to the next script command. |
SETOLOC %%LOCCPU = %CPU |
Set local AutoEdit variable %%LOCCPU to the value of KOA variable %CPU. |
SETOGLB %%COUNT%%LOCCPU = %%COUNT%%LOCCPU %%$PLUS 1 |
Increment global AutoEdit variable %%COUNT%%LOCCPU, which tracks the number of times CPU usage was 90% or higher. |
SETVAR %PRLINE DATA `%CPU %%COUNT%%LOCCPU’ |
Set KOA variable %PRLINE to (variable names) `%CPU %%COUNT%%LOCCPU’. %PRLINE is used for printing purposes. |
LABEL CHKAGAIN |
Specify label CHKAGAIN for script flow branching purposes. Continue script processing. |
Parent Topic |