Customizing expert rules
- The facts and variables within the predefined rules are set internally. You can use the same facts within rules you define. For a list of facts, see List-of-variables.
- You can modify the severity codes on messages to adjust them to the severity level that you require.
- If you do not want a rule to trigger, use one of the following methods to disable it:
- Enclose rules that you do not want to fire within a comment statement. The syntax for a comment is /* commentText */.
Set the predicate comparison to A=0. For example, you could modify a rule as follows to ensure that it is never triggered:
RULE1008: IF A = 0
THEN OUT=OUT||'BMC184008X-A Correlated Subquery will be e'||
'valuated for each row in the composite table. It performs like a N'||
'ested Loop Join./n'- Set the severity code of the message to X.
If you want a rule to always trigger, ensure that the predicate always evaluates to true. For example, your predicate could be as follows:
RULE1008: IF 0 = 0
THEN OUT=OUT||'BMC184008I-A Correlated Subquery will be e'||
'valuated for each row in the composite table. It performs like a N'||
'ested Loop Join./n'If your message text is longer than a single line, ensure that you use the || characters to append the next line. Enclose each line in the message within quotation marks and end the message with /n.
RULE5056: IF FULLOUTER = 'Y'
THEN OUT=OUT||'BMC184620I-The clause FULL OUTER JOIN incl'||
'udes unmatched rows from both tables. Missing values in the result'||
' table are filled with nulls./n'- You can use variable values within the message text:
If you want to display a variable value in the message, insert the variable name within || characters. Do not include the variable name within quotation marks. For example, the following message includes the variable value for LOCKSIZE on the final line:
RULE2054P: IF LOCKRULE = 'P' THEN LOCKSIZE = 'PAGE'
RULE2054R: IF LOCKRULE = 'R' THEN LOCKSIZE = 'ROW'
RULE2054T: IF LOCKRULE = 'T' THEN LOCKSIZE = 'TABLE'
RULE2054S: IF LOCKRULE = 'S' THEN LOCKSIZE = 'TABLESPACE'
RULE2054L: IF LOCKRULE = 'L' THEN LOCKSIZE = 'LOB'
RULE2054X: IF LOCKRULE = 'X' THEN LOCKSIZE = 'XML'
RULE2054: IF LOCKRULE <> 'A'
THEN OUT=OUT||'BMC184224W-The tablespace has a LOCKSIZE t'||
'hat does not match your installation standard. The current LOCKSIZ'||
'E is '||LOCKSIZE||'./n'If the value that you want to display is a numerical value, check to see if an equivalent string variable exists. (See List-of-variables.) The equivalent variable name has a C appended. For example, the following message includes the variable value for SEGSIZE on the final line:
RULE2056: IF TBTYPE = 'T' AND SEGSIZE > 2
THEN OUT=OUT||'BMC184226W-The tablespace has a SEGSIZE th'||
'at does not match your installation standard.The current SEGSIZE '||
'is '||SEGSIZEC||'./n'
To customize expert rules
Copy one of the following members in the BMCSAMP data set to create your own version of the rule set:
- PSSDFLT (for the DEFAULT rule set)
- PSSAPPL (for the APPLDEV rule set)
- PSSJAPAN (for the JAPAN rule set)
Modify the copy of the rule set in the hlq.UBMCSAMP data set as needed.Ensure that the rules conform to the structure described in Structure-of-rules. Ensure also that the RULESET name matches the name of the new rules member, as does NEWRULE1 in the example below:
BROWSE HLQ.LLQSAMP(NEWRULE1) -
Command ===>
********************************* Top of Data ****
RULESET NEWRULE1Update the Explain options to identify this rule set.
- At the SQL Explorer main menu, select 0 (Options).
- At the Options panel, select 1 (General).
- At the General Default Options panel, press Enter.
- At the Explain Options panel, specify the member name of the rule set that you want to use in the Rule set field and press Enter.