Starting an agent on z/OS
On z/OS® in addition to running the fteStartAgent command from a UNIX System Services session, you can start an agent as a started task from JCL without the need for an interactive session. A started task is used because it runs under a specific user ID and is not affected by end users logging off.
Sample JCL
The following sample JCL is provided. These samples are installed in the samples/JCL subdirectory when you install WebSphere® MQ File Transfer Edition on z/OS.Sample name | Function |
---|---|
BFGXSAG | Runs an agent as a job step by using BPXBATCH without a logon shell. |
BFGYSAG | Starts an agent as a background process by using BPXBATCH. The agent continues running after the job step completes. |
BFGYSAGF | Runs an agent as a job step by using BPXBATCH with a logon shell. This is typically the most straightforward to configure. |
BFGZSAG | Runs an agent as a job step by using the JZOS Batch Launcher. This is the preferred option if you want to run the agent as a started task, rather than a normal batch job step. |
Example
//AGENT1 PROC
//*
//******************************************************************
//* Start the agent AGENT1 using JzOS batch launcher
//******************************************************************
//*
//WMQFTE EXEC PGM=JVMLDM60,REGION=0M,PARM='+T'
//STEPLIB DD DSN=SYS1.SIEALNKE,DISP=SHR
// DD DSN=MQM.V701.SCSQAUTH,DISP=SHR
// DD DSN=MQM.V701.SCSQANLE,DISP=SHR
// DD DSN=MQM.V701.SCSQLOAD,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
//STDENV DD DISP=SHR,DSN=FTEUSER.FTE.JCL(STDENV)
//MAINARGS DD DISP=SHR,DSN=FTEUSER.FTE.JCL(MAINARGS)
//*
//*-----------------------------------------------------------------
// PEND
//*-----------------------------------------------------------------
//*
//
The STEPLIB in the JCL adds SYS1.IEALNKE, the JZOS batch launcher load module dataset, to the LINKLIB concatenation. When this procedure is added to a library in the PROCLIB concatenation the agent can be started by using the command s agent1
The STDENV DD executes a shell script that sets a number of environment variables needed by the JVM, WebSphere MQ, and WebSphere MQ File Transfer Edition. An example of the STDENV used is as follows:
# This is a shell script which configures
# any environment variables for the Java JVM.
# Variables must be exported to be seen by the launcher.
# Use PARM='+T' and set -x to debug environment script problems
set -x
. /etc/profile
#
# Java configuration (including MQ Java interface)
#
export FTE_JAVA_HOME="/java/java60_bit31_sr6/J6.0/"
export PATH="/bin:£{FTE_JAVA_HOME}/bin"
LIBPATH="/lib:/usr/lib:£{FTE_JAVA_HOME}/bin:£{FTE_JAVA_HOME}/bin/classic
LIBPATH="£{LIBPATH}:/mqm/V7R0M01/java/lib"
export LIBPATH
#
# FTE configuration
#
export FTE_PROD="/wmqi/mqfte703/V7R0M3"
export FTE_CONFIG="/u/FTEUSER/mqfte"
export _BPXK_AUTOCVT="ON"
#
# Select function to be executed (script names without fte prefix)
#
. £{FTE_PROD}/bin/fteBatch StartAgent
#
# Set JZOS parameters to FTE values
#
export IBM_JAVA_OPTIONS="£{FTE_JAVA_OPTIONS}"
export JZOS_MAIN_ARGS="£{FTE_MAIN_ARGS}"
The MAINARGS DD contains the arguments passed to the command StartAgent named in STDENV. Using the -F parameter makes the agent run in the foreground. If you omit this parameter, the started task terminates and the agent is not started.
-F AGENT1