OPERTUNE allows you to invoke the batch interface from batch and from a REXX EXEC/CLIST.
Batch
The DDTBATCH member of the OPERTUNE control data set contains sample JCL that you can use to submit commands to OPERTUNE from batch. For example, this might be useful for setting a group of elements before running a workload and resetting them after the workload is complete. The person submitting the job must have the proper OPERTUNE authority to execute the commands.
Batch interface utility JCL
Click here to expand...
//BATCHCMD JOB (ACCT),'BATCH JOB INTERFACE',CLASS=A,MSGCLASS=X
//*
//**********************************************************************
//*
//* OPERTUNE BATCH JOB INTERFACE UTILITY
//*
//* THIS UTILITY CAN BE USED TO ISSUE OPERTUNE COMMANDS FROM A
//* BATCH ENVIRONMENT. THIS IS USEFUL FOR SETTING A SET OF ELEMENTS
//* PRIOR TO RUNNING A WORKLOAD AND RESETTING THEM BACK AFTER THE
//* WORKLOAD IS COMPLETE.
//*
//* CHANGE HLQ1 TO A HIGH-LEVEL QUALIFIER FOR THE OPERTUNE LOAD LIBRARY
//*
//* DDNAME SYSIN SHOULD CONTAIN THE OPERTUNE COMMANDS TO BE ISSUED.
//* THE COMMAND MAY BE 80 BYTES LONG AND CAN EXTEND INTO COLUMNS 72-80,
//* THEREFORE THESE COLUMNS SHOULD EITHER CONTAIN COMMAND TEXT OR BE
//* BLANK. COMMANDS CAN BE CONTINUED TO THE NEXT LINE. A '-' IS THE
//* CONTINUATION CHARACTER.
//*
//* DDNAME SYSPRINT WILL CONTAIN THE RESPONSES TO THOSE COMMANDS
//*
//*
//**********************************************************************
//*
//BATCH EXEC PGM=DDTKBTCH
//STEPLIB DD DSN=HLQ1.LOAD,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
OPERTUNE COMMANDS GO HERE - EXAMPLES ARE AS FOLLOWS
IN(DBBM) SET SORTPOOL(+7%)
IN(DFA2) FREE(DSNDFA,DDTDB2AA,DDTTSA1) SYNC
F DDT3,IN(DFA1) -
ADDLOG(DSNDFA.DFA1.LOGCOPY1.DS06,DSNDFA.DFA1.LOGCOPY2.DS06) -
POSITION(NEXT)
IN(DEAA@OPRX) CANCEL(CONN(TSO) AUTH(RDHJCT2) ASID(0041) -
CORR(RDHJCT2) PLAN(DSNESPRR))
//*
The batch interface checks each input command for the presence of a target specifier. The specifier is optional if only one OPERTUNE is active on the MVS system on which the job is running. If more than one OPERTUNE is active and you omit the target specifier, you will receive an error message
Issue commands as you would from any MVS console:
F opertuneID,command
- opertuneID is the OPERTUNE system profile name (if OPERTUNE is running as a started task) or the job name of the batch job (if OPERTUNE is running as a batch job)
- command is the command you want to issue
When using the batch interface, verify the following conditions:
- The OPERTUNE load libraries are specified in a STEPLIB DD statement, if they are not in the LNKLST.
- The SYSIN ddname contains the commands to be issued. A command in a column can be continued to the next line with a dash (-) designating a continuation of that command.
- The SYSPRINT ddname contains the command responses.
CLIST
The DDTBCLST member of the OPERTUNE CNTL library contains a sample CLIST from which you can execute a REXX/CLIST to invoke the batch interface for OPERTUNE.
Batch REXX/CLIST
Click here to expand...
PARSE UPPER ARG _ACTION _ELEMENT /* GET PARMS */
_OPTSSID = &&SSID /* <====CHG TO YOUR SSID */
_OPTLOAD = "'&&LOAD" /* <====CHG TO YOUR LOADLIB */
ISSUECMD:
"ALLOC F(SYSPRINT) DA(*) NEW,REUSE" /* OUTPUT TO TERMINAL */
"ALLOC F(SYSIN) NEW,REUSE, /* SYSIN TO TEMP DS */
DSORG (PS), /* PHYSICAL SEQ */
RECFM(F B) LRECL(80) BLKSIZE(800)" /* FB 80 X 800 */
/* */
_OPCMD.1 = 'F '_OPTSSID','_ACTION _ELEMENT /* ESTABLISH COMMAND */
"EXECIO 1 DISKW SYSIN (STEM _OPCMD. FINIS" /* PUT CMD IN 'SYSIN' */
TSOEXEC CALL _OPTLOAD||"(DDTKBTCH)'" /* */
"FREE F(SYSPRINT)" /* FREE SYSPRINT */
"FREE F(SYSIN)" /* FREE SYSIN */
EXIT 0 /* END */
Example
This example illustrates how to execute a REXX/CLIST to invoke the batch interface.
By using the REXX routines, OPERTUNE can validate a command before executing it. Assume an automated operations package that can execute CLISTs calls the CLIST in Batch interface CLIST to perform an OPERTUNE command based on a trigger, such as a message or a threshold. An exclusion list is built to reject the CANCEL THREAD command for specific threads, even though the automated package picked up a condition where, in most cases, the thread should be canceled.
Batch interface CLIST
Click here to expand...
/* REXX ------------------------------------------------------------ */
/* */
/* CHANGE &&SSID TO THE NAME OF YOUR OPERTUNE/DB2 SUBSYSTEM ID. */
/* CHANGE &&LOAD TO THE NAME OF YOUR OPERTUNE/DB2 LOAD LIBRARY. */
/* */
/* WHAT: */
/* EXAMPLE REXX/CLIST TO EXECUTE OPERTUNE/DB2 COMMANDS FROM A */
/* CLIST USING ONE OR TWO PARAMETERS. */
/* */
/* WHO: */
/* BMC SOFTWARE */
/* 2101 CITYWEST BLVD. */
/* HOUSTON, TX 77042 */
/* */
/* USAGE: */
/* TSO EX '&OPERTUNE_LOAD(DDTKBTCH)' 'IN(DB2X) SET ACCESS(MAINT)' */
/* TSO EX '&OPERTUNE_LOAD(DDTKBTCH)' 'IN(DB2X) QUERY ALL' */
/* TSO EX '&OPERTUNE_LOAD(DDTKBTCH)' 'IN(DB2X) CANCEL(CONN(*))' */
/* TSO EX '&OPERTUNE_LOAD(DDTKBTCH)' ' HISTORY' */
/* TSO EX '&OPERTUNE_LOAD(DDTKBTCH)' ' MAINT' */
/* ----------------------------------------------------------------- */
/* NOTE: DB2X ON THE COMMAND LINE SHOULD BE REPLACED WITH YOUR DB2 */
/* SUBSYSTEM NAME */
/* */
/* IF YOU ARE ENTERING 'OPERTUNE ONLY' COMMANDS, THERE */
/* MUST BE AT LEAST ONE SPACE BEFORE THE COMMAND */
/* SEE HISTORY AND MAINT COMMANDS ABOVE */
/* ----------------------------------------------------------------- */
/*TRACE ?R*/ /* UNCOMMENT FOR TRACE */
PARSE UPPER ARG _DB2 _ACTION _ELEMENT /* GET PARMS */
/* ================================================================= */
_OPTSSID = &&SSID /* <====CHG TO YOUR SSID */
_OPTLOAD = "'&&LOAD" /* <====CHG TO YOUR LOADLIB */
/* ================================================================= */
/* THIS GENERIC CLIST CAN BE ENHANCED TO EVALUATE AND RESTRICT THE */
/* COMMANDS PRIOR THEIR EXECUTION BY ADDING REXX CODE PRIOR TO THE */
/* 'ISSUECMD:' LABEL BELOW. AN EXAMPLE OF THE NEED FOR THIS WOULD */
/* BE AN AUTOMATED PACKAGE CAPABLE OF EXECUTING A CLIST BASED ON */
/* A TRIGGER, ATTEMPTING TO CHANGE A DB2 VALUE VIA THIS CLIST OUTSIDE*/
/* OF ACCEPTED TIMES FOR THAT VALUE TO BE CHANGED. */
/* - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* IN THE EXAMPLE BELOW, A CHECK IS BEING MADE TO STOP ANY 'CHKPTFRQ'*/
/* CHANGES TO 'DB2X' PRIOR TO 18:00 HOURS. */
/* ================================================================= */
/* */
/*IF SUBSTR(_DB2,4,4) = 'DB2X' THEN */
/* DO */
/* IF SUBSTR(_ACTION,1,3) = 'SET' THEN */
/* DO */
/* IF SUBSTR(_ELEMENT,1,8) = CHKPTFRQ THEN */
/* DO */
/* IF TIME('H') < 18 THEN */
/* DO */
/* SAY 'NO CHANGE OF CHKPTFRQ ON DB2X PRIOR TO 18:00 HRS.' */
/* EXIT */
/* END */
/* END */
/* END */
/* END */
/* ================================================================= */
ISSUECMD:
"ALLOC F(SYSPRINT) DA(*) NEW,REUSE, /* OUTPUT TO TERMINAL*/
LRECL(121)" /* OUTPUT TO TERMINAL */
"ALLOC F(SYSIN) NEW,REUSE, /* SYSIN TO TEMP DS */
DSORG (PS), /* PHYSICAL SEQ */
RECFM(F B) LRECL(80) BLKSIZE(800)" /* FB 80 X 800 */
/* */
_OPCMD.1 = 'F '_OPTSSID','_DB2 _ACTION _ELEMENT /* CMD */
"EXECIO 1 DISKW SYSIN (STEM _OPCMD. FINIS" /* PUT CMD IN 'SYSIN' */
TSOEXEC CALL _OPTLOAD||"(DDTKBTCH)'" /* */
"FREE F(SYSPRINT)" /* FREE SYSPRINT */
"FREE F(SYSIN)" /* FREE SYSIN */
EXIT 0 /* END */
Adding an archive log to the active list
The DDTKLOGU member of the OPERTUNE control data set is a utility that you can use to copy the content of an archive log data set to a predefined active log data set. This utility copies an archive log data set recorded in the subsystem BSDS before adding it to the list of active logs.
JCL to invoke the OPERTUNE copy log utility
//DDTKLOGU JOB (ACCT),'OPERTUNE COPYLOG',MSGCLASS=X,CLASS=A
//*
//* INVOKE THE OPERTUNE COPY LOG UTILITY
//*
//KLOGU EXEC PGM=DDTKLOGU
//STEPLIB DD DISP=SHR,DSN=HLQ1.LOAD <--- MODIFY
//DDTARCHV DD DISP=SHR,DSN=DSN1 <--- ARCHIVE LOG
//DDTACTV1 DD DISP=SHR,DSN=DSN2 <--- TARGET ACTIVE LOG1
//DDTACTV2 DD DISP=SHR,DSN=DSN3 <--- TARGET ACTIVE LOG2
//SYSPRINT DD SYSOUT=*
//SYSABEND DD SYSOUT=*
//*
To add an archive log to the active list, follow these steps:
- Identify the name of the archive log data set you want to copy by listing the names of the archive logs in the BSDS; select option 6 from the OPERTUNE Operational Assist Menu.
- Define the target active log data set (define two active log data sets if you are using dual logging). To define the active log data sets, use the Create Log Parameters panel, the CREATLOG command (see Creating active logs ), or IDCAMS.
Run the Copy Log utility (DDTKLOGU) to copy the archive log to the target active log(s).
Important
Before copying from the archive log to the active log, you may need to allocate more space to the active log than was originally allocated.
Add the newly created active log(s) to the list of active log data sets, using the ADDLOG command (see Adding-active-logs for command syntax). Use the LIKE keyword to specify the name of the archive data set identified in step 1. The new active log is added in RBA order, next to the current log.
Important
To prevent the subsystem from overwriting the active log containing archive data during a log switch, BMC recommends defining and adding a new set of active log data sets by using the ADDLOG command. Insert these new active logs directly after the active log. The new logs are used as a buffer between the current logs and the dearchived logs (added next to the current logs).
Failed to execute the [panel] macro.