WLM address space startup procedure for Java routines

The WLM address space startup procedure for Java routines requires extra DD statements that other routines do not need.

The following figure shows an example of a startup procedure for an address space in which Java routines can run. The JAVAENV DD statement indicates to Db2 that the WLM environment is for Java routines.

Figure 1. Startup procedure for a WLM address space in which a Java routine runs
//DSNWLM PROC RGN=0K,APPLENV=WLMIJAV,DB2SSN=DSN,NUMTCB=5,  1 
//       MNSPAS=0

//IEFPROC EXEC PGM=DSNX9WLM,REGION=&RGN,TIME=NOLIMIT,  
// PARM='&DB2SSN,&NUMTCB,&APPLENV,&MNSPAS'                 2 
//STEPLIB DD DISP=SHR,DSN=DSNC10.RUNLIB.LOAD  
// DD DISP=SHR,DSN=CEE.SCEERUN  
// DD DISP=SHR,DSN=DSNC10.SDSNEXIT  
// DD DISP=SHR,DSN=DSNC10.SDSNLOAD  
// DD DISP=SHR,DSN=DSNC10.SDSNLOD2  
//JAVAENV DD DISP=SHR,DSN=WLMIJAV.JSPENV                   3  
//JSPDEBUG DD SYSOUT=A                                     4  
//CEEDUMP DD SYSOUT=A  
//SYSPRINT DD SYSOUT=A  

Notes to Figure 1:

Note Explanation
 1  In this statement:
  • Change the DB2SSN value to your Db2 for z/OS® subsystem name.
  • Change the APPLENV value to the name of the application environment that you set up for Java stored procedures.
  • If your stored procedure address space runs routines in 31-bit Java virtual machines (JVMs), the recommended NUMTCB value is 5. For testing a Java stored procedure, NUMTCB=1 is recommended. With NUMTCB=1, only one JVM is started, so refreshing the WLM environment after you change the stored procedure takes less time.

    If your stored procedure address space runs routines in a 64-bit, multi-threaded environment, the recommended NUMTCB value is 25. The NUMTCB value specifies the number of concurrent stored procedure executions within the single JVM that runs in the stored procedure address space.

  • Change the MNSPAS value to the minimum number of stored procedure address spaces that WLM starts and maintains. Valid values are 0 to 50. If you specify 0, WLM starts and shuts down stored procedure address spaces as applications require them. Specify a value of greater than 0 if the overhead of starting and shutting down stored procedure address spaces and JVMs makes your response time unacceptable.
 2  DSNX9WLM is the program that is executed to run stored procedures in a 31-bit stored procedure environment. To run Java routines in a 64-bit, multi-threaded environment, change DSNX9WLM to DSNX9WJM.
 3  JAVAENV specifies a data set that contains Language Environment® run-time options for Java stored procedures. The presence of this DD statement indicates to Db2 that the WLM environment is for Java routines. This data set must contain the environment variable JAVA_HOME. This environment variable indicates to Db2 that the WLM environment is for Java routines. JAVA_HOME also specifies the highest-level directory in the set of directories that contain the SDK for Java.
 4  Specifies a data set into which Db2 puts information that you can use to debug your stored procedure. The information that Db2 collects is for assistance in debugging setup problems, and should be used only under the direction of IBM® Software Support. You should comment out this DD statement during production.