User Guide > Objects > Alphabetical Listing > REGISTER_VARIABLE.* - Register Variables or External Interpreters

REGISTER_VARIABLE.* - Register Variables or External Interpreters

The Include objects REGISTER_VARIABLE.WINDOWS and REGISTER_VARIABLE.UNIX are used to define external interpreters as well as variables and their values, which can be called from Job objects.

General

The variable definitions you set here will be called by the script statement :REGISTER_VARIABLE, which can be used in a Job object's Process tab (Windows or UNIX ).

If you intend to use external interpreter scripts in a Job object, you have to use them with the script statement :BEGIN_EXT_INTERPRETERS and :END_EXT_INTERPRETERS in the Process tab of a Job object (JOBS), available on Windows and UNIX.

These two objects are available in the system client 0000 and should be configured by the administrator. Their settings will be available system-wide.

Settings for these Include objects in any other client of the system will have priority in that particular client.

Make sure you copy the Include objects REGISTER_VARIABLE.WINDOWS and REGISTER_VARIABLE.UNIX from the system client's REGISTER folder into the same folder in any other client of the AE system, before you adapt them to your needs.
Explanation:
After delivery of new initial data by Automic, these Include objects in the system client will be overwritten with the default data.

Description

The two Include objects may be used similar to other Include objects in the Automation Engine. For particulars about the available tabs see the general chapter on Include objects.

Default Script Windows

The Include object REGISTER_VARIABLE.WINDOWS is delivered with the following default script:

:set &uc_register_varname = sys_last_registered_varname()
:set &uc_register_valuename = sys_last_registered_valuename()
:set &uc_register_otype# = sys_act_me_type()
:if &uc_register_otype# = 'JOBS'
: set &uc_windows_typ = get_att(win_typ)
: IF &UC_WINDOWS_TYP = "BAT"

&UC_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
: ENDIF
!:DATA @set retcodemsg=%errorlevel%
!:DATA @set retcode=0
!:DATA @if NOT %retcodemsg% == 0 GOTO :MSGABORT
: ENDIF
:endif

 

Example: Perl as external interpreter on Windows:

If you want to use Perl as an external interpreter on Windows, you would enter the following script in the default script above between the :IF and :ENDIF statements resolving the &UC_WINDOWS_TYP variable:

:  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

Default Script UNIX:

The Include object REGISTER_VARIABLE.UNIX is delivered with the following default script:

:set &uc_register_varname = sys_last_registered_varname()
:set &uc_register_valuename = sys_last_registered_valuename()
:set &uc_register_otype# = sys_act_me_type()
:if &uc_register_otype# = 'JOBS'
&UC_JOBMD JNR=&UC_REALNR MNR=&UC_MANDANT PNR=&UC_IP_PORT IPA=&UC_IP_ADDR TYP=V VTYPE=T NAME=&uc_register_varname VALUE=&uc_register_valuename
:endif

 

See also:

:BEGIN_EXT_INTERPRETER... :END_EXT_INTERPRETER
:REGISTER_VARIABLE
Job object
Job Includes
How to use an External Interpreter