:REGISTER_VARIABLE

Script statement: Available on Windows and UNIX for use in a Job object's (JOBS) Process Tab to storing a value computed during the execution of the job. It can be used in conjunction with an external interpreter script call and :BEGIN_EXT_INTERPRETERS... :END_EXT_INTERPRETERS.

Syntax

:REGISTER_VARIABLE VariableName, VariableValue

Value

Description/Format

VariableName

Name of the variable.

Format: Name of the variable, excluding the leading "&": "number#"

VariableValue

Value of the respective variable.

Format: string

Description

This script statement can be used between the :BEGIN_EXT_INTERPRETERS and :END_EXT_INTERPRETERS script statement to store the value of a user defined variable while executing an external interpreter script.

The external interpreter script would be called and run from the Process page of any Job object (JOBS) on Windows or UNIX.
This script statement stores variables in the AE system as Object Variables.

In order to use the value of a predefined variable together with an external interpreter script you have to enter the variable name and the variable value.

In order to be able to use :REGISTER_VARIABLE, the external interpreter scripts have to be defined by the administrator in the system variables (Job Includes see Include Object (JOBI)) respectively.

The administrator should also register the external interpreters in the system variables UC_EXT_INTERPRETERS_WINDOWS or UC_EXT_INTERPRETERS_UNIX respectively.

Variables that are registered with :REGISTER_VARIABLE are limited to 1023 characters. Variables that are longer are truncated to 1023 characters without notice.

Settings used in the Process Tab of the Job object (JOBS) in this context will be overridden by a script in the parent Workflow object, in case the Job object is part of a workflow.

:REGISTER_VARIABLE must be used for jobs and external interpreters in order to store a variable, but the command can also be used in regular Windows/UNIX jobs to store variables in the Automation Engine.

Examples

The Windows example below stores a variable named FOO with the value of the date, which was set at runtime.

date /T > tmp.txt
set /p FOO=<tmp.txt
:REGISTER_VARIABLE FOO#, %FOO%

When you define an external interpreter, you need to copy the register.variables element to its own client. The Automation Engine will use your version and will not overwrite it when delivering new initial data. A Perl example is shown below:

:if &$EXT_INTERPRETER# = 'PERL' or 'perl' or 'Perl'
system("&UC_PATH_JOBMD# JNR=&UC_REALNR MNR=&UC_MANDANT PNR=&UC_IP_PORT IPA=&UC_IP_ADR TYP=V VTYPE=T NAME=&uc_register_varname VALUE=\"&uc_register_valuename\"");
:else
...
:endif

See also: