Getting Started with the Automation Engine Scripting Language: Syntax Overview

The elements and syntax of the Automation Engine scripting language are consistent with other scripting languages that you will be familiar with. Write statements with commands, functions and variables, and include comments. You can combine Automation Engine scripting language with commands of your target operating systems and applications.

This page outlines the syntax and briefly describes the most important elements of the Automation Engine scripting language. It provides links to topics in this documentation that describe them in more detail:

Script Statements

Statements are the basic unit of work and usually contain a command. The following rules apply for script statements:

  • Statements begin with a colon.
  • Maximum statement length: 1024 characters, including spaces.

Statements are displayed in blue in the script editor.

Examples:

  • :PRINT "HELLO WORLD" writes HELLO WORLD to the task Activation report

  • :SEND_MSG "GREEN","EDP","Please start backup process." sends a message (Please start backup process.) to a particular user (GREEN, department EDP) and displays it in the Messages console

  • :PUT_ATT INT_ACCOUNT="Accounts" sets the INT_ACCOUNT property to Accounts

For more details and examples, see Script Statements.

See also:

Script Functions

Functions allow you to manipulate data in the system. Script functions supply return codes, which distinguishes them from script statements.

Follow these rules when using script functions:

  • Start the line with a script statement. Do not start a line with a script function.
  • Include only one function per line.

Properly formatted functions are displayed in red in the script editor.

Many script functions work on their own, but there are also functions that only work or make sense when used in combination with other script elements.

For more details and examples, see Script Functions.

Date, Time and Period Formats

You can specify formats for date, time and periods in many statements and functions. You can also use script functions to convert date, time and period formats.

For details and examples of formats, see Date, Time and Period Formats in Scripts.

For information about the script functions that convert date, time and period formats, see Script Date and Time Functions.

Script Variables

You use script variables to define and pass values in scripts. Script variables can include numbers, strings, dates or times. The value of the variable is valid until the script has been processed. Properly formatted variables are displayed in purple in the script editor.

Variable names are context-specific, so you can define multiple variables in different objects that have the same name, as long as they are used in separate contexts. Variables cannot share the same initial characters within the same context.

Tip: End variable names with a hash character (#) to delimit the name and avoid problems with similar variable names.

Example: The variables &VALUE# and &VALUES# can be used within the same context. &VALUE and &VALUES cannot.

For more information, see:

Arrays

You can use arrays to store several different values in one variable. For details and examples, see Arrays.

Using Variables in Scripts

In addition to script variables, you can call different types of variables used in the Automation Engine to retrieve and store values. Various script elements let you retrieve and modify different types of variables. For more information, see Script Elements for Variables and VARA Objects.

The same applies to VARA objects. There are several script elements that let you work with VARA objects. For details, see VARA Objects.

Important! Although variables and VARA objects have a common purpose, it is important that you understand the differences. Read Variables and VARA Objects, where both variables (and all their types) and VARA objects are explained in detail.

Script Elements and Variables

These are some of the most important script elements that you can use with variables and VARA objects:

VARA objects

Loading, Reading and Deleting Values

Script Parameters

Follow these rules to enter script parameters:

  • Write required parameters within the parentheses
  • Write optional parameters in square brackets
  • Use commas to separate parameters
  • Keyword parameters: Write them exactly as specified

Script elements are evaluated in the order in which they are listed.

For more information and examples, see Script Parameters.

Script Literals

You use script literals to print a particular text. You must write them within single (') or double (") quotation marks; the only exception are AE names, unless they contain a number. Script literals can contain script variables. For more information and examples, see Script Literals.

The Automation Engine scripting language provides various script elements that let you edit strings. You can concatenate strings, retrieve or remove parts of strings, and replace all or parts of strings. For more information, see Script Elements for Editing Strings.

Editing Strings

The Automation Engine scripting language includes elements that you can use to edit strings. These is what you can do with these elements:

  • Add, replace or remove characters

  • Return the number and position of characters

  • Search and compare strings

  • Combine or split strings

  • Check type and case of characters

  • Convert strings

When you use any of these elements, the new string is stored in a script variable and the original string remains unchanged.

You can find the list of these elements and detail descriptions with examples in the Automation Engine Script Reference section of this documentation at Script Elements for Editing Strings.

Comments

Lines that start with an exclamation point are interpreted as comments and have no impact on processing.

Data Lines and Job Control Language

(Job objects only) Lines that start with neither an exclamation point (!) nor with a colon (:) are interpreted as data lines. These lines contain commands in the Job Control Language (JCL) of the target system. When a script containing JCL is processed, the JCL is sent to the Agent and executed there.

You can use a script statement to explicitly declare a script line as a data line. For more information, see :DATA.

Jobs for enterprise business solutions (PeopleSoft and SAP), include some special features, so the Automation Engine scripting language provides specific JCL elements for those systems. For more information, see Job Control Language Script Reference.

See also:

The Reference guide in this documentation provides detailed descriptions and examples of all script elements. The guide is designed to help you find information as easily as possible. It is structured as follows:

You write scripts in the script editor available in the Process pages of executable objects, in SCRIPT (SCRI) and Include (JOBI) objects. See Working with the Script Editor for information about its features and functions.

The Using section in this documentation describes how to write scripts using the Automation Engine scripting language in more detail: