Examples: Using IDIJAVA DD and IDIJAVA IDIOPTS

This topic shows how to use IDIJAVA DD and IDIJAVA IDIOPTS to provide Java application source information to Fault Analyzer in different scenarios.

BPXBATCH/BPXBATSL

To use the IDIJAVA 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-…
/*
//IDIJAVA DD  PATHOPTS=ORDONLY,
// PATH='/u/hunter2/src'
//        DD PATHOPTS=ORDONLY,
// PATH='/opt/apis/coffee-src.jar'

The IBM® JZOS batch launcher

Using the IDIJAVA DD with the JZOS batch launcher is the same as for BPXBATSL: specify theIDIJAVA 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 IDIJAVA 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.
//*
...
//IDIJAVA PATHOPTS=ORDONLY,
// PATH=&QQ.&SRCPART3/Version1/.QQ.

Using the IDIJAVA option

The IDIJAVA option can be specified system-wide in parmlib member IDICNF00, or it can be specified on a specific job step using the IDIOPTS DD:
//IDIOPTS DD *
 Datasets(
   IDIJAVA(
         -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.IDIOPTS  DD DATA,DLM='##',SYMBOLS=JCLONLY                                                
  datasets(idijava(                                  
                   /01xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +            
                   /02xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +           
                   /03xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +           
                   /04xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +           
                   /05xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +           
                   /06xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +           
                   /07xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +           
                   /08xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +           
                   /09xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +           
                   /10xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx))