Examples: Using HFZJAVA DD and HFZJAVA HFZOPTS

This topic shows how to use HFZJAVA DD and HFZJAVA HFZOPTS to provide Java™ application source information to Z Abend Investigator in different scenarios.

BPXBATCH/BPXBATSL

To use the HFZJAVA DD with BPXBATCH, the alternate entry point BPXBATSL must be used, as it allows spawned programs access to DD data set and path allocations.
//RUNJAVA EXEC PGM=BPXBATSL,REGION=500M
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
//STDPARM DD *
PGM /bin/sh java AnApp arg1 arg2
/*
//STDENV DD *
 CLASSPATH=<the application classpath>
 JAVA_HOME=<path to java> 
 LIBPATH=<paths to application DLLs>
 PATH=${PATH}:${JAVA_HOME}/bin
 IBM_JAVA_OPTIONS=-Xmx400m 
 JAVA_TOOL_OPTIONS=-agentlib-…
/*
//HFZJAVA DD  PATHOPTS=ORDONLY,
// PATH='/u/hunter2/src'
//        DD PATHOPTS=ORDONLY,
// PATH='/opt/apis/coffee-src.jar'

The IBM® JZOS batch launcher

Using the HFZJAVA DD with the JZOS batch launcher is the same as for BPXBATSL: specify theHFZJAVA DD on the JZOS batch launcher job step.
cd <JAVA_HOME>/mvstools
cp samples/jcl/JVMJCL80 "//’SYS1.SAMPLIB(JVMJCL80)’"
cp samples/jcl/JVMPRC80 "//’SYS1.PROCLIB(JVMPRC80)’"
cp -X JVMLDM80 "//’SYS1.SIEALNKE(JVMLDM80)’"

The batch launcher is included with Java for non-SMP/E installations of Java. For more information, refer to Java Batch Launcher and Toolkit for z/OS (JZOS) in the documentation for IBM® SDK, Java™ Technology Edition.

Specifying long path values with HFZJAVA DD

To specify paths longer than 72 characters in JCL, one option is to express the path using JCL symbols. For example:
//* Define each part of the path as a symbol:
// SET QQ='''' * This sets symbol &QQ. to a single quote
// SET SRCPART1='/u/hunter2/org/very/large/financial/'
// SET SRCPART2='organisation/JavaSourceFiles/prod'
// SET SRCPART3=&QQ.&SRCPART1.&SRCPART2&QQ.
//*
...
//HFZJAVA PATHOPTS=ORDONLY,
// PATH=&QQ.&SRCPART3/Version1/.QQ.

Using the HFZJAVA option

The HFZJAVA option can be specified system-wide in parmlib member HFZCNF00, or it can be specified on a specific job step using the HFZOPTS DD:
//HFZOPTS DD *
 Datasets(
   HFZJAVA(
         -dropcp-
           /u/hunter2/srcFiles 
          /u/hunter2/deps/dep2-src.jar
      )
   )
/*
Each path (represented here by "xxxxx…") must be separated by a space. Long paths can be continued across lines by specifying a '+' between each part of the path. Paths can be up to 1023 characters in length.
//GO.HFZOPTS  DD DATA,DLM='##',SYMBOLS=JCLONLY                                                
  datasets(hfzjava(                                  
                   /01xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +            
                   /02xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +           
                   /03xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +           
                   /04xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +           
                   /05xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +           
                   /06xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +           
                   /07xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +           
                   /08xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +           
                   /09xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +           
                   /10xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx))