Passing input parametres thru jcl to java pgm using BPXBATCH

Discussions regarding Open Source Java projects under z/OS (other than Tomcat)
Post Reply
Sujatha Gowda
Posts: 2
Joined: Tue Jun 17, 2008 5:47 am

Passing input parametres thru jcl to java pgm using BPXBATCH

Post by Sujatha Gowda »

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......
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

We don't support BPXBATCH here. If you need help with it, you might try the mvs-oe mailing list.

If you want to use the JZOS Batch launcher, please check out the user's guide and if you have questions, please ask here and we'll try to help.
Post Reply