Variables in the Rule Processor
Defining variables
The Rule Processor application treats any character string that begins with an ampersand sign (&) as a variable.
Variable names can be up to 32 characters long, excluding the ampersand sign (&). The variable values can be up to 255 characters long.
Two types of variables can be used in Rules:
- SHARED variables from the BBI-SS PAS SHARED variable pool
EVENT variables created by the Rule Processor application; they exist for duration of the event
EVENT variables consist of
- WORDxxx variables, where xxx represents a number (for example, &WORD4 represents the fourth word of the message text)
- BMC AMI Ops Automation-supplied variables
See BMC-AMI-Ops-Automation-supplied-EVENT-variables for a list of EVENT variables.
Restrictions for long variables
Long variables cannot be used in Rules processing.
None of the Rule event types, including the VAR event type, support the use of long variables and the Rule Processor panels do not support long variables in any field.
Resolving variables
When resolving the contents of variables:
- The variable names and the variable values are always converted to uppercase.
Conversion operations are performed.
If the variables contain numeric values, conversion operations are performed automatically. For example, if you have two variables where &ABC=5 and &DEF=0005, these both equal 5.
Variable values can also contain combinations of numerics and characters. When numerics and characters are combined, the conversion operation is different. For example, if you have two variables where &ABC=XYZ0005 and &DEF=XYZ5, these values are not equal.
The following search order is used:
- BBI-SS PAS SHARED variables
- EVENT variables (WORDxxx variables and BMC AMI Ops Automation-supplied variables)
Variables that are not found result in a null value (zero length).
For example, if the SHARED variable pool contains a variable named &WORD1, the value from the SHARED pool is used instead of the actual first word of the event text.
When the Rule Processor resolves the contents of variables, the Rule Processor accepts two styles of variable specifications: simple variables (formerly referred to as CLIST-style) and compound variables.
Simple variables
When an ampersand sign (&) prefixes text in a field in the Rule Processor fields, it denotes a simple variable name. The end of a variable name is designated by one of the following symbols:
End of variable name | Example |
---|---|
Blank | |
Period | . |
Comma | , |
Ampersand | & |
Apostrophe | ' |
Hyphen | - |
Asterisk | * |
Plus sign | + |
Forward slash | / |
Backslash | \ |
Colon | : |
For example, the variable &MSGID contains the characters IEF1234I and the variable &TEST contains the characters ABCD and the combination
is resolved as two separate variables:
Compound variables
When an ampersand sign (&) prefixes text in a field in the Rule Processor fields, it denotes a simple variable name that is resolved in one pass.
If the ampersand sign is directly followed by an exclamation mark (!) and if there are periods in the variable name, the Rule Processor resolves the contents of the compound variable differently.
The first node of a compound variable precedes the first period and is called the stem. For example, in the variable &!ABC.MYNAME, the stem is ABC.
The stem of a compound variable is not resolved to a value and two passes are used to resolve the variable.
In another example, suppose you have the following three variables and values:
MYNAME = SECOND
ABC.SECOND = THIRD
The Rule Processor resolves the variable
as THIRD.
Variable resolution for this compound variable occurs in this sequence:
- ABC is the stem and is not resolved.
- In the first pass, the variable following the stem is resolved and MYNAME becomes SECOND.
- After the first pass, the variable value is now ABC.SECOND.
- In the second pass, the variable ABC.SECOND is resolved to THIRD.
Therefore, &!ABC.MYNAME is resolved by the Rule Processor to THIRD.
In addition, a Rule can set or create a compound variable such as A.&IMFJTYPE..&IMFJNUM. Other Rules can obtain the value by specifying &!A.IMFJTYPE.IMFJNUM.
The end of a variable is designated by one of the following:
End of variable name | Example |
---|---|
Blank | |
Comma | , |
Ampersand | & |
Apostrophe | ' |
Hyphen | - |
Asterisk | * |
Plus sign | + |
Forward slash | / |
Backslash | / |
Colon | : |
If the Rule Processor cannot find a value for the variable, it is resolved as a null value. For example, if the Rule Processor cannot find a value for variable &!ABC, the Rule Processor assumes it is a null value.
For compound variables, if the variable &!CICS.SYSA does not have a value, the Rule Processor also assumes it is a null value.
In another example, if
CICSTAT = not defined
The following combination
is resolved as