Include Objects in Headers and Trailers

Client 0 provides predefined Job headers and trailers for Operating Systems, platforms and applications that integrate with the Automation Engine. These headers and trailers are supplied in the form of Includes (JOBI). The Includes are stored in the HEADER and TRAILER folders that are available by default in the Process Assembly perspective. Use these Includes to define actions that you want to be carried out always in the Jobs of the corresponding Operation System, platform or application. One of the actions of the headers is calling the Agent Job Messenger (JOBMD) to run and monitor Jobs. The script of the trailer is processed when the Job has finished. It provides information about the status of the Job and lets you specify post processing actions.

In the code of the header and trailer Includes, other Includes (user Includes) are embedded. However, user Includes are not provided by default with the Automation Engine. If you want to use them, you must create them first. If you do not want to use them, the nofound=ignore parameter that is applied to them by default ensures that they are ignored.

As a developer and object designer, you create the user Includes to adapt the processing of Jobs to your infrastructure.

Notes:

Example of a Windows header JOBI

The following graphic illustrates the structure of a Windows header and trailer. It indicates at which stages of the Job execution the different elements of the header apply:

Windows header:

:set &UC_WIN_TYP = get_att(WIN_TYP)

:IF &UC_WIN_TYP = "BAT"

:   set &UC_REM_PRF = 'REM '

:else

:   set &UC_REM_PRF = "' "

:endif

:INC HEADER.WINDOWS.USER.PRE ,nofound=ignore

:INC_SCRIPT(1)

:INC HEADER.WINDOWS.USER.HEAD ,nofound=ignore

:INC ATTRDIA.WINDOWS

:set &UC_REALNR  = SYS_ACT_RESTART_ME_NR

:set &UC_NAME    = SYS_ACT_JOBNAME

:set &UC_MANDANT = SYS_ACT_CLIENT

:IF &UC_WIN_TYP = "BAT"

:set &UC_JOBMD   = get_var(UC_EX_JOB_MD)

:set &UC_IP_PORT = get_var(UC_EX_IP_PORT)

:set &UC_IP_ADR  = get_var(UC_EX_IP_ADDR)

:if str_find(&UC_JOBMD, ' ') GT 0

:  set &UC_JOBMD = '"&UC_JOBMD"'

:endif

@echo on

&UC_JOBMD JNR=&UC_REALNR MNR=&UC_MANDANT PNR=&UC_IP_PORT IPA=&UC_IP_ADR TYP=S TXT="        Job started"

:DATA @set retcodemsg=%errorlevel%

:DATA @set retcode=0

:DATA @if NOT %retcodemsg% == 0 GOTO :MSGABORT

:ENDIF

:INC HEADER.WINDOWS.USER.START ,nofound=ignore

Windows trailer:

:INC TRAILER.WINDOWS.USER.END ,nofound=ignore

:IF &UC_WIN_TYP = "BAT"

&UC_JOBMD JNR=&UC_REALNR MNR=&UC_MANDANT PNR=&UC_IP_PORT IPA=&UC_IP_ADR TYP=E RET=00000000 TXT="        Job ended"

:DATA @set retcodemsg=%errorlevel%

:DATA @set retcode=0

GOTO JOBENDE

:DATA :RETCODE

&UC_JOBMD JNR=&UC_REALNR MNR=&UC_MANDANT PNR=&UC_IP_PORT IPA=&UC_IP_ADR TYP=E RET=%retcode% TXT="        Job ended with retcode"

:DATA @set retcodemsg=%errorlevel%

GOTO JOBENDE

:DATA :ABEND

:ENDIF

:INC TRAILER.WINDOWS.USER.ABEND ,nofound=ignore

:IF &UC_WIN_TYP = "BAT"

&UC_JOBMD JNR=&UC_REALNR MNR=&UC_MANDANT PNR=&UC_IP_PORT IPA=&UC_IP_ADR TYP=E RET=00000100 TXT="        controlled job cancel"

:DATA @set retcodemsg=%errorlevel%

:DATA @set retcode=100

:DATA :JOBENDE

:DATA @if NOT %retcodemsg% == 0 GOTO :MSGABORT

:DATA @exit %retcode%

:ENDIF

:IF &UC_WIN_TYP = "BAT"

:DATA :MSGABORT

! because the UC4:jobmessenger failed to communicate to the UC4:Agent

! the job is terminated with the exit code of the UC4:jobmessenger

:DATA @echo ATTENTION - UC4:JOBMESSENGER failed

:DATA @echo JOB ended with RETCODE %retcode%

:DATA @echo JOBMSG ended with RETCODE %retcodemsg%

:DATA @echo JOB will abort with RETCODE from JOBMSG step

:DATA @exit %retcodemsg%

List of Header and Trailer Includes with User Includes

BS2000

JMX

NSK

z/OS

OS/400

PeopleSoft

RA

SAP

SAP BW

Siebel

SQL

UNIX

VMS

Windows

See also: