Start of change

DSN_WLM_APPLENV stored procedure

This procedure provides a convenient way to define, install, and activate a new WLM application environment for DB2®.

Environment

DSN_WLM_APPLENV runs in a WLM-established stored procedures address space.

Authorization

To execute the CALL DSN_WLM_APPLENV statement, the owner of the package or plan that contains the CALL statement must have one or more of the following privileges on each package that the stored procedure uses:

  • The EXECUTE privilege on the DSN_WLM_APPLENV stored procedure
  • Ownership of the stored procedure
  • SYSADM authority

If the RACF® facility class is active and a profile has been defined for the MVSADMIN.WLM.POLICY facility class, then the caller of the stored procedure needs the following access:

  • ACCESS(READ) for action WLMINFO:
    PERMIT MVSADMIN.WLM.POLICY CLASS(FACILITY) ID(user) ACCESS(READ)
  • ACCESS(UPDATE) for action ADD, ADD_ACTIVATE, ACTIVATE:
    PERMIT MVSADMIN.WLM.POLICY CLASS(FACILITY) ID(user) ACCESS(UPDATE)

Syntax

Read syntax diagram
>>-CALL--------------------------------------------------------->

>--DSN_WLM_APPLENV--(--action--,--policyid--,--wlmoptions--,--return-code--,--message--)-><

Procedure parameters

ACTION
An input parameter of type VARCHAR(20) that identifies the type of action to be performed. This is a required parameter and supports the following values:
ACTIVATE
The stored procedure activates a WLM service policy.
ADD
The stored procedure installs a new WLM application environment to an existing WLM service definition without activating a service policy. The new WLM application environment becomes available only on the next activation of a WLM policy.
ADD_ACTIVATE
The stored procedure installs a new WLM application environment to an existing WLM service definition and automatically activates a WLM service policy to enable the new WLM application environment.
WLMINFO
The stored procedure queries the existing WLM service definition and returns basic information. Examples of the information returned include:
  • The service definition name
  • The timestamp in the local time the service definition was installed
  • The user ID of the service administrator that installed the service definition
  • The name of the system on which the service definition was installed from
  • The number of application environment currently defined
If the any action other than ACTIVATE or WLMINFO is specified, the WLMOPTIONS input parameter is also required.
POLICYID
An input parameter of type VARCHAR(8) that identifies the WLM service policy to be activated. It can be 1-8 characters long or the word ACTIVE. If the policy specified is ACTIVE, the active service policy is used. This parameter is required if any of the following actions is specified:
  • ACTIVATE
  • ADD_ACTIVATE

Otherwise, it is ignored and can be set to NULL or an empty string.

WLMOPTIONS
An input parameter of type VARCHAR(4000).

This parameter with the WLMNAME parameter is required if any of the following actions is specified, and other WLM parameters are not valid:

  • ADD
  • ADD_ACTIVATE

The following WLM options are supported. Separate multiple options by one or more spaces.

WLMNAME(name)
WLMNAME is the defined name for an application environment. It can be 1-32 characters long. It cannot begin with the letters SYS. This is a required option.
DESCRIPTION(description)
DESCRIPTION is a 32-character area describing the application environment. This option is not required and can be set to an empty value. For example,
DESCRIPTION()
PROCNAME(procedure-name)
PROCNAME defines the JCL procedure that WLM uses to start server address spaces for the application environment. It can be 1-8 characters long. This is a required option.
STARTPARM(start-up-parameters)
STARTPARM contains the parameters that WLM uses to start the JCL procedure. The parameters can be up to 115 characters. If the parameters include the subsystem name, the symbol &IWMSSNM can be used to cause WLM to substitute the subsystem name instead of typing the subsystem name directly. This option is useful because multiple instances of the subsystem with different names can use the application environment. For example:
STARTPARM(DB2SSN=&IWMSSNM,APPLENV=WLMENV1,NUMTCB=1)
This option is not required and can be set to an empty value.
WLMOPT(WLM_MANAGED|SINGLE_SERVER)
WLMOPT tells WLM to limit the number of server address spaces. For example, if a server address space requires exclusive use of a resource, only a single address space can exist. For DB2 routines, you can set a limit of 1 address space per system if required by the routine. Note that if there are multiple DB2 subsystems on a given system, WLM creates 1 server for each DB2 subsystem that calls the routines. A limit of 1 address space per sysplex does not apply to DB2 routines.

This option is not required and can be set to an empty value. The default is WLM_MANAGED.

Examples

Example: Returning the basic information of the WLM service definition:
CALL SYSPROC.DSN_WLM_APPLENV('WLMINFO', NULL, NULL, ?, ?)
Here is an example of the output:
RETURN_CODE: 0
MESSAGE: DSNT051I DSNTWLMS ACTIVE WLM SERVICE DEFINITION
           SERVICE DEFINITION NAME     WLMSAMPL
           INSTALLED ON                2010-01-25-07.11.57.764052
           INSTALLED BY                SYSADM
           INSTALLED FROM              LABEC130
           NUMBER OF APPL ENVIRONMENT  12
DSNT023I DSNTWLMS DISPLAY WLM INFORMATION SUCCESSFUL
Example: Identifying the action and WLM options:
CALL SYSPROC.DSN_WLM_APPLENV('ADD_ACTIVATE',
                             'ACTIVE',
                             'WLMNAME(DSNWLM_SAMPLE)
                              DESCRIPTION(DB2 SAMPLE WLM ENVIRONMENT)
                              PROCNAME(DSNWLMS)
                              STARTPARM(DB2SSN=&IWMSSNM,APPLENV=''DSNWLM_SAMPLE'')
                              WLMOPT(WLM_MANAGED)', ?, ?)
Here is an example of the output:
RETURN_CODE: 0
MESSAGE: DSNT023I DSNTWLMS ADD WLM APPLICATION ENVIRONMENT DSNWLM_SAMPLE SUCCESSFUL

 APPLICATION ENVIRONMENT NAME : DSNWLM_SAMPLE
 DESCRIPTION                  : DB2 SAMPLE WLM ENVIRONMENT
 SUBSYSTEM TYPE               : DB2
 PROCEDURE NAME               : DSNWLMS
 START PARAMETERS             : DB2SSN=&IWMSSNM,APPLENV='DSNWLM_SAMPLE'

STARTING OF SERVER ADDRESS SPACES FOR A SUBSYSTEM INSTANCE:
  (x) MANAGED BY WLM
  ( ) LIMITED TO A SINGLE ADDRESS SPACE PER SYSTEM
  ( ) LIMITED TO A SINGLE ADDRESS SPACE PER SYSPLEX

  DSNT023I DSNTWLMS ACTIVATE WLM POLICY WLMPOLY1 SUCCESSFUL
End of change