Previous Topic

Next Topic

Book Contents

Book Index

Database Variable Reference Method

When a database variable value is created or read by a rule, Control-M/Analyzer scans the database for the appropriate variable based on the Variable Reference Statement. Attribute search priorities exist for determining which variable best matches the Variable Reference Statement. Attributes are listed in Table 133 in the order in which Control-M/Analyzer uses them to search the Database:

Table 133 Database Variable Search Attributes

Attributes

Description

Group name

If no group name is specified, the group of the current rule is assumed. Control-M/Analyzer scans the Database for the specified or assumed group name. If the searched for group name does not exist, a runtime error occurs.

Variable name

After the group is found, Control-M/Analyzer searches for variables with the specified variable name.

A runtime error occurs when trying to read a Database variable that does not exist in the Database for the specified or assumed group.

When setting (writing) a Database variable that does not exist in the Database for the specified or assumed group:

The variable is created if automatic Database variable creation is enabled.

A runtime error occurs if automatic Database variable creation is disabled.

For more information, see Automatic Database Variable Creation.

Generation

If no generation is specified, generation 0–the current value is assumed. Control-M/Analyzer searches the Database for the specified or assumed generation of the variable. If no such generation exists, a runtime error occurs when trying to read a Database variable.

Date

If no generation is specified and a date suffix is specified, Control-M/Analyzer searches for variables created on the specified date. If no mach is found, a runtime error occurs. If several matches are found, Control-M/Analyzer examines the other specified attributes.

 

Note: User key and run ID are mutually exclusive and cannot be specified in the same Variable Reference Statement.

User key

If a User key is specified, Control-M/Analyzer searches for a variable that matches all prior specifications and whose User key matches the specified User key. If no match is found, a runtime error occurs. If several matches are found, Control-M/Analyzer returns the value of the oldest matching generation.

Run ID

If a run ID is specified, Control-M/Analyzer searches for a variable that matches all prior specifications with a run ID that matches the specified run ID. If no match is found, a runtime error occurs.

If several possibilities remain after all specified attributes have been examined, the oldest match is accessed.

Examples

When matching the Variable Reference Statements listed below, refer to Table 134, which describes Database variable attributes.

Table 134 Variable Database Attributes

Var#

Group

Variable

Gen

Date

User Key

Run ID

A

MARKET

GROSS_PROFIT

0

02/02/00

ADJUSTED

DAILY

B

MARKET

GROSS_PROFIT

1

02/02/00

ACTUAL

DAILY

C

MARKET

GROSS_PROFIT

2

02/02/00

FORECAST

DAILY

D

MARKET

NET_PROFIT

0

02/02/00

ADJUSTED

MONTHLY

E

MARKET

NET_PROFIT

1

02/02/00

FINAL

MONTHLY

F

MARKET

NET_PROFIT

2

02/02/00

FINAL

MONTHLY

G

MARKET

TAX_OWED

0

02/02/00

 

YEARLY

Table 135 Variable Reference Statements

Variable Reference Statement

Var #

DB_MARKET.TAX_OWED

G

DB_MARKET.GROSS_PROFIT@G1

B

DB_MARKET.GROSS_PROFIT@D980202

A

DB_MARKET.GROSS_PROFIT@D980303

Error

DB_MARKET.GROSS_PROFIT@D980101@KACTUAL

B

DB_MARKET.GROSS_PROFIT@KACTUAL

B

DB_MARKET.GROSS_PROFIT@KFINAL

Error

DB_MARKET.NET_PROFIT@RMONTHLY@KADJUSTED

Error. A user key and run ID cannot be specified simultaneously.

DB_MARKET.@G0

Error

Parent Topic

Variable Generation Attributes