Procedures
Arbutus supports the creation of stored procedures which allow for
repeated or automatic execution of Arbutus commands. Similar
to SQL, the Arbutus language contains English-like commands
but, has also been enhanced with specific data analysis
and manipulation capabilities. Arbutus procedures may contain
any Arbutus commands, can call other procedures and even
allow interaction with users.
Procedures include a variety of advanced programming and other capabilities,
including:
- Sub-procedures allow encapsulation
of behavior
- Looping allows for iterative processing
of data groups
- Variables allow advanced calculations
that can contain persistent values
- Grouping allows multiple commands
to be executed in one pass of the
table
- Flow control allows commands, groups
of commands or sub-procedures to
be conditionally executed
- Dialogs allow a run-time user interface
to the procedure, to enter parameters
or specifications
- Procedures may be created manually,
or graphically, using Analyzer
In addition to the above, an important point is Arbutus procedures
may be automatically invoked whenever a particular table
is referenced. This capability allows even the most complex
processes to be triggered automatically, as required.
Here is an example of a simple procedure that takes a table (Sales)
and creates a new table (Large_NY) that contains all sales over $10,000
in New York , sorted in descending order of size:
OPEN Sales
SORT ON Sales_Amt D TO Large_NY IF Sales_Amt>10000 AND State=”NY”
|