Hi...
I am passing some arguments via the jcl invoking BPXBATCH utility to JAVA-DB2 program (main class) using PARM.
The run jcl used for generating Batch report is as follows:
//JAVABAT JOB 43312,'JAVA PROGRAM',REGION=0M,
// CLASS=E,MSGCLASS=X,NOTIFY=&SYSUID,TIME=NOLIMIT
//**************************************************************
//* TO EXECUTE A JAVA BATCH PROGRAM
//**************************************************************
//INIT SET JAVA='java'
// SET CLASS='/adms/bchpg/RpCtyUsargs/RpCtyUsargs.class'
// SET ARGS='2007-08-28 2008-12-09 2222222222'
//STEP1 EXEC PGM=BPXBATCH,
// PARM='SH &JAVA &CLASS &ARGS'
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//STDIN DD PATH='/adms/bchpg/RpCtyUsargs/RpCtyUsargs.stdin1',
// PATHOPTS=(ORDONLY)
//STDOUT DD PATH='/adms/bchpg/RpCtyUsargs/RpCtyUsargs.stdout1',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// PATHMODE=(SIRWXU,SIRWXG,SIRWXO)
//STDERR DD PATH='/adms/bchpg/RpCtyUsargs/RpCtyUsargs.stderr1',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// PATHMODE=(SIRWXU,SIRWXG,SIRWXO)
**********************************************************
i am able to receive the arguments passed from the jcl in the java main class but the problem i m facing is that, it is throwing an exception while loading the DB2 driver as "Javaclassnotfoundexception.com.ibm.db2.jcc.DB2Driver" eventhough the classpath has been included in the stdin1 file.
It works well if i wont pass any arguments.
The attachment below is the STDIN1 file contents (environment variables):
export JAVA_HOME=/usr/lpp/zWebSphere/V6R0/java/J1.4
export PATH=/bin:"${JAVA_HOME}"/bin
LIBPATH=/lib:/usr/lib:"${JAVA_HOME}"/lib
LIBPATH=/lib:/usr/lib:"${JAVA_HOME}"/bin
LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin/classic
export LIBPATH="$LIBPATH":
# Customize your CLASSPATH here
export APP_HOME="${JAVA_HOME}"/lib
CLASSPATH=$APP_HOME
# Add Application required jars to end of CLASSPATH
for i in "${APP_HOME}"/*.jar; do
CLASSPATH="$CLASSPATH":"$i"
done
export CLASSPATH="$CLASSPATH":
export CLASSPATH="$CLASSPATH":"$JAVA_HOME"
# Add DB2 Driver required jars to end of CLASSPATH
export JCC_HOME=/usr/lpp/db2810/jcc/classes
for i in "${JCC_HOME}"/*.jar; do
CLASSPATH="$CLASSPATH":"$i"
done
export CLASSPATH="$CLASSPATH":
echo $CLASSPATH
echo $LIBPATH
echo $APP_HOME
echo $JCC_HOME
# Configure JVM options
IJO="-Xms16m -Xmx128m"
export IBM_JAVA_OPTIONS="$IJO "
*****************************************************
Is there any relation between the PARM and environment variables just like JZOS_MAIN_ARGS in JZOS???
Kindly help me out in this regard......
Passing input parametres thru jcl to java pgm using BPXBATCH
-
- Posts: 2
- Joined: Tue Jun 17, 2008 5:47 am