Using WebSphere MQ File Transfer Edition commands from JCL
On z/OS®, you can invoke WebSphere® MQ File Transfer Edition commands from JCL (Job Control Language) for integration into batch suites.
//WMQFTE EXEC PGM=JVMLDM50,REGION=0M,PARM='+T'
//STEPLIB DD DSN=FTEUSER.SIEALNKE,DISP=SHR JVMLDM50
// DD DSN=MQM.V700.SCSQAUTH,DISP=SHR MQ Bindings
// DD DSN=MQM.V700.SCSQANLE,DISP=SHR MQ Bindings
// DD DSN=MQM.V700.SCSQLOAD,DISP=SHR MQ Bindings
//SYSOUT DD SYSOUT=H
//SYSPRINT DD SYSOUT=H
//STDOUT DD SYSOUT=H
//STDERR DD SYSOUT=H
//STDENV DD *
# This is a shell script that 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 JAVA_HOME="/u/fteuser/J5.0"
export PATH="/bin:${JAVA_HOME}/bin"
LIBPATH="/lib:/usr/lib:${JAVA_HOME}/bin:${JAVA_HOME}/bin/classic"
LIBPATH="${LIBPATH}:/mqm/V7R0M0/java/lib"
export LIBPATH
#
# FTE configuration
#
export FTE_PROD="/u/fteuser/wmqfte"
export FTE_CONFIG="/u/fteuser/ftedata"
export _BPXK_AUTOCVT="ON"
#
# Select function to be executed (script names without fte prefix)
#
. ${FTE_PROD}/bin/fteBatch CreateTransfer
#
# Set JZOS parameters to FTE values
#
export IBM_JAVA_OPTIONS="${FTE_JAVA_OPTIONS}"
export JZOS_MAIN_ARGS="${FTE_MAIN_ARGS}"
//MAINARGS DD *
-w
-sa Z1
-da Z1 -ds "//'FTEUSER.XFERED.JUPITER'" -de overwrite
"//'FVTUSER.FVT.JUPITER01'"
/*
In this example the EXEC statement invokes the JZOS Batch Launcher. The parameter value +T produces details of the environment setup script execution to SYSOUT. If you do not need diagnostic information, omit this parameter. The STEPLIB DD statement provides access to JVMLDM50, the batch launcher, and WebSphere MQ bindings routines. STDOUT and STDERR contain any output from the executed function. STDENV contains a script that sets up the execution environment for the batch launcher. The first section sets up the Java™ execution environment, which is unique to each site.
The FTE configuration section exports the required variables and invokes the fteBatch script to complete the configuration for the function requested. The function is supplied as a not case-sensitive parameter to the script. The function values are the script command names without the fte prefix, for example fteCreateTransfer becomes CreateTransfer. Finally, the script exports the resulting values into the JZOS Batch Launcher environment variables.
The final MAINARGS DD statement provides the command parameters. In the example, a single data set is transferred from agent Z1 to agent Z1. The -w parameter is included so that the step waits for the transfer command to complete. The step return code contains the return code from the invoked function.
Trace any of the fte commands by using the -trace parameter in the final MAINARGS DD statement. For more information, see Tracing commands.