Batch termination requires a JCL procedure to be created. The Thread Terminator for Db2 for z/OS (PTT) JCL can be executed using
an in-stream procedure or the procedure can be cataloged.
One of the following must be completed in order to create the JCL needed for batch termination:
1. Creating the JCL Using Thread Terminator
Thread Terminator can automatically create the JCL for batch termination of threads. The display can be accessed to create the batch JCL using one of the following methods:
2 Create the Batch JCL through ISPF panels.
To access the display to create the batch JCL, do one of the following:
To access the Batch Select display using thread filtering, follow these steps:
The Thread Terminator Batch Select display lets you specify the selection criteria for thread termination and the data set information for the JCL and control cards. This display appears whenever you invoke the create batch JCL option from the Thread Terminator Main Menu or from the Active Threads Display. Here is a sample of the Thread Terminator Batch Select display:
------------ Thread Terminator Batch Select ---- COMMAND ===> ----------------------------------------------------------------------- DB2 SSID ==> ssid SELECTION CRITERIA: You MUST specify at least one. Planname ==> ________ Connid ==> ________ Jobname => ________ Authid ====> ________ Corrid ==> ____________ OPTIONS: Asid ====> ____ (You may not specify a mask.) Term ====> SOFT ("SOFT" or "KILL". SOFT terminates a thread in DB2, KILL terminates a thread in MVS.) Dump ====> N ("N" produces no dump. "Y" produces output depending on the termination option: SOFT produces an SVC dump, KILL produces a SYSUDUMP.) DATASET/MEMBER SELECTION: Contents Member Data Set Name JCL ________ ________________________________________ Control Card ________ ________________________________________
Specify the parameters for thread termination in these fields. You must enter a name or mask in at least one of the following fields. For masks, you can use the underscore (_) as the single character wild card and the percent sign (%) for trailing values. If you specify more than one of these fields, the threads selected for termination are the logical 'AND' of the fields. If you accessed this display by using thread filtering, the fields are already filled in based on the thread filtering criteria. However, you can still edit the fields if necessary.
When you finish entering information in these fields, press Enter. The JCL appears in an ISPF edit session. To submit the batch termination immediately, enter SUBMIT in the command line. To exit without executing, press PF3 (End). When the JCL is executed, Thread Terminator issues an OS/390 termination request for the selected threads. This is equivalent to the KILL termination option.
3. Creating the JCL Manually
You can also enter the JCL into a data set for execution. The complete JCL procedure is described in this section.
The first part of the Thread Terminator JCL is shown in the following illustration:
[1] //jobname JOB (acct. info),'PTT',CLASS=x,MSGCLASS=y, // MSGLEVEL=(1,1),REGION=5M,NOTIFY=&SYSUID //* [2] //JOBLIB DD DSN=Db2 tools load library, DISP=SHR //* //PTTBATCH PROC //PTTBATCH EXEC PGM=PTLDRIVM,PARM='EP=PTTBTCCC',REGION=4096K [3] //PTILIB DD DISP=SHR,DSN=Db2 tools load library [4] //PTIPARM DD DSN=Db2 tools PARMLIB,DISP=SHR [5] //SYSUDUMP DD SYSOUT=* [6] //TTREPORT DD SYSOUT=* //SYSIN DD DUMMY // PEND The second part of the Thread Terminator JCL contains the parameters for thread termination.Enter the JCL as shown in the following illustration: [7] //PTTBATCH EXEC PTTBATCH,PARM='TEST' [8] //PTTBATCH.SYSIN DD * [9] * TERM SSID ASID AUTHID.. CONNID.. PLANNAME CORRID...... JOBNAME. XMAN KILL D41A PDREN% 0303 //
If more than one of these parameters is specified, the threads selected for termination are the result of a logical AND of the parameters.
The more information you specify on the control card, the more precise the termination. Use as many parameters as possible to ensure that you are terminating the appropriate threads.
The parameters and control card layout are described in the table in the following section. [9] card template-(Display only) This is a template card showing the parameters in the proper card column
positions to help you correctly input the parameters for the PTTBATCH.SYSIN card.
Before submitting the JCL ensure that Xmanager is active or the thread termination request will abend. Submit the Thread Terminator JCL as you would any other batch job.