Automation Engine Script Guide > Ordered by Function > Script Structure and Processing > :SET

:SET

Script Statement: Assigns a value to a script variableA placeholder for a value within a script..

Syntax

:S[ET] Script variable = Value

Syntax

Description/Format

Script variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type.

The name of the script variable to which a value should be supplied.

A script variable's name is limited to 32 alphanumeric characters, including the special characters "$", "_", "@", "§" and "#". German Umlauts are not allowed. The first character must not be a number. Variables within the scriptA particular Automation Engine object type. must always specified with a leading "&" following the variable name!

Format: script variable

Value

The value that should be assigned to the script variable.
Format: script literal, script variable or script function

Comments

Refer to the document that describes the peculiarities and practical usage of script variables.

When the specified variable does not yet exist, it will newly be created. In this case, the variable does not have a specific data type.

You can also use this script element to solve arithmetic expressions. For more information, see Calculations.

When predefined variablesFixed variables that can be used in the attributes or the script of executable objects. The values refer to the object or the system. that are enclosed in parentheses are used as values and supply numerical values (such as &$CLIENT#), they will automatically be converted to the 16-digit default format.

When you assign :SET and :RSET statements the same script variable with different values, their values will be set by those :SET and :RSET statements when the jobAn Automation Engine object type for a process that runs on a target system. is executed. However, if the job is restarted, the values of both variables will be set by the :SET statement. This is because :RSET statements automatically create objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task values and :SET statements automatically save the value for a restartA restart refers to the repetition of an object's execution. This action differs from a new start in some parts.. This is a change in behavior from v8, where :RSET statements did not create object values.

It is possible to redefine variables with :DEFINE that are already defined by :SET.

Examples

The example assigns a file name to the script variable "&FILE".

:SET &FILE# = "L.LST.FILE"

In the following example, the current date - which is retrieved using a script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… - is assigned to the script variable "&TODAY".

:SET &TODAY# = SYS_DATE(YYMMDD)

A script variable can also include numbers.

:SET &NUMBER# = 1

You can also assign a value of a different script variable.

:SET &NR# = &NUMBER#

 

See also:

Script element Description
:DEFINE Declares a script variable with a particular data type.

:PSET

Assigns a value to an object variable.

:RSET

Assigns a value to a script variable and saves it to the activation reportA report provides more detailed information about a task's execution or a component..

:SET_SCRIPT_VAR

Sets the values of script variables by indirect access.

Script Elements - Script Structure and Processing

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by function

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH