Commands Summary
Table 3–2 provides a summary of each command used to define variables.
Table 4. Commands Summary
Command | Summary |
---|---|
Begins each variable definition. Use to define variables and variable groups. To define a variable group, include the keyword GROUP in the DEFINE command. Variable names are 1 to 32 characters long, must begin with an alphabetic character, and can include alphanumeric characters, underscores, and hyphens. | |
Optional command for specifying the data type of the variable: integer or string. Also use to specify whether the member or value of the variable should be retained when another database is activated. A variable of type integer means that the value of the variable can only be an integer between +/–2,147,483,647. A variable of type string means that the value of the variable can be a string of character data. String is the default type. | |
Sets the initial value of the variable. If you do not define a default value, AMS uses a default of 0 for integer variables and a null string ("") for string variables. | |
Causes a variable to be reset automatically to its default value if it was not changed using a SET or RESET command after a specified period of time. You can specify a timeout period in minutes or seconds; seconds are the default units. | |
Ends the variable definition. | |
Omits the variable from the run time version of the database. |
*Each DEFINE command must be followed by a corresponding END or OMIT command.
Examples
The following example defines the string variable "FileSystem" with a default value of "/dev/root":
DEFINE VARIABLE "FileSystem" TYPE STRING DEFAULT "/dev/root" END
The following example defines the string variable “DeviceName” and causes it to be reset to a null string ("") if it is not set or reset to another value within 50 seconds. You do not have to specify SECONDS in the variable definition because that is the default unit for TIMEOUT.
DEFINE VARIABLE "DeviceName" TYPE STRING TIMEOUT 50 END
The following example defines the variable group “FileSystem”. Each member of “FileSystem” has an integer value with a default of 0. The timeout of six minutes causes each member to be reset to 0 if it was not set or reset to another value in the last six minutes. Since it is a retained variable group, the variable group retains its members and their values when a new database is activated provided “File System” is defined in the newly activated database as a retained integer variable group.
DEFINE VARIABLE GROUP "FileSystem" TYPE INTEGER RETAINED DEFAULT 0 TIMEOUT 6 MINUTES END