Includes (JOBI)

Use Include objects to store blocks of code that you need frequently and that you want to reuse in multiple scripts. Include objects help you ensure that your scripts are consistent. They reduce your design and maintenance efforts. You reuse those blocks of code by entering :INCLUDE or :INC in the scripts of executable objects and selecting an Include object. This inserts the Include object in the script. For information about how to use Include objects in the script editor, see Using Include Objects in Scripts.

Tips:

This page includes the following:

Defining Include Objects

An Include object definition is made up of the following pages:

The script you write on the Process page is the block of script lines that you can reuse by inserting it into other objects.

Important Considerations

Configuring Include Objects for External Interpreter Calls

Client 0 includes two objects that you can use in your scripts to define external interpreters and their scripts:

Call these objects using the :REGISTER_VARIABLE statement. This statement must be combined with the :BEGIN_EXT_INTERPRETERS and :END_EXT_INTERPRETERS statements in the Process page of the Job. Both statements are available on Windows and UNIX.

Important! Contact your administrator to configure these two objects, as their settings are available system-wide.

Examples

Default Script (Windows)

The REGISTER_VARIABLE.WINDOWS Include object contains 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

Perl as external interpreter on Windows

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

: IF &$EXT_INTERPRETER# = 'PERL'
: SET &UC_PATH_JOBMD# = STR_SUB("&UC_JOBMD", "\", "\\")
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 REGISTER_VARIABLE.UNIX Include object contains 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: