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:

  • You need rights to Include objects (JOBI) to be able to execute Jobs
  • You can copy the header and trailer Includes from Client 0 to a different Client. If you do so, the Client Includes are applied. If the Client has no header and trailer Includes, the ones in Client 0 apply.
  • If you do not work with user Includes in headers and trailers, for performace reasons, your system administrator can deactivate this function. For more information, see DISABLE_USER_HEADER in the UC_SYSTEM_SETTINGS - Systemwide Settings.

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

  • Header Include

    HEADER.BS2000

  • Trailer Include

    TRAILER.BS2000

  • User Includes

    HEADER.BS2000.USER.PRE

    HEADER.BS2000.USER.HEAD

    HEADER.BS2000.USER.START

    TRAILER.BS2000.USER.END

    TRAILER.BS2000.USER.ABEND

JMX

  • Header Include

    HEADER.JMX

  • Trailer Include

    TRAILER.JMX

  • User Includes

    HEADER.JMX.USER.PRE

    HEADER.JMX.USER.HEAD

    HEADER.JMX.USER.START

    TRAILER.JMX.USER.END

NSK

  • Header Include

    HEADER.NSK

  • Trailer Include

    TRAILER.NSK

  • User Includes

    HEADER.NSK.USER.PRE

    HEADER.NSK.USER.HEAD

    HEADER.NSK.USER.START

    TRAILER.NSK.USER.END

z/OS

  • Header Include

    HEADER.MVS

  • Trailer Include

    TRAILER.MVS

  • User Includes

    HEADER.MVS.USER.PRE

    HEADER.MVS.USER.HEAD

    HEADER.MVS.USER.START

    TRAILER.MVS.USER.END

OS/400

  • Header Include

    HEADER.OS400

  • Trailer Include

    TRAILER.OS400

  • User Includes

    HEADER.OS400.USER.PRE

    HEADER.OS400.USER.HEAD

    TRAILER.OS400.USER.END

PeopleSoft

  • Header Include

    HEADER.PS

  • Trailer Include

    TRAILER.PS

  • User Includes

    HEADER.PS.USER.PRE

    HEADER.PS.USER.HEAD

    HEADER.PS.USER.START

    TRAILER.PS.USER.END

RA

  • Header Include

    HEADER.CIT

  • Trailer Include

    TRAILER.CIT

  • User Includes

    HEADER.CIT.USER.PRE

    HEADER.CIT.USER.HEAD

    HEADER.CIT.USER.START

    TRAILER.CIT.USER.END

SAP

  • Header Include

    HEADER.SAP

  • Trailer Include

    TRAILER.SAP

  • User Includes

    HEADER.SAP.USER.PRE

    HEADER.SAP.USER.HEAD

    HEADER.SAP.USER.START

    TRAILER.SAP.USER.END

SAP BW

  • Header Include

    HEADER.SAPBW

  • Trailer Include

    TRAILER.SAPBW

  • User Includes

    HEADER.SAPBW.USER.PRE

    HEADER.SAPBW.USER.HEAD

    HEADER.SAPBW.USER.START

    TRAILER.SAPBW.USER.END

SQL

  • Header Include

    HEADER.SQL

  • Trailer Include

    TRAILER.SQL

  • User Includes

    HEADER.SQL.USER.PRE

    HEADER.SQL.USER.HEAD

    HEADER.SQL.USER.START

    TRAILER.SQL.USER.END

UNIX

  • Header Include

    HEADER.UNIX

  • Trailer Include

    TRAILER.UNIX

  • User Includes

    HEADER.UNIX.USER.PRE

    HEADER.UNIX.USER.HEAD

    HEADER.UNIX.USER.START

    TRAILER.UNIX.USER.END

VMS

  • Header Include

    HEADER.VMS

  • Trailer Include

    TRAILER.VMS

  • User Includes

    HEADER.VMS.USER.PRE

    HEADER.VMS.USER.HEAD

    TRAILER.VMS.USER.END

Windows

  • Header Include

    HEADER.WINDOWS

  • Trailer Include

    TRAILER.WINDOWS

  • User Includes

    HEADER.WINDOWS.USER.PRE

    HEADER.WINDOWS.USER.HEAD

    HEADER.WINDOWS.USER.START

    TRAILER.WINDOWS.USER.END

    TRAILER.WINDOWS.USER.ABEND

See also: