Step 2 – Using the IBM SQLJ Translator GENPROF
Execute the sqlj.tools.Sqlj Java class through the IBM JZOS Batch Launcher using the SQL program translated in the previous step as input. The Java class sqlj.tools.Sqlj is provided with the IBM JDBC/SQLJ driver for Db2 for z/OS. The IBM SQLJ translator has a similar function as a Db2 precompiler for Assembler or COBOL. The translator allows the embedded SQL statements in a program to be executed statically with Db2. The main difference is that the SQLJ translator generates both a serialized profile and a modified version of the input program as output. Another important difference is that the IBM SQLJ translator does not generate a DBRM file. For details about the IBM SQLJ translator, please refer to appropriate IBM documentation.
JCL Example
// SET CLASS='HELLO'
// SET STATPATH='/opt/softwareag/jpz/jpz-compiler/output'
//*-------------------------------------------------------------------
//GENPROF EXEC PROC=&JVM64,REGSIZE=1024M,COND=(0,NE,JVMCOMP.JAVAJVM),
// JAVACLS='sqlj.tools.Sqlj'
//MAINARGS DD *,SYMBOLS=JCLONLY
-compile=true -d=&STATPATH
&STATPATH./&CLASS..sqlj
//STDENV DD DISP=SHR,DSN=&CONFIG
//STEPLIB DD DISP=SHR,DSN=&MLCLIB
// DD DISP=SHR,DSN=&ASMLIB
//LICJPZBT DD DISP=SHR,DSN=&JPZLIC