AutoEdit Facility
This chapter contains the following topics:
Overview
When Control-O handles DO actions, ON statements and IN conditions, the contents of the subparameters are scanned for special symbols, starting with %%. These symbols are analyzed, edited and automatically assigned new values. The modified statement is then activated. The contents of the original statement remain unchanged.
Unlike DO statements, which are resolved at rule execution, IN conditions and ON statements are resolved at rule ordering.
Using the AutoEdit facility in a rule definition provides great flexibility in condition specification and action definition. For example:
-
A start command can contain the current date as a parameter.
-
The jobID of the job that issued the message can be included in a command issued to correct a situation.
-
Text from the original message can be used within a newly edited message, or in an operator command or a TSO command.
-
The DO SET command can be used to assign values to reserved user-defined AutoEdit variables, or to define your own user-defined AutoEdit variables and assign them values that can be retrieved from the message or command. These values can be used in subsequent DO actions, ON statements and IN conditions of the rule.
User-defined AutoEdit variables can be defined as local, global, and XAE global. Local variables are stored on one machine, with changes affecting only a rule running on that machine. Global variables are stored in a common storage area on a machine. Changes to a Global variable can be accessed by all rules on that system. XAE Global variables can be accessed by all rules running on any system in a Sysplex. For more information about the XAE facility, see Using an XAE AutoEdit Variable Database
User-defined AutoEdit variables to be used in ON statements and IN statements must be defined as Global.
Global variables can be used:
-
in subsequent executions of the same rule
-
in other rules
-
by the Control-M AutoEdit facility
-
in KOA scripts
-
in execution of a rule on other Sysplex participants (if an XAE database is defined)
There are several categories of AutoEdit symbols
-
control statements
-
functions
-
operators
-
System variables
-
user-defined Local variables
-
user-defined Global variables
The following Rule Definition screen displays examples of AutoEdit symbol types. For information about reserved user-defined variables, see Reserved User-Defined Variables.
Figure 244 AutoEdit Symbol Types Example
RL: DFS810A LIB CTOP.V610.RULES TABLE: JOB
COMMAND ===> SCROLL===> CRSR
+--------------------------------------------------------------------------+
ON MESSAGE = DFS810A
JNAME JTYPE SMFID SYSTEM USERID
ROUTE DESC CONSOLEID CONSOLE
APPEARED TIMES IN MINUTES And/Or/Not
OWNER IOAADMIN GROUP MODE PROD RUNTSEC
THRESHOLD
DESCRIPTION IDENTIFY IMS IS READY (KEEP REPLY NUMBER + SIGNAL CONTROL-M)
DESCRIPTION
===========================================================================
DO SET = %%J = %%$JOBNAME GLOBAL N
DO SET = %%COUNT_%%J = %%COUNT_%%J %%$PLUS 1 GLOBAL Y
DO SET = %%REPLY_%%J = %%$REPLY GLOBAL Y
DO SET = %%PREF = %%$SUBSTR %%$JOBNAME 1 3 GLOBAL N
DO COND = %%%J_IS_DOWN STAT -
DO SHOUT = TO TSO-%%PREF URGENCY R SYSTEM CTO282I
MESSAGE %%$JOBNAME ACTIVE
DO
===========================================================================
FILL IN RULE DEFINITION. CMDS: CAPS, EDIT, SHPF, SCHED, OPT 11.51.00
The first DO SET statement defines a local user variable named %%J. It is assigned the value of the %%$JOBNAME System variable that is the name of the job issuing the message.
The second DO SET statement defines a Global user variable named %%COUNT_%%J. The variable resolves into the name of the IMS that has started, for example, COUNT_IMS1. The %%$PLUS AutoEdit operator increments the variable by 1. This Global variable serves as a counter of the number of times that IMS has been started.
The third DO SET statement defines a Global user variable named %%REPLY_%%J, which is used to keep the open reply number of IMS (from the %%$REPLY System variable).
The fourth DO SET statement defines a local user variable named %%PREF using the %%$SUBSTR function to extract a prefix (the first three characters of the job name). This prefix is used in the following DO SHOUT statement to send a message to a specific TSO user.
The DO COND statement deletes a prerequisite condition in the IOA Conditions file. The prerequisite condition name is defined by an AutoEdit variable.
System Variables
Control-O System variables are predefined variables whose values are automatically updated and maintained by Control-O.
The System variable format is
%%$var
In this format, var is the name of the System variable.
Each AutoEdit System variable begins with "%%$". Each variable resolves to (is replaced by) the corresponding system value.
On the 12th of December, 2000
DO COMMAND=S BKPDISK,PARM='%%$RDATE'
resolves to
DO COMMAND=S BKPDISK,PARM='001212'
Supported Variables
This section describes the supported AutoEdit system variables.
Table 173 Commonly Used AutoEdit System Variables
Variable |
Description |
---|---|
%%$ASIS |
Whether to convert a message to uppercase before passing it to a rule. If you include this parameter in a rule, you must set it in the first DO statement of the rule.
To disable Control-O message uppercasing globally, you can use Optional Wish WO0976. |
%%$BFPH |
Whether the BFP hardware instruction set is present. Valid values are:
|
%%$CMD |
The text of the original (intercepted) command. When the Dealias feature is active, the value of the %%$CMD system variable is that of the command in its full format, even if it was entered as an alias. For example, if the system command D A was entered, the %%$CMD variable contains the value DISPLAY A. |
%%$CONSNAME |
The console name.
|
%%$CONSOLEID |
The console ID.
|
%%$CPUMODEL |
CPU model number |
%%$CTOVAR |
CTOVAR 28-characters module information |
%%$CTOVARMD |
CTOVAR 8-characters module modified level |
%%$CTOVARRL |
CTOVAR 9-characters module release |
%%$CVTBFP |
Whether Binary Floating Point is supported. Valid values are:
|
%%$CVTCMPSC |
Whether the MVS compression and expansion service is present. Valid values are:
|
%%$CVTCMPSH |
Whether CMPCS compression and expansion hardware instruction is present. Valid values are:
|
%%$CVTCRPTL |
Whether the encryption asymmetric feature is supported. Valid values are:
|
%%$CVTCSRSI |
Whether the CSRSI service is available. Valid values are:
|
%%$CVTCSRUN |
Whether the CSRUNIC callable service is available. Valid values are:
|
%%$CVTCSTR |
Whether the CSTRING facility is present on this system. Valid values are:
|
%%$CVTCUSE |
Whether the CUSE facility is present on this system. Valid values are:
|
%%$CVTDYAPF |
Whether dynamic APF, through CSVAPF, is present. Valid values are:
|
%%$CVTDYLPA |
Whether dynamic LPA (CSVDYLPA) is available. Valid values are:
|
%%$CVTDYNEX |
Whether CSVDYNEX for dynamic exits is present. Valid values are:
|
%%$CVTDYNL |
Whether dynamic LNKLST, using CSVDYNL, is present. Valid values are:
|
%%$CVTENCLV |
Whether the ENCLAVES function is present. Valid values are:
|
%%$CVTESAME |
Whether ESAME hardware is present. Valid values are:
|
%%$CVTGTFAV |
Whether GTF is active. Valid values are:
|
%%$CVTHIPER |
Whether Hiperspaces are supported. Valid values are:
|
%%$CVTILM |
Whether IBM License Manager ILM functions are present. Valid values are:
|
%%$CVTJESCT |
Primary subsystem name |
%%$CVTLPARC |
Whether LPAR clustering is present. Valid values are:
|
%%$CVTMDL |
CPU model number |
%%$CVTMVPG |
Whether MOVEPAGE capability is present on this system. Valid values are:
|
%%$CVTOSLVL |
16-characters system level indicators |
%%$CVTOVER |
Whether SUBPOOL override is supported. Valid values are:
|
%%$CVTPARMC |
Whether Logical Parmlib Service is available through IEFPRMLB. Valid values are:
|
%%$CVTPAUSE |
Whether Pause and Release services are present. Valid values are:
|
%%$CVTPPER2 |
Whether PER2 hardware is present on all CPUs. Valid values are:
|
%%$CVTPLO |
Whether PLO instruction is present. Valid values are:
|
%%$CVTPRDED |
Whether product enable and disable (IFAEDxxx) is present. Valid values are:
|
%%$CVTPRODI |
Product FMID identifier of the control program, such as JBB1328. |
%%$CVTRELNO |
Release number—usually 038. |
%%$CVTRSMWD |
Whether the storage manager window has been built. Valid values are:
|
%%$CVTRTLS |
Whether Runtime Library Services (CSVRTLS) are present. Valid values are:
|
%%$CVTSNAME |
System name for current system. |
%%$CVTSOPF |
Whether the suppression-on-protection hardware facility is present on this system. Valid values are:
|
%%$CVTSUBSP |
Whether the SUBSPACE utility, initialized by NIP, is present on this system. Valid values are:
|
%%$CVTUNICS |
Whether Unicode callable services are available. Valid values are:
|
%%$CVTWLM |
Whether workload manager is installed. Valid values are:
|
%%$DATE |
The current system date, in the format yymmdd. |
%%$DAY |
The current system day, in the format dd. |
%%$DBMAXRW |
Maximum number of rows in a database. |
%%$ECVTCLON |
1 or 2 character value used to identify a system within a Sysplex. Valid values are:
|
%%$ECVTGMOD |
GRS mode of operation. |
%%$ECVTHDNM |
Hardware name of the processor. |
%%$ECVTLOAD |
Edited MVS load parameter. |
%%$ECVTLPID |
8-character IBM product ID for ILM. |
%%$ECVTLPNM |
LPAR name of the processor configuration. If the processor is not in LPAR mode, the variable will be null. |
%%$ECVTLPUB |
8-character IBM Publisher ID for ILM. |
%%$ECVTLVID |
8-character IBM Version ID for ILM. |
%%$ECVTPIDN |
PID number. |
%%$ECVTPMOD |
Control product modify level. |
%%$ECVTPNAM |
16-character Control product name. |
%%$ECVTPOWN |
16-character Control product owner. |
%%$ECVTPREL |
Control product release. |
%%$ECVTPVER |
Control product version. |
%%$ECVTSPLX |
Sysplex name. |
%%$ECVTVMNM |
VM user ID of the virtual computer, of which this MVS image is a guest. This field is blank if the processor is not a guest under VM. |
%%$GRSMODE |
GRS mode of operation. |
%%$HARDWARE |
Hardware name of the processor. |
%%$JESJOBNM |
For JES2 job-related messages, this variable resolves to the job ID of the related job (eight characters in the format JOBnnnnn). The value is taken from the WQEJOBNM field in the IHAWQE block associated with the message. This variable is available for the ON MESSAGE, ON STRING, ON JOBARRIV, and ON JOBEND message-type rules. |
%%$JNAME |
The name of the job that issued the message or command. This system variable contains the same value as %%$JOBNAME. |
%%$JOBACCT |
The account information of the job that issued the message or command. |
%%$JOBID |
The JES ID of the job that issued the message or command. |
%%$JOBNAME |
The name of the job that issued the message or command. This system variable contains the same value as %%$JNAME. |
%%$JOBTYPE |
The job type associated with the job that issued the message. Valid values are:
|
%%$JULDAY |
The current system day, in the format jjj. |
%%$LENGTH var |
The length of the var variable. |
%%$LINES |
The line counter for multiline messages and messages intercepted in command-response mode. Multiline messages are messages that consist of one primary line followed by at least one secondary line.
For information regarding these two types of processing, see the %%$M* and %%$Mn variables in this table. The maximum value for the %%$LINES variable is 10. If a command response contains more than ten lines, the variable resolves to 10. |
%%$LPARMNAME |
LPAR name of the processor configuration. This field is blank if the processor is not in LPAR mode. |
%%$M* |
For multiline messages and messages intercepted in command-response mode. Multiline messages are messages that consist of one primary line followed by at least one secondary line. When this system variable is specified in a rule, Control-O processes the message line by line, and all DO statements in the rule are executed repeatedly on each new line of the message. A %%$M* variable in a DO statement resolves to the text of the current line of the message. Therefore, %%$M* can resolve an unlimited number of message lines. This variable is useful for handling a message with an unknown number of lines, or where the information to be resolved does not occur in any one specific line. For more information, see "Command-Response Mode" in General Information, andDO ENDMSG: Automated Console Action Parameter |
%%$Mn |
For multiline messages and messages intercepted in command-response mode. Multiline messages are messages that consist of one primary line followed by at least one secondary line. Specifies the nth line of the original message text after the primary message line, where n is a number from 1 through 10. For example, %%$M1 resolves to the message text contained in the first secondary line. For more information, see "Command-Response Mode" in General Information, andDO ENDMSG: Automated Console Action Parameter |
%%$MONTH |
The current system month, in the format mm. |
%%$MSG |
The text of the original message (the primary line only for multiline messages). |
%%$MULTIFLG |
The multiline message flag. Valid values are:
|
%%$MVSUSER |
VM user ID of the virtual computer, of which this MVS image is a guest. This field is blank if the processor is not a guest under VM. |
%%$NULL |
A null variable. |
%%$PRISUBNM |
Primary subsystem name. |
%%$REPLY |
The reply number of the last WTOR message detected by the rule. |
%%$RPLYTXT |
The text of the reply to a DO ASKOPER statement. |
%%$SMSLEVEL |
SMS level. |
%%$SSNAME |
The name of the Control-O subsystem. |
%%$SYSFMID |
Product FMID identifier for the control program, such as JBB1328. |
%%$SYSPLEX |
Sysplex name. |
%%$SYSTEMNM |
System name for the current system |
%%$TIME |
The time of day, in the format hhmmss. |
%%$TSOLEVEL |
TSO level. |
%%$UNDEF |
An undefined variable. This variable can be used to
|
%%$USERID |
The security package user ID of the job, started task, or TSO under which the rule is executing. |
%%$Vn |
The nth word in the original message or command text, where n is a value from 1 through 99. A comma or a blank can serve as a delimiter. |
%%$WAITRC |
The return code of the event that caused the end of a DO WAIT, or a DO COMMAND with a WAITMODE value of YES. For more information, see DO WAIT: Automated Console Action Parameter. |
%%$WDAY |
The current Gregorian day of the week in the format d, where d is from 1 through 6 or 0. For example, 1=Sunday, 2=Monday, ... 6= Friday, 0=Saturday. The start of the week depends on installation parameters specifying whether 1=Sunday or 1=Monday. Contact your INCONTROL administrator for your site standard. All references assume 1=Sunday, 2=Monday, and so on. |
%%$Wnvarname |
The nth word of the varname variable, where n is a value from 1 through 99. A comma or a blank can serve as a delimiter. For example, %%$W3 %%$MSG represents the third word in the original message text. |
%%$WORDS varname |
The number of words in the varname variable. A comma or a blank can serve as a delimiter within the variable. |
%%$YEAR |
The current system year, in the format yy. |
Table 174 1-byte autoedit system variables
Variable |
Description |
---|---|
%%Dn |
the Nth qualifier of the data set name triggering the ON DSNEVENT rule. |
%%Mn |
For multiline messages and messages intercepted in command-response mode. Multiline messages are messages that consist of one primary line followed by at least one secondary line. |
%%Vn |
The Nth word in the original message or command text, where N is a value from 1 through 99. A comma or blank erve as a delimiter. |
%%Wn |
The Nth word of the varname variable, where N is a value from 1 through 99. A comma or blank erve as a delimiter. BMC does not recommend using %%An because you might confuse the variable with the KSL %An system variable. |
Table 175 Global AutoEdit System Variables
Variable |
Description |
---|---|
%%$AUTOSYS |
The default system in the Sysplex from which TYPE 1 XAE database variables are retrieved. |
%%$DBCOUNT |
The number of rows in the current global variable pool (the variable group loaded in memory), if the current pool is an AutoEdit variable database or an XAE database. |
%%$DBMAXRW |
The maximum number of rows in a database. |
%%$DBROW |
The current row in the current global variable pool, if the current pool is an AutoEdit variable database. |
%%$GLOBAL |
The name of the global pool to be accessed. Global pools contain Global variables and their values. One global pool ($GLOBAL) is defined as the default, but multiple global pools can be defined. Unless a global pool is specified using a %%$GLOBAL parameter, the default $GLOBAL member is used. After a pool is specified using a %%$GLOBAL parameter, that member remains assigned until a different pool is specified using another %%$GLOBAL parameter. To respecify the default, use this parameter to specify the $GLOBAL member. For more information, see DO SET: Automated Console Action Parameter, and see the description of Global AutoEdit variables in the INCONTROL for z/OS Administrator Guide. Copy
|
%%$POOLCOSMOS |
Described in %%$POOLCOSMOS |
%%$POOLSTORE |
Described in %%$POOLSTORE. |
%%$POOLTYPE |
Described in %%$POOLTYPE. |
%%$RESOLVE |
Described in %%$RESOLVE. |
%%$SYSPCPU |
The ordinal sequence number of the Sysplex-connected system with the name that will be accessed by the next resolution of %%SYSPCPUNAME (described in this table). |
%%SYSPCPUCOUNT |
The number of additional Control-O systems in the Sysplex that are connected to XAE structures.
|
%%SYSPCPUNAME |
The system name of a Sysplex participant. The system name that is returned is determined by the %%$SYSPCPU parameter, as described in this table. Each Sysplex-connected system on which Control-O runs the XAE facility is dynamically assigned an ordinal sequence number. %%$SYSPCPU specifies the sequence number of the system whose name is to be retrieved by the next resolution of %%SYSPCPUNAME. If the sequence number is greater than the total number of systems connected in a Sysplex, the literal value END is returned by %%SYSPCPUNAME in place of the system name. |
Table 176 Command AutoEdit System Variables
Variable |
Description |
---|---|
%%$CMD |
The text of the original (intercepted) command. When the Dealias feature is active, the value of the %%$CMD system variable is that of the command in its full format, even if it was entered as an alias. For example, if the system command D A was entered, the %%$CMD variable contains the value DISPLAY A. |
%%$CONSNAME |
The console name.
|
%%$CONSOLEID |
The console ID.
|
%%$DATE |
The current system date, in the format yymmdd. |
%%$DAY |
The current system day, in the format dd. |
%%$JNAME |
The name of the job that issued the message or command. This system variable contains the same value as %%$JOBNAME. |
%%$JOBID |
The JES ID of the job that issued the message or command. |
%%$JOBNAME |
The name of the job that issued the message or command. This system variable contains the same value as %%$JNAME. |
%%$JOBTYPE |
The job type associated with the job that issued the message. Valid values are:
|
%%$JULDAY |
The current system day, in the format jjj. |
%%$LENGTH variable |
The length of the var variable. |
%%$MONTH |
The current system month, in the format mm. |
%%$TIME |
The time of day, in the format hhmmss. |
%%$USERID |
The security package user ID of the job, started task, or TSO under which the rule is executing. |
%%$Vn |
The nth word in the original message or command text, where n is a value from 1 through 99. A comma or a blank can serve as a delimiter. |
%%$WAITRC |
The return code of the event that caused the end of a DO WAIT, or a DO COMMAND with a WAITMODE value of YES. For more information, see DO WAIT: Automated Console Action Parameter. |
%%$WDAY |
The current Gregorian day of the week in the format d, where d is from 1 through 6 or 0. For example, 1=Sunday, 2=Monday, ... 6= Friday, 0=Saturday. The start of the week depends on installation parameters specifying whether 1=Sunday or 1=Monday. Contact your INCONTROL administrator for your site standard. All references assume 1=Sunday, 2=Monday, and so on. |
%%$Wnvarname |
The nth word of the varname variable, where n is a value from 1 through 99. A comma or a blank can serve as a delimiter. For example, %%$W3 %%$MSG represents the third word in the original message text. |
%%$WORDS varname |
The number of words in the varname variable. A comma or a blank can serve as a delimiter within the variable. |
%%$YEAR |
The current system year, in the format yy. |
Table 177 Control-M AutoEdit System Variables
Variable |
Description |
---|---|
%%$CTMHLDSTATUS |
The job Held/Free status. |
%%$CTMJGROUP |
The job group. |
%%$CTMJJOBID |
The job ID. |
%%$CTMJJOBNAME |
The job name. |
%%$CTMJJOWNER |
The job owner. |
%%$CTMJLIBRARY |
The name of the job schedule library. Values for the variables from %%$CTMJMEMNAME through %%$CTMJTYPE are returned by the Control-M interface. These values are taken from the current job entry in the Active Jobs file. The current job entry is set using the %%$CTMLINE# reserved user-defined variable, which is described in this table. For more information, see Reserved User-Defined Variables. |
%%$CTMJMEMNAME |
The job member name. |
%%$CTMJODATE |
The job ODATE. |
%%$CTMJORDERID |
The job order ID. |
%%$CTMJRBA |
The job RBA in the Active Jobs file. |
%%$CTMJSTATUS |
The job status. Valid values are:
|
%%$CTMJTABLE |
The name of the job schedule table. |
%%$CTMJTYPE |
The job type. |
%%$CTMLINE# |
The current line, or job entry, in the Active Jobs file from which values are returned by the Control-M interface. |
%%$CTMLINES |
The number of lines of response returned by the Control-M interface. |
%%$CTMRC |
The return code from the Control-M interface. Valid values are:
|
%%$CTMRESCURR |
The currently used quantity of the Control-M resource. |
%%$CTMRESMAX |
The maximum available quantity of the Control-M resource. |
%%$CTMRESPRI |
The priority of the Control-M resource when the jobs requesting it are part of the critical path. |
Table 178 Control-O AutoEdit System Variables
Variable |
Description |
---|---|
%% |
The concatenation character. |
%%$ARGS |
The argument string passed by a calling rule, through its DO RULE statement, to an invoked rule. |
%%$ASKRC |
The return code of the event that caused the end of a DO ASKOPER wait. |
%%$AUTOLOG |
The recording mode for the currently handled message or command. Valid values are:
For more information, see DO SET: Automated Console Action Parameter, and see the discussion about preventing logging of unnecessary messages in the INCONTROL for z/OS Administrator Guide. Copy
|
%%$AUTOSYS |
The default system in the Sysplex from which TYPE 1 XAE database variables are retrieved. |
%%$BLANK |
Resolves to one blank. |
%%$BLANKn |
Resolves to n blanks, where n is a number from 1 through 99. |
%%$COMMSYS |
The system communication name or the Control-O system name (CTOGATE name).
The DO statements are distributed by Sysplex or CTOGATE communication. |
UNIX Server for z/OS Resource Monitor System Variables
Table 189 is a list of the UNIX Server for z/OS Monitor system variables that are supplied by Control-O.
Table 189 Unix Server for z/OS System Variables
Variable |
Description |
---|---|
%%$RMONCPUTIME |
Total CPU time spent in kernel, in hundredths of a second. |
%%$RMONOVRIPCMSGNIDS |
Number of attempts to exceed the maximum number of message queue IDs. |
%%$RMONOVRIPCSEMNIDS |
Number of attempts to exceed the maximum number of semaphore IDs. |
%%$RMONOVRIPCSHMNIDS |
Number of attempts to exceed the maximum number of shared memory IDs. |
%%$RMONOVRIPCSHMSPGS |
Number of attempts to exceed the maximum number of shared memory pages for all segments. |
%%$RMONOVRMMAPAREA |
Number of attempts to exceed the maximum number of mmap storage pages. |
%%$RMONOVRPROC |
Number of times the maximum number of processes was exceeded. |
%%$RMONOVRPRUID |
Number of times the maximum number of processes per UID was exceeded. |
%%$RMONOVRSHRPAGES |
Number of attempts to exceed the maximum number of shared storage pages. |
%%$RMONOVRUID |
Number of times the maximum number of active UIDs was exceeded. |
%%$RMONMAXIPCMSGNIDS |
Maximum number of message queue IDs. |
%%$RMONMAXIPCSEMNIDS |
Maximum number of semaphore IDs. |
%%$RMONMAXIPCSHMNIDS |
Maximum number of shared memory IDs. |
%%$RMONMAXIPCSHMSPGS |
Maximum number of shared memory pages for all segments. |
%%$RMONMAXMMAPAREA |
Maximum number of mmap storage pages. |
%%$RMONMAXPROC |
Maximum number of processes. |
%%$RMONMAXPRUID |
Maximum number of processes per UID. |
%%$RMONMAXSHRPAGES |
Maximum number of shared storage pages as specified by BPXPRMXX parmlib statement MAXSHAREPAGES. |
%%$RMONMAXUID |
Maximum number of active UIDs. |
%%$RMONNUMIPCMSGNIDS |
Current number of message queue IDs. |
%%$RMONNUMIPCSEMNIDS |
Current number of semaphore IDs. |
%%$RMONNUMIPCSHMNIDS |
Current number of shared memory IDs. |
%%$RMONNUMIPCSHMSPGS |
Current number of shared memory pages for all segments. |
%%$RMONNUMMMAPPAGES |
Current number of mmap storage pages (in use). |
%%$RMONNUMPROC |
Current number of processes. |
%%$RMONNUMSHRPAGES |
Current number of shared storage pages. |
%%$RMONNUMUID |
Current number of active UIDs. |
%%$RMONSYSCALLS |
Total number of system calls. This includes system calls done internally by the kernel. It does not include trivial system calls. |
Rule Stack Variables
A Control-O rule can trigger other Control-O rules through DO RULE statements. When a series of Control-O rules trigger each other they are referred to collectively as a Rule Stack. Control-O rules can be stacked up to 20 deep.
The variables listed below can be included in a Control-O rule to determine information about the Rule Stack of the rule.
Some of these variable names must be supplied with a numerator, where 0 indicates the first rule in a stack, 1 is the rule triggered by the first rule in the stack (that is, the second rule in the stack), and so on.
These variables are intended primarily for use during debugging operations.
Table 190 Rule Stack Variables
Variable |
Description |
---|---|
%%$ODATE n |
Date when the rule table containing the nth rule in the Rule Stack was ordered. Do not confuse this variable with %%$RDATE, which is the installation current working day. |
%%$OTIME n |
Time when the rule table containing the nth rule in the Rule Stack was ordered. |
%%$RULELIBRARY n |
Name of the rule library containing the nth rule in the Rule Stack. |
%%$RULETABLE n |
Name of the rule table containing the nth rule in the Rule Stack. |
%%$RULENAME n |
Name of the nth rule in the Rule Stack. |
%%$RULELEVEL |
Level of the current rule in the Rule Stack. |
%%$RULCREATOR n |
The creator of the nth rule in the Rule Stack. |
%%$RULCRTDATE n |
The date that the nth rule in the Rule Stack was created. |
%%$RULCRTTIME n |
The time that the nth rule in the Rule Stack was created. |
%%$RULDESC n |
The first line of the DESCRIPTION for the nth rule in the Rule Stack. |
%%$RULGRP n |
The GROUP name of the nth rule in the Rule Stack. |
%%$RULMODE n |
The current MODE of the nth rule in the Rule Stack. |
%%$RULMODEO n |
The original MODE of the nth rule in the Rule Stack. |
%%$RULOWNER n |
The OWNER of the nth rule in the Rule Stack. |
%%$RULPRIO n |
The PRIORITY of the nth rule in the Rule Stack. |
%%$RULRELEAS n |
The Control-O release when the nth rule in the Rule Stack Stack was last updated. |
%%$RULSEARCH n |
The SEARCH value of the nth rule in the Rule Stack. |
%%$RULTHRESHOLD n |
The THRESHOLD value of the nth rule in the Rule Stack. |
%%$RULTHRSMAX n |
The number of times the rule reached the THRESHOLD value of the nth rule in the Rule Stack. |
%%$RULTHRSNOW n |
The current THRESHOLD value of the nth rule in the Rule Stack. |
%%$RULUPDATETOR n |
The updater of the nth rule in the Rule Stack. |
%%$RULUPDDATE n |
The date that the nth rule in the Rule Stack was last updated. |
%%$RULUPDTIME n |
The time that the nth rule in the Rule Stack was last updated. |
%%$RULVERSION n |
The rule version of the nth rule in the Rule Stack. |
%%$TDATE n |
Date when the rule table containing the nth rule in the Rule Stack was ordered. Do not confuse this variable with %%$RDATE, which is the installation current working day. |
%%$TTIME n |
Time when the rule table containing the nth rule in the Rule Stack was ordered. |
The values of %%$RULTHRESHOLD, %%$RULTHRSMAX, and %%$RULTHRSNOW are updated when the rule ends successfully.
-
If %%$RULELEVEL = 0, the current rule was triggered by an event, and not by another rule.
-
If %%$RULELEVEL = 1, the current rule was called by a DO RULE statement in a level0 rule.
User-Defined Variables
User-defined variables can be defined to provide additional flexibility for Control-O rules. You can define your own symbols, assign values to them, and they will automatically be resolved in DO statements, ON and IN statements. DO statements are resolved during rule execution. AutoEdit symbols in ON statements and IN condition names are resolved during rule ordering.
User-defined AutoEdit variables used in ON statements and IN statements must be defined as Global.
When Control-O identifies a string that starts with %%, the string is assumed to be an AutoEdit variable or instruction. If the string is a reserved AutoEdit variable or a Control-O System variable, it is interpreted as such. Otherwise the string is assumed to be a user-defined variable.
DO actions within a rule are performed sequentially. If a user-defined variable in a DO statement is not completely resolved, the default action is to cancel the DO statement and all subsequent DO statements of the rule (for the current activation). This default can be overridden by using the %%$RESOLVE NO control statement in a prior DO SET statement. For a description of the %%$RESOLVE statement format, see %%$RESOLVE. In this case, Control-O resolves the symbol as far as possible and then performs the DO statements in which it is found.
Global Variables
Global variables are user-defined variables that can be used to share information between different features of Control-O. These variables can also be referenced by other INCONTROL products active at your site. A primary usage of the Global variables is to set globally accessed flags or counters (such as the current IMS reply number).
Global variables are contained in the Global AutoEdit library and in AutoEdit variable databases. Global variables are loaded when Control-O is started. For more information on the Global AutoEdit library see the Control-O chapter in the INCONTROL for z/OS Administrator Guide. For more information on AutoEdit variable databases see IOA Variables Database Facility.
XAE databases can be used for sharing variables across the Sysplex. XAE databases are defined and administered by the INCONTROL administrator. For more information, see Using an XAE AutoEdit Variable Database.
Reserved User-Defined Variables
Some user-defined variables are reserved by, and have a special meaning for, Control-O. The values of most reserved variables are tested by Control-O before performing specific DO statements, in order to establish the processing mode and the processing parameters of the DO statements.
Reserved variables, like other user-defined variables, are set by a DO SET statement, and then resolved automatically when they appear in other DO statements. They are never Global variables.
Table 191 shows the reserved user-defined variables are available.
Table 191 Reserved User-Defined Variables
Variable |
Description |
---|---|
%%$AUTOLOG |
The recording mode for the currently handled message or command.
For more information, see DO SET: Automated Console Action Parameter, and see the description of preventing the logging of unnecessary messages in the INCONTROL for z/OS Administrator Guide. Copy
|
%%$AUTOSYS |
The default system in the Sysplex from which TYPE 1 XAE database variables are retrieved. |
%%$COMMSYS |
The system communication name or the Control-O system name (CTOGATE name).
The DO statements are distributed by Sysplex or CTOGATE communication. For more information, see Performing an Action on Another System Copy
|
%%$CTMLINE# |
The current line, or job entry, in the Active Jobs file from which values are returned by the Control-M interface. |
%%$DBROW |
The current row in the current global variable pool, if the current pool is an AutoEdit variable database. |
%%$DOLIMIT |
The maximum number of DO actions that can be performed during execution of the current Control-O rule. Valid values are:
If %%$DOLIMIT is not specified in a Control-O rule, the rule is allowed to execute a maximum of 10,000 DO actions. To allow the current rule to execute a maximum of 500 DO actions, specify the following: Copy
|
%%$GLOBAL |
The name of the global pool to be accessed. Global pools contain Global variables and their values. One global pool ($GLOBAL) is defined as the default, but multiple global pools can be defined. Unless a global pool is specified using a %%$GLOBAL parameter, the default $GLOBAL member is used. After a pool is specified using a %%$GLOBAL parameter, that member remains assigned until a different pool is specified using another %%$GLOBAL parameter. To respecify the default, use this parameter to specify the $GLOBAL member. For more information, see DO SET: Automated Console Action Parameter, and see the description of Global AutoEdit variables in the INCONTROL for z/OS Administrator Guide. Copy
|
%%$RESPMSG |
IDs of messages expected in response to the DO COMMAND statement that follows the DO SET %%$RESPMSG statement. This variable is supported for historical reasons. Copy
|
%%$RJOBID |
The ID of the job associated with DO COND, DO FORCEJOB, and DO RESOURCE requests. When specified, the value overrides the default job ID. If this variable is set, you should also set the %%$RJOBNAME reserved user-defined variable. For an example of usage, see the %%$RJOBNAME variable in this table. |
The name of the job associated with DO COND, DO FORCEJOB, and DO RESOURCE requests. When specified, the value overrides the default job name. If this variable is set, you should also set the %%$RJOBID variable, described in this table. The IAT5210 JES3 tape mount message is issued under the address space of JES3, and Control-O sets the default job name to JES3. To associate the correct job, which mounts the tape, with the DO RESOURCE request, the job name and job ID are extracted from the text of the message, as follows: Copy
|
|
%%$STATID |
The message ID under which the statistics for a message should be accumulated. This variable can be used to combine the statistics of messages with individual statistics that are not required. This eliminates unnecessary messages from the Message Statistics screen. To combine the statistics for all messages with the prefix CKH into one general statistics item under the identifier CKHMSG, specify the following: Copy
|
%%$SYSPCPU |
The ordinal sequence number of the Sysplex-connected system with the name that will be accessed by the next resolution of %%SYSPCPUNAME. For information on %%SYSPCPUNAME, see "%%SYSPCPUNAME" in Supported Variables. |
%%$TIMEOUT |
The time, in seconds, to wait for one of the following:
The following formats are possible:
This variable is supported for historical reasons. |
%%$WAITKSL |
Whether a Control-O rule waits for the KeyStroke OpenAccess (KOA) script to complete so that it can check return codes or Global variables set by the script and proceed accordingly. Valid values are:
The value of %%$WAITKSL is automatically reset to NO after the completion of the KOA script. Copy
This variable is supported for historical reasons. For more information, seeDO KSL: Automated Console Action Parameter. |
%%$WAITRESP |
Whether Control-O retrieves, in the same rule, all messages issued in response to an operator command. Valid values are:
The value of %%$WAITRESP is automatically reset to NO after all response messages have been intercepted. Copy
This variable is supported for historical reasons. For more information, see DO COMMAND: Automated Console Action Parameter. |
%%$WAITTSO |
Whether a Control-O rule waits for the completion of the TSO command, CLIST, or REXX procedure so that it can check return codes or Global variables set by the command and proceed accordingly. Valid values are:
The value of %%$WAITTSO is automatically reset to NO after the completion of the TSO command, CLIST, or REXX procedure. Copy
This variable is supported for historical reasons. For more information, see DO TSO: Automated Console Action Parameter. |
Rules of Variable Substitution
A User-defined variable name must conform to the following rules. It must
-
begin with "%%" (percent sign, percent sign)
-
be composed of letters, digits, and the following characters: "@" (at sign), "#" (number sign), "$" (dollar sign), and "_" (underscore)
-
have a maximum of 163 characters
-
not begin with
-
%%$ (percent sign, percent sign, dollar sign)
-
%%@ (percent sign, percent sign, at sign)
-
%%# (percent sign, percent sign, number sign)
Variables that begin with these strings are either system variables or reserved user-defined variables.
-
Lowercase characters are not translated to uppercase characters upon resolution.
Variables are substituted sequentially from right to left, until the symbol is assigned a value. For example
%%SMF_TAPE_%%$DAY,
resolves on the third of the month to
%%SMF_TAPE_03,
Control-O then tries to resolve the symbol %%SMF_TAPE_03. Assuming the value of the symbol in the Global environment is EE1022, the result is
EE1022
To concatenate two symbols, separate them with a period. Before AutoEdit variables are concatenated, trailing blanks are eliminated. For example
%%$DAY.%%$MONTH
resolves on the 3rd of December to
0312
%%$DAY%%$MONTH (written without a period) partially resolves to User-defined variable %%$DAY12, which must be fully resolved.
To put a period between two symbols, use two consecutive periods. For example
%%$DAY..%%$MONTH
resolves on the 3rd of December to
03.12
To concatenate a symbol and a constant, use %%. (concatenation symbol). For example
A91%%$DAY%%.UP
resolves on the 3rd of December to
A9103UP
Resolution of A91%%DAYUP would require a search for the %%DAYUP symbol.
When Control-O assigns a value to a variable, Control-O ignores leading and trailing spaces. For example, the statement
DO SET=%%X = FRIDAY RUN
assigns the value "FRIDAY RUN" to the %%X variable, regardless of how many spaces you type before or after "FRIDAY RUN."
To assign a value with leading or trailing spaces, use the %%$BLANK system variable. For example, the statement
DO SET=%%X=%%$BLANK.FRIDAY RUN
assigns the value "FRIDAY RUN" (with a leading space) to the %%X variable. Be sure to include the "." concatenation operator between "%%$BLANK" and "FRIDAY RUN." Without the "." Control-O would look for a variable called "%%$BLANKFRIDAY."
Assigning AutoEdit Variables
Values can be set to user-defined variables by either of the following methods:
-
using a DO SET statement
-
using an AutoEdit variable database
These methods are described below.
Using the DO SET Statement
The DO SET statement is used to set values to user-defined variables, or to specify AutoEdit control statements. The format of the DO SET statement is
DO SET=%%var = value
or
DO SET=%%var = valid_expression
or
DO SET=AutoEdit Control-statements
%%var must be a valid user-defined AutoEdit variable.
Control-O attempts to resolve the variable to a single value by processing it from right to left. For example
DO SET=%%BACKUP_UNIT_%%$WDAY = EE%%$MONTH.%%$DAY
On Sunday the 24th of September, the user-defined symbol %%BACKUP_UNIT_1 is assigned the value EE0924.
If the symbol assigned in the DO SET statement is not completely resolved, the default action is to cancel the DO SET action and the subsequent DO actions of the current rule activation. This default can be overridden by using the %%$RESOLVE NO control statement in a previous DO SET statement, in which case the symbol is resolved as far as possible before performing the DO statement in which it is found. For more information, see %%$RESOLVE.
When rule (DO parameter) activation is canceled, a message is sent to the IOA Log.
All variable assignments remain valid during the activation of that specific rule and will not affect other rules unless you set GLOBAL to Y.
When Control-O tries to resolve a symbol, it searches for the value according to the following order:
-
AutoEdit System variables
-
AutoEdit reserved words (control statements)
-
user-defined variables (Local)
-
user-defined variables (Global)
A Global AutoEdit variable that is referred to as %%variable resides in the default global member (usually $GLOBAL).
A Global AutoEdit variable can be assigned to a specific global member by referring to it as follows:
%%member\variable
For an explanation of Global assignments, see DO SET: Automated Console Action Parameter.
The maximum number that can be handled by mathematical AutoEdit operations is 231 - 1, (that is, 2147483647).
Using an AutoEdit Variable Database
To assign a value to a variable in an AutoEdit variable database:
-
Specify the variable database as the current global variable pool using the %%$GLOBAL system variable.
-
Specify the appropriate row through the %%$DBROW reserved user-defined variable.
-
Set the variable by a DO SET statement as follows:
CopyDO SET %%colname = val
In this statement
-
colname is the name of the column where the variable exists
-
val is the value to be assigned to the variable
The following sample set of DO statements accomplishes the steps described above.
CopyDO SET=%%$GLOBAL = MYDB GLOBAL N
DO SET=%%$DBROW = 3 GLOBAL N
DO SET=%%COLNAME = NEWVALUE GLOBAL YWHILE and ENDWHILE statements can be used to loop through variables in a column of a table. For more information, see DO SET: Automated Console Action Parameter.
-
Using an XAE AutoEdit Variable Database
XAE database variable values are different in scope than other database variables. They can be accessed by rules on every system in a Sysplex XAE AutoEdit databases are defined by the administrator.
Values for XAE database variables are set using the same methods as used for other AutoEdit variables. Similarly, they can be defined using the Variable Database Definition facility and can be changed using a DO SET command.
There are two types of XAE databases:
-
TYPE 1
-
TYPE 2
Type 1 XAE databases
The Type 1 XAE database is composed of variable values maintained by the Sysplex partners. Each system updates its own variables in ECSA (Extended Common Service Area, a common memory area in that system), and in the Coupling Facility. Each system resolves TYPE 1 variables from its own ECSA, but other systems can access these values using the mirror copy of the variables stored in the Coupling Facility.
Resolving an XAE Type 1 database variable value on a current (default) system is the same as for standard databases. For resolutions of the rule from other systems, the default system name is obtained based on the last value set to the %%$AUTOSYS user-defined system variable.
Type 2 XAE databases
In Type 2 XAE databases, all systems participating in a Sysplex share the same view of the database. If one system updates a variable, that variable is updated in the view that is accessible by each of the other systems in the Sysplex. Resolving an XAE Type 2 database variable is the same as for a standard database, except that more than one system can update the same variable. For example, if system A updates a database variable and then system B attempts to resolve that same variable in a statement, the value of the variable accessed by system B is the value as updated by system A.
Resolution of an XAE AutoEdit expression is synchronous with the execution of the rule.
This example demonstrates a new syntax expression that can be written to resolve variables in XAE Type 1 databases located in a different system.
This expression is %%systemname\poolname\variable(column)name.
Figure 245 Using an XAE AutoEdit Variable Database - Example 1
/*/* SHOUT A VAR WITH STYLE %%SYSTEMNAME\POOLNAME\VARIABLE
/*
DO SHOUT = TO OPER URGENCY R SYSTEM CTO282I
MESSAGE XES XAES1D01 SHOUTING A VARIABLE WITH STYLE SYSTEM\POOL\VAR
/* SET THE ROW NUMBER TO 2
DO SET = %%$DBROW = 2 GLOBAL N
/* THIS STATEMENT CHANGES THE DEFAULT CPU TO OS33
DO SHOUT = TO OPER URGENCY R SYSTEM CTO282I
MESSAGE OS33\XAES1D01\S1D01C01 = %%MYSYS\MYDB\MYCOL
/*
By setting %%$AUTOSYS to OS35, the XAE Type 1 database variables are resolved by values retrieved from the OS35 system (although the default executing system is, for example, OS33).
Figure 246 Using an XAE AutoEdit Variable Database - Example 2
/*/* SHOUT FROM CPU OS33 THE DATABASE CONTENTS FOR OS35
/*
DO SHOUT = TO OPER URGENCY R SYSTEM CTO282I
MESSAGE XES XAES1D01 OS33 SHOUTING DATABASE IN OS35
DO SET = %%I = 0 GLOBAL N
DO SET = %%X = %%$DBCOUNT GLOBAL N
/* CHANGING THE DEFAULT SYSTEM TO OS35
DO SET = %%$AUTOSYS = OS35 GLOBAL N
WHILE %%I LT# %%X
DO SET = %%I = %%I %%$PLUS 1 GLOBAL N
DO SET = %%$DBROW = %%I GLOBAL N
DO SHOUT = TO OPER URGENCY R SYSTEM CTO282I
MESSAGE S1D01C01-5 = %%S1D01C01 %%S1D01C02 %%S1D01C03 %%S1D01C04 %%S1D01C05
ENDWHILE
DO SET = %%X = %%$DBCOUNT GLOBAL N
/* CHANGING THE DEFAULT SYSTEM BACK TO OS33
DO SET = %%$AUTOSYS = OS33 GLOBAL N
/*
%%$SYSPCPUCOUNT, %%$SYSPCPU, and %%$SYSPCPUNAME are used to enable the browsing of the XAE Type 1 database contents in the other systems. An outer loop is performed for each system; the inner loop displays the content of the database variables of that system.
Figure 247 Using an XAE AutoEdit Variable Database - Example 3
/*/* SHOUT ALL THE VARIABLES IN ALL PARTNER SYSTEMS
/*
/* OUTER LOOP
/*
DO SET = %%Y = 0 GLOBAL N
WHILE %%Y LT# %%$SYSPCPUCOUNT
DO SET = %%Y = %%Y %%$PLUS 1 GLOBAL N
/* EXTRACT THE NAME OF NEXT SYSTEM AND SET AS DEFAULT
DO SET = %%$SYSPCPU = %%Y GLOBAL N
DO SET = %%SYST = %%$SYSPCPUNAME GLOBAL N
DO SET = %%$AUTOSYS = %%SYST GLOBAL N
DO SHOUT = TO OPER URGENCY R SYSTEM CTO282I
MESSAGE XES XAES1D01 OS33 SHOUTING DATABASE IN SYSTEM # %%Y (%%SYST)
/*
/* INNER LOOP
/*
DO SET = %%I = 0 GLOBAL N
DO SET = %%X = %%$DBCOUNT GLOBAL N
WHILE %%I LT# %%X
DO SET = %%I = %%I %%$PLUS 1 GLOBAL N
DO SET = %%$DBROW = %%I GLOBAL N
DO SHOUT = TO OPER URGENCY R SYSTEM CTO282I
/* DISPLAY THE VARIABLE (COLUMN NAME)
MESSAGE S1D01C01-5 = %%S1D01C01 %%S1D01C02 %%S1D01C03 %%S1D01C04 %%S1D01C05
ENDWHILE
ENDWHILE
/* RESTORE TO DEFAULT SYSTEM
DO SET = %%$AUTOSYS = %%$SYSTEMNM GLOBAL N
AutoEdit Operators
Within a DO SET statement, AutoEdit operators can be used together with AutoEdit variables. Valid AutoEdit operators are shown in Table 192.
Table 192 AutoEdit Operators
Operator |
Description |
---|---|
%%$PLUS |
The operator that adds two operands. |
%%$MINUS |
The operator that subtracts one operand from another operand. |
%%$TIMES |
The operator that multiplies one operand by another operand. |
%%$DIV |
The operator that divides one operand by another operand. |
Negative numbers are not recognized by AutoEdit operators. The maximum number that can be handled by mathematical AutoEdit operations is 2,147,483,647 (that is, 231 – 1).
The format for use of AutoEdit symbols and operators is
operand operator operand
Only one operator may be used in each AutoEdit expression.
Operands must be resolved into numeric constants. The final result is translated into a character string. For example:
DO SET=%%NUMBER_OF_ABENDS_%%$RDATE = %%NUMBER_OF_ABENDS%%$RDATE %%$PLUS 1
On installation working date November 03, 2000 the symbol %%NUMBER_OF_ABENDS_001103 will contain the number of abends that occurred in the data center, during the working day.
Control Statements
The following AutoEdit Control Statements can be specified in a DO SET statement.
%%$MLLEND
When a rule is in command-response mode, that is, when WAITMODE=Y is specified in a DO COMMAND statement, Control-O suspends rule execution until either the specified time-out is reached, or a "last" line (that is, the last line of a multiline message) is detected.
Some command responses can contain more than one "last" line, for example, if the response contains more than one multiline message. In such cases Control-O normally exits command-response mode when it detects the first "last" line. To avoid this problem, a %%$MLLEND statement can be used to disable the search for a "last" line, in this way causing the rule to remain in command-response mode until the specified time-out is reached. The time-out is specified in the TIMEOUT subparameter in the DO COMMAND statement.
Valid %%$MLLEND control statements are shown in Table 193.
Table 193 %%$MLLEND Control Statements
Statement |
Description |
---|---|
%%$MLLEND NO |
Disable the search for the last line of the message. Rule execution will not exit command-response mode until the time-out specified in the DO COMMAND statement is reached. The search for the last line remains disabled until the end of the execution of the rule (that is, for subsequent DO COMMAND statements in the same rule), or until DO SET %%$MLLEND YES is specified. If %%$MLLEND NO is specified the value of system variable %%WAITRC is always 522 (ended due to time-out). |
%%$MLLEND YES |
Enable the search for the last line of the message. This control statement is only necessary if the search is to be re-enabled in a rule in which the search was disabled. |
For more information, see DO COMMAND: Automated Console Action Parameter.
Figure 248 %%$MLLEND Control Statement Example
DO SET = %%$MLLEND = NO
DO COMMAND = F CICST,CEMT I TASK
WAITMODE Y WAITRESP Y
.
ENDMSG
All DO statements specified after the DO COMMAND statement and before (above) the ENDMSG statement are performed for each line of the command response.
%%$RESOLVE
Control-O always attempts to resolve a variable that begins with %%. By default, if the AutoEdit expression cannot be fully resolved, the DO action containing the variable, and all subsequent DO actions of the current activation of the rule, are cancelled.
You can override this default by including a %%$RESOLVE NO or %%RESOLVE FORCE statement in a previous DO SET parameter statement. For details, see AutoEdit Resolution Override Process.
If any %%$RESOLVE statements other than %%$RESOLVE NO are specified, and a variable cannot be resolved, subsequent DO actions in the rule are cancelled and an error message is issued.
A %%$RESOLVE statement is assigned in a DO SET statement and affects all subsequent DO statements until the next %%$RESOLVE statement in the rule. For more information, see DO SET: Automated Console Action Parameter.
Default AutoEdit Resolution Process
The default %%RESOLVE statements are
-
%%$RESOLVE
-
%%$RESOLVE MUST
-
%%$RESOLVE YES
These statements perform the same function. You can use them to return to default resolve mode after an override is performed.
To resolve an AutoEdit expression, Control-O analyzes the expression from right to left. The expression is divided into its components, called tokens. Each token represents an AutoEdit variable to be resolved. During normal AutoEdit resolution, this process is normally performed once.
However, if an unresolved token exists after this process is performed, a second pass is performed on the entire expression. If an unresolved token still exists, then the expression remains unresolved and the current and subsequent DO statements are not performed.
AutoEdit Resolution Override Process
The %%RESOLVE override statements are
-
%%$RESOLVE NO
-
%%$RESOLVE FORCE
%%$RESOLVE NO
The %%$RESOLVE NO statement instructs Control-O to perform the DO statements even if the AutoEdit statement cannot be fully resolved. If any tokens cannot be fully resolved, they are resolved as far as possible before performing the DO statement.
%%$RESOLVE FORCE
By default, if a token resolves to the name of another AutoEdit variable during the first pass, that token is considered resolved and there is no further attempt at resolution. This can occur in the following situations:
-
A global variable was loaded into memory at Control-O startup, or during a LOADGLOBAL operation, and the value of that variable contained an expression that included the name of another variable.
-
A variable was set to a non-existent AutoEdit variable while %%$RESOLVE NO was in effect.
The %%RESOLVE FORCE statement overrides this default by instructing Control-O to perform a second pass on the token that initially resolved to the name of another AutoEdit variable.
AutoEdit Resolution Process for Sysplex
When Control-O attempts to resolve a variable stored in a Sysplex XAE type 1 database that belongs to a Control-O in another system, then by default, if the Control-O system is down, an AutoEdit error is issued.
The %%RESOLVE ODOWN statement resolves any variables left in the Coupling facility by a Control-O system that is no longer available. This can be used, for example, to ascertain values set by the failing system.
Assume that it is not known whether the %%INDEX_DOLLAR DO SHOUT message variable contains a value. By including the %%RESOLVE NO statement, the DO rule will be processed either way.
The last statement resets AutoEdit resolution to its default mode.
DO SET=%%$RESOLVE NO
DO SHOUT=TO TSO-PROD URGENCY R
MESSAGE SET THE VALUE OF THE %%INDEX_DOLLAR PARAMETER
DO SET=%%$RESOLVE
Assume that
-
the STARTCMD column in an AutoEdit variable database contains the value SUB=MSTR,LLA=%%$GLOBAL\SYSCLONE
the %%$GLOBAL\SYSCLONE global variable is equivalent to 01
In this case, resolution of %%STARTCMD without %%$RESOLVE FORCE results in the following:
SUB=MSTR,LLA=%%$GLOBAL\SYSCLONE
with the value of the global variable %%$GLOBAL\SYSCLONE unchanged.
However, with %%$RESOLVE FORCE, the result is
SUB=MSTR,LLA=01
Assume that Control-O operating in the othersys system goes down, and you need to determine the last value set in the colname column of the dbname database. The following statements shout the value:
DO SET=%%$RESOLVE ODOWN
DO SHOUT=THE VARIABLE VALUE IS
%%othersys\dbname\colname
DO SET=%%$RESOLVE
%%$RANGE
A %%$RANGE statement limits performance of AutoEdit functions to a specified column range. Data, commands and control statements outside the range remain unchanged.
This statement is useful when values must be specified in specific columns and when not every AutoEdit expression needs to be resolved.
The format of the %%$RANGE statement is:
%%$RANGE fromcol tocol
In this format
-
fromcol is the first column in the range
-
tocol is the last column in the range
Any range from 1 through 255 can be specified. If no range is specified, the default range is from 1 through 255.
The specified range limit applies both to the columns read for resolution and to the columns containing the resolved values, as follows:
Input for AutoEdit resolution is taken from the specified column range. All columns in the range are processed, whether they contain AutoEdit terms or constants.
Resolved values are limited to the specified range. If the resolved value would normally exceed the range, it is truncated.
The %%$RANGE statement can prevent the shifting of constants and variables that appear subsequent to an AutoEdit variable in the same line. By limiting AutoEdit resolution to a specified range, all constants and variables outside the specified range remain in their original positions regardless of the length of the resolved variables.
A %%$RANGE statement is valid until a new %%$RANGE statement is specified.
The length of a %%$RANGE statement with 3-digit fromcol and tocol values is 14 characters. BMC recommends that you allow room for 14 characters even if the present %%$RANGE statement does not include 3-digit numbers. If a %%$RANGE statement containing fewer than 14 characters is specified, the user will not be able to use a subsequent %%$RANGE statement to expand the range back to the maximum length.
In the example shown below, the %%$RANGE statement limits resolution to the columns from 1 through 44. If the %%MYVAR variable resolves to more than 44 spaces, only the first 44 characters are displayed.
DO SET = %%$RANGE 1 44 GLOBAL
DO SHOUT = TO OPER URGENCY RCTO282I
MESSAGE %%$MYVAR WAS DELETED
Functions
The following AutoEdit functions can be specified in a DO SET statement.
AutoEdit variables must be explicit when used in function statements. For example:
You can use a statement such as the following:
DO SET = %%NDATE = %%$CALCDATE %%WDATE +%%HH
However, do not use a statement such as the following:
DO SET = %%NDATE = %%$CALCDATE %%.%%WDATE +%%HH
%%$CALCDATE
The %%$CALCDATE function performs date calculations based on a given date. The valid format is
%%$CALCDATE date ± quantity
In this format
-
date must be in the format yymmdd
-
quantity is a number, or numeric AutoEdit expression, of days to add to or subtract from the date (from 1 through 99999)
%%$CALCDATE operates on Gregorian dates only; Julian dates (such as %%JULDAY) cannot be specified.
%%$POOLCOSMOS
The %%$POOLCOSMOS function returns the type of COSMOS database. The valid format is
%%$POOLCOSMOS cosmos_dbname
In this format, cosmos_dbname is the name of the COSMOS database, and is mandatory.
This function returns one of the following types:
-
UNKNOWN — The pool is unknown.
-
METHOD — The database contains methods of operation.
-
PREREQ — The database contains prerequisite conditions.
-
WORKING — The database contains working objects.
-
NONE — The database is not supported by COSMOS.
DO SET %%COSTYPE = %%$POOLCOSMOS COSSTCSD
%%COSTYPE is set to WOR KING.
DO SET %%COSTYPE = %%$POOLCOSMOS $GLOBAL
%%COSTYPE is set to NONE.
%%$POOLSTORE
The %%$POOLSTORE function returns the source type of the pool Control-O storage. The valid format is
%%$POOLSTORE gblvar_pname
In this format, gblvar_pname is the Global variable pool name, and is mandatory.
This function returns one of the following types:
-
UNKNOWN — The pool is unknown.
-
MEMBER — The source is a member in the Control-O Global variable library.
-
DATABASE — The pool is a database type.
-
SYSPLEX1 — The pool is a database type that can be shared for read-only operations in the Sysplex environment.
-
SYSPLEX2 — The pool is a database type that can be shared for read and write operations in the Sysplex environment.
In a non-Sysplex environment
DO SET %%DB_STOR = %%$POOLSTORE COSSTCSD
%%DB_STOR is set to DATABASE.
In a Sysplex environment
DO SET %%DB_STOR = %%$POOLSTORE COSSTCSD
%%DB_STOR is set to SYSPLEX1.
DO SET %%DB_STOR = %%$POOLSTORE $GLOBAL
%%DB_STOR is set to MEMBER.
%%$POOLTYPE
The %%$POOLTYPE function returns the type of pool in Control-O as defined in the list of pools to be loaded (DAGLBLST). The valid format is
%%$POOLTYPE gblvar_pname
In this format, gblvar_pname is the global variable pool name, and is mandatory.
This function returns one of the following types:
-
UNKNOWN — Unknown pool.
-
INOUT— The database is loaded and updated using the LOADGLOBAL and WRITEGLOABAL commands.
-
INPUT — The database can be loaded, but not written to. This type can be used for AutoEdit variables whose initial values are specified in the database and do not require check pointing. The value of each AutoEdit variable can be changed, and new AutoEdit variables can be added to the database, during the INCONTROL product session. However, these new values and variables are not saved when the product session is ended.
-
PROT — The database cannot be updated during the INCONTROL product session, and no new AutoEdit variables can be assigned to the database. This type can be used for a database containing AutoEdit variables that are "constants."
-
TEMP — The database does not reside on the disk, and therefore cannot be loaded or written to. This type is useful for a database containing AutoEdit variables that do not need to be saved after the INCONTROL product session is ended.
DO SET %%DB_TYPE =%%$POOLTYPE COSSTCSD
%%DB_TYPE is set to TEMP.
DO SET %%DB_TYPE =%%$POOLTYPE $GLOBAL
%%DB_TYPE is set to INOUT.
%%$SUBSTR
The %%$SUBSTR function extracts a substring from the input string. The valid format is
%%$SUBSTR strng startpos len
In this format
-
strng is the input string from which the substring is extracted.
-
startpos is the first character of the input string to extract.
-
len is the number of characters to extract.
A string is returned composed of the specified number of characters from the input string beginning with the character in the specified starting position.
startpos and len must be numbers (or numeric AutoEdit expressions) and greater than zero.
-
If startpos is greater than the string length, an AutoEdit error message is displayed.
-
If (startpos + len – 1) is greater than the string length, the returned value is truncated.
-
If the length is unknown you can use the values shown in Table194.
Table 194 Valid %%$SUBSTR Values — Unknown Length
Value |
Description |
---|---|
* |
Control-O calculates the end of the string. |
' ' (Blank) |
Control-O calculates the end of the string, but at least one valid character must be input after the beginning of the string. |
DO SET=%%A = %%$CALCDATE %%$RDATE -1
DO SET=%%AMON = %%$SUBSTR %%A 3 2
On December 1, 2000:
DO SET=%%A = 001130
DO SET=%%AMON = 11
%%$TIMEINT
The %%$TIMEINT function calculates the time interval between two given times (specified in any order). The valid format is
%%$TIMEINT time1 time2
time1 and time2 are constants or variables in the format yydddhhmmss.
In this format
-
yy is the two-digit year
-
ddd is the Julian day
-
hh are the hours
-
mm are the minutes
-
ss are the seconds
The resulting time interval is in format dddddhhmmss
-
ddddd is the number of days
-
hh is the number of hours
-
mm is the number of minutes
-
ss is the number of seconds
DO SET=%%A = %%$TIMEINT 00120070000 00119060000
The result is: 00001010000.
DO SET=%%NOW = %%$YEAR.%%$JULDAY.%%$TIME
IF %%$TIMEINT %%NOW %%PAST GT# 30
DO SHOUT
ENDIF
This calculates the time interval between now and an earlier time (%%PAST), and notifies the user through a DO SHOUT statement if the time interval exceeds thirty seconds.
%%$POS
The %%$POS function locates a substring in a specified string, and indicates the position of the first character in the located substring.
The format of the %%$POS function is
%%$POS substring string
In this format
-
substring is the constant or variable that contains the substring for which to search.
-
string is the constant or variable that contains the string to search for the specified substring.
If the substring is not found in the specified string, function %%$POS returns a value of 0.
DO SET %%A = HAVE A NICE DAY
DO SET %%B = %%$POS NICE %%A
This returns a value of 8.
DO SET %%A = %%$POS ABCD ABCED
This returns a value of 0.
%%$ISNUM
The %%$ISNUM function indicates whether a specified string is numeric. In order to be considered numeric, the specified string must contain only numeric characters from 0 through 9, because a numeric string cannot contain letters, blanks, or special characters.
Possible values returned by this function are
-
YES — the specified string is numeric
-
NO — the specified string is not numeric
The format of the %%$ISNUM function is
%%$ISNUM string
In this format, string is the constant or variable that contains the string to evaluate.
DO SET %%A = %%$ISNUM 1234
This returns a value of YES.
DO SET %%A = %%$ISNUM 12PM
This returns a value of NO.
%%$PARSE
The %%$PARSE function is a powerful tool that offers extensive string manipulation capabilities in Control-O AutoEdit environment. This function, which is similar to the REXX PARSE command in the TSO/E environment, can be used to analyze and extract information from various AutoEdit strings, such as messages intercepted by Control-O.
The %%$PARSE function parses a specified string (that is, it splits the specified string into substrings) according to a specified template. A template consists of variables and "patterns" that determine the parsing process.
The format of the %%$PARSE function is
DO SET=%%$PARSE string template
In this format
-
string is the AutoEdit variable that contains the string to be parsed
-
template is the AutoEdit variable or constant that contains the template
DO SET=%%S=THIS IS A SAMPLE STRING
DO SET=%%T=A1 A2 A3 A4 A5
DO SET=%%$PARSE %%S %%T
The %%$PARSE function assigns substrings of the specified string to the specified variables according to the specified template.
The DO SET statements in the above example provide the same result as the following DO SET statements:
DO SET=%%A1=THIS
DO SET=%%A2=IS
DO SET=%%A3=A
DO SET=%%A4=SAMPLE
DO SET=%%A5=STRING
The parsing process involves the following stages:
-
The string is broken into substrings, from left to right, using the patterns in the template.
-
Each substring is parsed into words, from left to right, using the variable names in the template.
Template elements are
-
String Patterns
-
Position Patterns
-
Variables
-
Place holders (Dummy variables)
The rules of parsing are detailed in the following paragraphs.
Parsing Words
Scanning is performed from left to right and words in the string (leading and trailing blanks excluded) are matched one by one with the variables named in the template. The last variable named in the template will contain the remaining part of the string, including leading and trailing blanks.
Up to 30 variable names can be specified in a parsing template.
The following situations can be encountered:
-
The number of words in the string matches the number of variables in the template.
Each of those variables contains one word of the string. The last variable contains the last word in the string including leading and trailing blanks. -
The number of words in the string is smaller than the number of variables named in the template
The first variables each contain one word of the string and the extra variables receive a value of NULL (a string of 0 character length). -
The number of words in the string is greater than the number of variables in the template
All variables but the last one contain one word of the string and the last variable named in the template contains the remaining part of the string, including leading and trailing blanks.
The DO SET statements below (which include a %%$PARSE function)
DO SET=%%S = THIS IS A SAMPLE STRING
DO SET=%%T = A1 A2 A3
DO SET=%%$PARSE %%S %%T
have the same result as the following DO SET statements:
DO SET=%%A1 = THIS
DO SET=%%A2 = IS
DO SET=%%A3 = A SAMPLE STRING
Using Dummy Variables (Place Holders)
A single period can be used as a dummy variable in the template. This is useful when the corresponding word in the string does not need to be stored in a named variable.
The following DO SET statements (which include a %%$PARSE function)
DO SET=%%S = THIS IS A SAMPLE STRING
DO SET=%%T = . . . A4.
DO SET=%%$PARSE %%S %%T
have the same result as the following DO SET statement:
DO SET=%%A4 = SAMPLE
Using Patterns in Parsing
Patterns can be included in the template. Their purpose is to break down the string into substrings prior to the actual parsing into words process. Parsing will then be performed, as previously described, on the substrings and not on the original string.
Two types of patterns are available:
-
String Patterns – a character string delimited by quotes, to distinguish it from a variable name
-
Numeric (Positional) Patterns – a number, signed or unsigned
Using String Patterns
The string is scanned from left to right for a substring that matches the string pattern.
The following situations may occur:
-
A match is found, that is, a substring within the string is identical to the given string pattern.
The original string is divided into two substrings. The first substring (up to, but not including, the string pattern) is parsed into words using the variables named before the string pattern on the template. Parsing continues from the character following the matched string.
CopyDO SET=%%S= THIS IS A SAMPLE STRING
DO SET=%%T= A1 A2 'SAMPLE' A3 A4 A5
DO SET=%%$PARSE %%S %%TA match is found since the string SAMPLE is part of the original string.
The %%$PARSRC System variable, which is discussed in %%$PARSE, can be used to check if all strings specified in the template were matched during the parsing process.
The original string is divided into two substrings while the matched part of the string is excluded. Parsing of the first substring will use the variables listed before the match on the template while parsing of the second substring will use the variables listed after the match:
-
First substring: THIS IS A
As a result of parsing
CopyA1=THIS
A2=IS A -
Second substring: STRING
As a result of parsing:
CopyA3=STRING
A4=NULL
A5=NULLA match is not found. There is no substring identical to the given string pattern within the string.
It is assumed that a match is found at the end of the string. The first substring consists of the entire string and it is parsed using only the variables named before the string pattern on the template. Parsing continues from the character following the matched string (the end of the string, in this case).
CopyDO SET=%%S = THIS IS A SAMPLE STRING
DO SET=%%T = A1 A2 A3 'EASY' A4 A5
DO SET=%%$PARSE %%S %%TA match was not found. The string ‘EASY’ does not exist within the original string.
-
First substring: THIS IS A SAMPLE STRING
As a result of parsing:
CopyA1=THIS
A2=IS
A3=A SAMPLE STRING-
Second substring: NULL
As a result of parsing:
CopyA4=NULL
A5=NULL -
-
Using Numeric Patterns Within the Template
Numeric patterns are numbers that mark positions in the string. They are used to break the original string into substrings at the position indicated by the number.
The position specified can be absolute or relative:
-
An absolute position is specified by an unsigned number.
-
A relative position is specified by a signed number (positive or negative) and its purpose it to determine a new position within the string, relative to the last position.
-
The last position is one of the following:
-
the start of the string (position1), if the last position was not specified previously
-
the starting position of a string pattern if a match was found
-
the position of the end of the string, if the string pattern was not matched
-
the last position specified by a numeric pattern
-
-
If the specified position exceeds the length of the string, the numeric pattern is adjusted to the end of the string. Similarly, if the specified position precedes the beginning of the string (negative or zero numeric pattern), then the beginning of the string is used as last position.
A parsing template with an absolute numeric pattern:
DO SET=%%S =THIS IS A SAMPLE STRING
DO SET=%%T = A1 A2 11 A3 A4 A5
DO SET=%%$PARSE %%S %%T
First substring: THIS IS A (up to, but not including, position11)
As a result of parsing
A1=THIS
A2=IS A
Second substring: SAMPLE STRING (from position 11, up to the end of the string).
As a result of parsing
A3=SAMPLE
A4=STRING
A5=NULL (0length string)
A parsing template with a relative numeric pattern:
DO SET=%%S =THIS IS A SAMPLE STRING
DO SET=%%T = A1 A2 +10 A3 A4 A5
DO SET=%%$PARSE %%S %%T
Last position is the beginning of the string (position 1).
Position marked within the string is 1 + 10 = 11.
First substring: THIS IS A (up to, but not including, position11)
As a result of parsing
A1=THIS
A2=IS A
Second substring: SAMPLE STRING (from position11, up to the end of the string).
As a result of parsing:
A3=SAMPLE
A4=STRING
A5=NULL (0length string)
Using More Than One Pattern and Combining Pattern Types in the Template
Both types of patterns (string and numeric) can be combined in the same template. Up to 30 patterns and up to 30 variable names can be specified.
Scanning of the string proceeds from beginning of the string until the first pattern (if any).
-
String pattern – A match was found
The substring that precedes the match to the pattern is parsed using the variables named in the template before the pattern, with the last variable receiving the end of the substring, including leading and trailing blanks.
-
String pattern – A match was not found
Since no match was found in the string, it is assumed that a match is found at the end of the string. The whole string is parsed using only the variables named in the template before the pattern.
-
Numeric pattern (absolute)
The absolute numeric pattern points to a position within the string when the beginning of the string is position1.
The string is divided into two substrings.
-
The first substring extends from the beginning of the string and up to, but not including, the position that corresponds to the numeric pattern and it is parsed using the variables named in the template before the pattern.
-
If the absolute numeric pattern specifies a position beyond the length of the string, it is readjusted to the first position beyond the length of the string and the entire string is parsed using the variables named in the template before the pattern.
-
-
Relative numeric pattern
The relative numeric pattern (a signed number) specifies a position within the string, relative to the last position.
-
Last position
It is the beginning of the string when the relative numeric pattern is the first pattern in the template.
-
If the relative numeric pattern is not the first pattern in the template and the previous pattern was numeric, the last position is that specified by the previous numeric pattern.
-
If the relative numeric pattern is not the first pattern in the template and the previous pattern was a string, the last position is that of the starting character of the match (if there was a match) or the position following the end of the string (if there was no match).
-
As a result of what was just explained:
-
If a pattern was not matched until the end of the string and the following pattern is a string pattern, this new string pattern is ignored since the starting point for the new scan is the end of the string.
-
If a pattern was not matched until the end of the string and the following pattern is a numeric pattern, then the scan and subsequent parsing will resume from the new position indicated by that numeric pattern.
A parsing template with two absolute numeric patterns (with the second position preceding the first):
The following DO SET statements:
DO SET=%%S = THIS IS A SAMPLE STRING
DO SET=%%T = A1 A2 11 A3 6 A4
DO SET=%%$PARSE %%S %%T
have the same result as the following DO SET statements:
DO SET=%%A1 = THIS
DO SET=%%A2 = IS A
DO SET=%%A3 = SAMPLE STRING
DO SET=%%A4 = IS A SAMPLE STRING
First substring: THIS IS A (up to, not including, position 11)
As a result of parsing:
A1=THIS
A2=IS A
Second substring: SAMPLE STRING (from position 11 and up to the end of the string; since the next pattern, position 6, precedes the previous position, it cannot limit this second substring)
As a result of parsing:
A3=SAMPLE STRING
Third substring: IS A SAMPLE STRING (from position 6 and to the end of the string)
As a result of parsing:
A4=IS A SAMPLE STRING
A parsing template with one absolute and one relative numeric pattern:
DO SET=%%S = THIS IS A SAMPLE STRING
DO SET=%%T = A1 6 A2 +3 A3
DO SET=%%$PARSE %%S %%T
First substring: THIS (beginning of the string up to, but not including, position6).
As a result of parsing:
A1=THIS
Second substring: IS (from position6 up to, but not including, position6+3=9)
As a result of parsing
A2=IS
Third substring: A SAMPLE STRING (from position9 to the end of the string)
As a result of parsing:
A3=A SAMPLE STRING
A parsing template with two relative numeric patterns:
The following DO SET statements
DO SET=%%T = A1 A2 +40 A3 -13 A4 A5
DO SET=%%S = THIS IS A SAMPLE STRING
DO SET=%%$PARSE %%S %%T
have the same result as the following DO SET statements:
DO SET=%%A1 = THIS
DO SET=%%A2 = IS A SAMPLE STRING
DO SET=%%A3 = %%NULL
DO SET=%%A4 = SAMPLE
DO SET=%%A5 = STRING
The first numeric pattern specifies a position at column 40. This is beyond the end of the string so the position is reset to column 24 (end of the string + 1). As a result, the whole string is parsed to words using the A1 and A2 variables.
The second numeric pattern specifies a position at column 11 (end of the string + 1 minus 13) that precedes the position (40 readjusted to 24) previously specified; therefore the data from the last position (which is the end of the string) to the end of the string is parsed to words using the A3 variable (A3 is set to NULL).
The data (from column 12 to the end of the string) is parsed to words using the A4 and A5 variables.
Combining a string pattern and numeric pattern
The following DO SET statements
DO SET=%%S = THIS IS A SAMPLE STRING
DO SET=%%T = A1 'A' A2 +3 A3
DO SET=%%$PARSE %%S %%T
have the same result as the following DO SET statements:
DO SET=%%A1 = THIS IS
DO SET=%%A2 = A S
DO SET=%%A3 = AMPLE STRING
The pattern specifies a string (A) that is matched at column 9. The data before column 9 is parsed to words using the A1 variable. The Numeric pattern (+3) specifies a position at column 12 by using relative position. The data from column 9 to column 12 is parsed to words using the A2 variable. The remaining data (from column 12 to the end of the string) is parsed to words using the A3 variable.