Previous Topic: AOF Rule StructureNext Topic: )eventtype eventspec—Event Definition Section (Required)


Structure of an AOF Rule

AOF rules are classified as special OPS/REXX programs and, like any programming language, require a structured format. This chapter discusses the general coding format you should use in all AOF rules.

An AOF rule can contain up to five of the following control sections. Not all of the control sections are required, but they must appear in the following order. A unique section header in the rule identifies the control section.

Event Definition

The section header identifier is )eventtype eventspec.

Initialization

The section header identifier is )INIT.

Processing

The section header identifier is )PROC.

Termination

The section header identifier is )TERM.

End

The section header identifier is )END.

Section header identifiers delimit each section of a rule and logically control when the code in the associating section executes. A rule must contain an event definition section and at least one other section.

Each section header identifier must:

The fact that a rule section must begin with a ) character in column one imposes a restriction on OPS/REXX code used in rules. OPS/REXX continuation lines in rules may not start with a ) character in column one.

For example, the following rule will fail to enable:

)MSG BADRULE
)PROC
if (GLOBAL.SUPPRESSIT=1,
) then
  return “SUPPRESS”