JZOS_MAINARGS_DD & JZOS_MAINARGS

General discussion on the JZOS batch launcher and toolkit
Post Reply
Kodax
Posts: 1
Joined: Sat Apr 22, 2017 2:38 am

JZOS_MAINARGS_DD & JZOS_MAINARGS

Post by Kodax » Sat Apr 22, 2017 3:12 am

Hi there,

I have been following the direction of the JZOS guide from http://publibfp.dhe.ibm.com/epubs/pdf/ajvc0120.pdf. However, I am having trouble trying to pass the additional arguments as there is a restriction of 100 bytes are allowed to be passed in a single argument. The documentation states that I am able to use JZOS_MAINARGS_DD or JZOS_MAINARGS to help cater for this restriction. But I have been hitting some syntax issues and the arguments are not being passed.

I have sanitized part of the script. Any help will be greatly appreciated.

Below is the proc script:
//JVMPRC86 PROC
//*JVMPRC86 PROC JAVACLS='<class name>',
//* ARGS=<first argument>
//* ARG1=<second argument>
//* ARG1=<third argument>
//* ARG2=<fourth argument>
//* ARG3=<fifth argument>
//* LIBRARY=<input here>,
//* VERSION='86',
// LOGLVL='',
//* REGSIZE='0M'
// LEPARM=''
//*JAVAJVM EXEC PGM=JVMLDM&VERSION,REGION=&REGSIZE
//JAVAJVM EXEC PGM=JVMLDM86,REGION=0M
// PARM='&LEPARM &LOGLVL'
//STEPLIB DD DSN=<input here>,DISP=SHR
//MAINQRGS DD * < OPTIONAL - Alt. method to supply args
PARA1 value
PARA2 value
PARA3 value
PARA4 value
PARA5 value
//SYSPRINT DD SYSOUT=* < System stdout
//SYSOUT DD SYSOUT=* < System stderr
//STDOUT DD SYSOUT=* < Java System.out
//STDERR DD SYSOUT=* < Java System.err
//CEEDUMP DD SYSOUT=*
//ABNLIGNR DD DUMMY

Below is the JCL script:
//JAVA EXEC PROC=JVMPRC86
//STDENV DD *
# This is a shell script which configures
# any environment variables for the Java JVM.
# Variables must be exported to be seen by the launcher.

. /etc/profile
export JAVA_HOME=/usr/lpp/java/J8.0_64

export PATH=/bin:"${JAVA_HOME}"/bin

LIBPATH=/lib:/usr/lib:"${JAVA_HOME}"/bin
LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390x
LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390x/j9vm
LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin/classic
export LIBPATH="$LIBPATH":

# Customize your CLASSPATH here
APP_HOME=$JAVA_HOME
CLASSPATH=$APP_HOME:"${JAVA_HOME}"/lib:"${JAVA_HOME}"/lib/ext
a=<class path>
# Add Application required jars to end of CLASSPATH
for i in "${APP_HOME}"/*.jar; do
CLASSPATH="$CLASSPATH":"$i"
done
export CLASSPATH="$CLASSPATH":

# Set JZOS specific options
# Use this variable to specify encoding for DD STDOUT and STDERR
export JZOS_OUTPUT_ENCODING=cp1047
# Use this variable to prevent JZOS from handling MVS operator commands
#export JZOS_ENABLE_MVS_COMMANDS=false
# Use this variable to supply additional arguments to main
#export JZOS_MAIN_ARGS=""
# Configure JVM options
IJO="-Xms16m -Xmx128m"
# Uncomment the following to aid in debugging "Class Not Found" problems
#IJO="$IJO -verbose:class"
# Uncomment the following if you want to run with Ascii file encoding..
IJO="$IJO -Dfile.encoding=ISO8859-1"
export IBM_JAVA_OPTIONS="$IJO "

Post Reply