Changing the Value of a Variable (SET Command)

Use this command to set the value of a variable, or one or all members of a variable group. A variable group member is automatically created if it does not exist when a value is assigned to it using a SET command.

Format

SET variable-name = expression

or

SET variable-group-name:member-name = expression
			

where:

variable-name

is the name of a variable previously defined using a DEFINE VARIABLE command. See Section 3.

variable-group-name

is the name of a variable group previously defined using a DEFINE VARIABLE command.

member-name

is the unique name of the member. You can specify the member name using a variable reference, as a fixed string constant, or as the predefined variable _ALL. A fixed string constant is a set of characters enclosed in quotation marks (for example, "ABC") and cannot include variable substitution (for example, "FROM\ _HOSTID\”). _ALL refers to all currently existing members of the variable group.

If the member-name does not exist, the member is created automatically and a warning message is produced.

expression

is the value to assign to the variable or member. The expression is either an integer expression or a string expression, depending on the type of the variable or variable group. Expressions are described in Section 5.

Example

The following example sets the value of the string variable DiskMessage. The value of variable DiskNumber is inserted into the string before it is assigned to DiskMessage.

SET DiskMessage = “The number of the disk is \DiskNumber\”