IBM® Application Performance Analyzer for z/OS®(APA) can be integrated with any system monitoring tools that can trigger a console command in case of an event, such as IBM® OMEGAMON®. For example, to analyze more deeply in the job that consumes more CPU, you can set up the threshold-based action in IBM® OMEGAMON® to trigger the APA analysis. IBM APA can also deliver the XML report to a certain server location or the PDF report to your email box as soon as the analysis completes.
  • You can further use the XML report on other analytical platforms such as Splunk that provides actionable insights and cognitively improves your DevOps activities. The ongoing performance analysis provides you with insights and linkages to files and functions so that you can always have a current view of your application ecosystem and continuously improve your code.
  • You can use the PDF report to understand different performance parameters visually from the added graphical features and charts.
You can perform the complete automation by taking the following two steps.
  1. Schedule the observation.
    • a. Enable the system monitoring tool to schedule APA observation in the event of a threshold breach.
    • b. Enable APA to observe the job in the event of a threshold breach through the APA ISPF interface.
  2. Automatically create and deliver the APA report.
    • a. Automatically create and deliver the APA XML report to the server.
    • b. Automatically create and deliver the APA PDF report to the email box.
  1. Scheduling the observation
    • Enabling the system monitoring tool to schedule APA observation in the event of a threshold breach. From V14.1.4, APA has included the procedure (CAZ$NEW) and REXX program (CAZSTART) to enable IBM® OMEGAMON® to schedule APA observation in the event of a threshold breach.
    • IBM® OMEGAMON® APA command can be triggered from the system command console of OMEGAMON®. The following sample shows how to trigger APA observation from the OMEGAMON system command when the elapsed time of job APAJCL15 crosses 0.1 seconds.
    • You can complete the following steps to test the sample.
      • Create a situation in OMEGAMON®.
      • Define the conditions for the new situation.
      • Define a formula for the job. The following formula is defined for JCL APAJCL15. Note: The Interval field under the "Sampling" section determines how often the situation is detected. In this case, the condition is checked every 30 seconds.
      • Define the action. If the condition defined in the formula is satisfied, the procedure CAZ$NEW will be triggered to schedule the APA observation. The procedure CAZ$NEW that is used in the Action tab accepts various other parameters. For more information, see “Using the MVS START command to schedule a new measurement”.
      • Start the OMEGAMON task that monitors the job APAJCL15 since it starts running. If the condition is satisfied, APA observation will be scheduled.Since the Run at Startup field is set to “Y” when the situation is created, you do not need to manually start up the situation. In the sample screen, the command CAZ$NEW is the IBM APA supplied procedure. The current command instructs APA (STC=CAZE) to measure the Active job (ACT=Y). CAZNEWIM is the static member that contains instruction. To generate the report automatically as soon as a measurement is completed, specify “ARGDATA” parameter when the measurement is scheduled.
ARGDATA=(‘dataset name contains the report JCL’,Member-name)

You can check the following sample of CAZNEWIM for more information. It also comes with IBM APA installation (HLQ.*. SCAZSAMP).

NEW
*  JOBNAME to be provided on the MVS START command
DURATION=(00:30)
SAMPLES=10000
DESCR="Measure from Omegamon"
EXPDAYS=1
ARGDATA=('NEERAJK.JCL',REPORTP)
;
 

The procedure CAZ$NEW accepts various other parameters. For more information, see “Using the MVS START command to schedule a new measurement”.

 
  • Enabling APA to measure a job in the event of a threshold breach through the APA ISPF interface
  • APA provides the feature to define the threshold for a job. When job start executing, APA monitors it and start performing the.1 analysis as soon as threshold breaches.
  • The following screen shows which APA interface provides the function to capture threshold for a given job.
R02: IBM APA for z/OS Observation List (CAZE)
Command ===>                                                  Scroll ===> CSR
NEW     To define a new measurement
TNEW    To define a threshold measurement                                    
CONNECT To connect to another instance of the measurement task
VERSION To display version information for all instances
IMPORT  To IMPORT a previously Exported sample file or hierarchy
HIDE    To remove these commands from the display (recommended)
/       On top of any ReqNum to get a list of the line commands

To define the threshold from ISPF interface, follow the instructions in “Entering a Threshold Monitor request”.

To define the threshold from Batch Interface, follow the instructions in “TNEW” .

To create the report automatically from APA ISPF menu upon the measurement completion, populate “ARG DSN” and “Member” parameter on the APA ISPF menu.

The sample automatic generation JCL (CAZARG) comes with the APA installation sample PDS. (HLQ.*.SCAZSAMP)

 
  1. Automatically creating and delivering the APA report
    • Automatically create and Deliver the APA XML report to the server
    • To generate the report automatically as soon as measurement is completed, specify “ARGDATA” parameter in the following format when measurement is scheduled.
ARGDATA=(‘dataset name contains the report JCL’,Member-name)
Example:
NEW   JOBNAME=(NEERAJK1)
DURATION=(00:30)
SAMPLES=10000
DESCR="Measure from Omegamon"
EXPDAYS=1
ARGDATA=('NEERAJK.JCL',REPORTP)     
SYSTEMS=(STLABF6)
ACTIVE=(N)
RUNTOEOS=()
;
 

The automatic report generation JCL (CAZARG) is also supplied by APA in the installation directory HLQ.*.SCAZSAMP. You can find the following sample that creates the APA XML report.

//STEP20   EXEC PGM=CAZPRINT
//STEPLIB  DD   DISP=SHR,DSN=&STEPLIB.
//SFIN     DD   DISP=SHR,DSN=&SAMPDSN.
//RPT1     DD   SYSOUT=*
//XML1     DD   DISP=(NEW,CATLG),SPACE=(CYL,(1,1)),UNIT=SYSDA,
//             DCB=(LRECL=80,RECFM=FB,DSORG=PS),
//             DSN=&USERID..&JOB..&SAMP..XML
//CAZLOG   DD   SYSOUT=*
//CAZCTL   DD   *
PROFILE 01 INPUT=SFIN
SECTION S01
SECTION S02 Sequence=NAME
OmitESD=Y
OmitNUC=N
OmitPLPA=N
Omitdup=N
SECTION S03 Sequence=NAME
Omitdup=N
SECTION S04
SECTION S05 Intervals=45
SECTION S06 Intervals=45
SECTION S07
SECTION S08
SECTION S09
SECTION S10 Levels=3
MsgE=Y
MsgW=Y
MsgI=Y
MsgD=Y
SECTION C01 Levels=9
Sequence=VALUE
DPAGroup=Y
ShowDB2=Y
Minimum=0.00
MLD=Y
Datamg=Y
ShowIMS=Y
ADABAS=Y
SECTION C02 Levels=9
Sequence=VALUE
Minimum=0.00
MLD=Y
SECTION C03 Levels=9
Sequence=VALUE
Minimum=0.00
SliceSize=64
SECTION C04 Intervals=45
SECTION C05 Levels=9
Sequence=VALUE
DPAGroup=Y
ShowDB2=Y
ShowInact=Y
MLD=Y
Datamg=Y
ShowIMS=Y
ADABAS=Y
SECTION C06 Levels=9
Sequence=VALUE
ShowInact=Y
MLD=Y
SECTION C07 Sequence=VALUE
OmitCPU=N
SECTION C08 Levels=9
Sequence=VALUE
MLD=Y
SysView=N
SECTION C09 Levels=2
Sequence=VALUE
SECTION D01 Levels=9
Sequence=VALUE
Minimum=0.00
SECTION D02 Levels=9
Sequence=VALUE
Minimum=0.00
SECTION D03 Levels=9
Sequence=VALUE
Minimum=0.00
SECTION D04 Sequence=FILE
SECTION D05 Sequence=VALUE
OmitEXCP=N
SECTION D07 Sequence=VALUE
OmitEXCP=N
SECTION D08 Levels=9
Sequence=VALUE
MLD=Y
SECTION W01 Levels=9
Sequence=VALUE
DPAGroup=Y
ShowDB2=Y
ShowInact=Y
MLD=Y
Datamg=Y
ShowIMS=Y
ADABAS=Y
SECTION W02 Levels=9
Sequence=VALUE
ShowInact=Y
MLD=Y
SECTION W03 Levels=9
Sequence=VALUE
ShowInact=Y
MLD=Y
SECTION W04 Levels=9
Sequence=VALUE
MLD=Y
SECTION W05 Sequence=VALUE
SECTION X05 Levels=9
Sequence=VALUE
MLD=Y
CONVERT DDNAME=XML1 Format=XML
/*


Report can be delivered by using FTP or any other available methods. For more information, check the following sample.

//STEP02 EXEC PGM=FTP
//SYSIN DD *
256.23.255.255    ====> Server IP
ftpuser           ====> User ID
Tool@RDT          ====> Password
binary            ====> Transfer mode
CD /home/ftpuser/stflabf6    ====> Final location of report
LOCSITE RECFM=FB LRECL=167
PUT '&USERID..&JOB..&SAMP..PDF' &USERID..&JOB..&SAMP..XML
QUIT
//*
 
  • Automatically creating and delivering the APA PDF report to the Email box

To generate the report automatically as soon as measurement is completed, specify “ARGDATA” parameter when measurement is scheduled.

ARGDATA=(‘dataset name contains the report JCL’,Member-name)
Example:

NEW   JOBNAME=(NEERAJK1)
DURATION=(00:30)
SAMPLES=10000
DESCR="Measure from Omegamon"
EXPDAYS=1
ARGDATA=('NEERAJK.JCL',REPORTP)     
SYSTEMS=(STLABF6)
ACTIVE=(N)
RUNTOEOS=()
;

The automatic report generation JCL is also supplied by APA in the installation directory HLQ.*.SCAZSAMP. You can find the following sample that creates the APA PDF report.

//STEP20   EXEC PGM=CAZPRINT
//STEPLIB  DD   DISP=SHR,DSN=&STEPLIB.
//SFIN     DD   DISP=SHR,DSN=&SAMPDSN.
//RPT1     DD   SYSOUT=*
//PDF1     DD   DISP=(NEW,CATLG),SPACE=(CYL,(1,1)),UNIT=SYSDA,
//             DCB=(LRECL=80,RECFM=FB,DSORG=PS),
//             DSN=&USERID..&JOB..&SAMP..PDF
//CAZLOG   DD   SYSOUT=*
//CAZCTL   DD   *
PROFILE 01 INPUT=SFIN
SECTION S01
SECTION S02 Sequence=NAME
OmitESD=Y
OmitNUC=N
OmitPLPA=N
Omitdup=N
SECTION S03 Sequence=NAME
Omitdup=N
SECTION S04
SECTION S05 Intervals=45
SECTION S06 Intervals=45
SECTION S07
SECTION S08
SECTION S09
SECTION S10 Levels=3
MsgE=Y
MsgW=Y
MsgI=Y
MsgD=Y
SECTION C01 Levels=9
Sequence=VALUE
DPAGroup=Y
ShowDB2=Y
Minimum=0.00
MLD=Y
Datamg=Y
ShowIMS=Y
ADABAS=Y
SECTION C02 Levels=9
Sequence=VALUE
Minimum=0.00
MLD=Y
SECTION C03 Levels=9
Sequence=VALUE
Minimum=0.00
SliceSize=64
SECTION C04 Intervals=45
SECTION C05 Levels=9
Sequence=VALUE
DPAGroup=Y
ShowDB2=Y
ShowInact=Y
MLD=Y
Datamg=Y
ShowIMS=Y
ADABAS=Y
SECTION C06 Levels=9
Sequence=VALUE
ShowInact=Y
MLD=Y
SECTION C07 Sequence=VALUE
OmitCPU=N
SECTION C08 Levels=9
Sequence=VALUE
MLD=Y
SysView=N
SECTION C09 Levels=2
Sequence=VALUE
SECTION D01 Levels=9
Sequence=VALUE
Minimum=0.00
SECTION D02 Levels=9
Sequence=VALUE
Minimum=0.00
SECTION D03 Levels=9
Sequence=VALUE
Minimum=0.00
SECTION D04 Sequence=FILE
SECTION D05 Sequence=VALUE
OmitEXCP=N
SECTION D07 Sequence=VALUE
OmitEXCP=N
SECTION D08 Levels=9
Sequence=VALUE
MLD=Y
SECTION W01 Levels=9
Sequence=VALUE
DPAGroup=Y
ShowDB2=Y
ShowInact=Y
MLD=Y
Datamg=Y
ShowIMS=Y
ADABAS=Y
SECTION W02 Levels=9
Sequence=VALUE
ShowInact=Y
MLD=Y
SECTION W03 Levels=9
Sequence=VALUE
ShowInact=Y
MLD=Y
SECTION W04 Levels=9
Sequence=VALUE
MLD=Y
SECTION W05 Sequence=VALUE
SECTION X05 Levels=9
Sequence=VALUE
MLD=Y
CONVERT DDNAME=PDF1 Format=PDF
/*


The report can be delivered by using SMTP or any other available methods. You can include the SMTP step in the automatic report generation JCL. For more information, see “Using the IEBGENER utility to copy a mail file to a JES sysout file”.

  Special case: Enabling APA to automatically purge the completed observations and data sets After the APA report is generated in either XML or PDF format, the report is also created in the physical data set. In addition, the job entry is added in the APA interface. If you want to delete the report and purge the APA entry to save space and increase efficiency, choose one of the following methods.
  • Specify the expiry time of report data set and APA entry:
You can use the parameter EXPDAYS to define the expiry time of the APA entry and data set. If you set EXPDAYS=0, the measurement is kept indefinitely. If you set EXPDAYS=1, the report and APA entry will be deleted a day after the measurement completion. Check the following example for more information.
NEW   JOBNAME=(NEERAJK1)
DURATION=(00:30)
SAMPLES=10000
DESCR="Measure from Omegamon"
EXPDAYS=1                            
ARGDATA=('NEERAJK.JCL',REPORTP)
SYSTEMS=(STLABF6)
ACTIVE=(N)
RUNTOEOS=()
;
  • Delete the data set and APA entry as soon as report is delivered:
Include the IEFBR14 step to delete the report data set at the end of your report generation JCL and call CAZBATCH to delete the measurement. Report Generation JCL has the request number in &SAMP and has the format of Rnnnnnn (R000001). You need to write REXX routine to parse numbers out of &SAMP and call CAZBATCH to delete the measurement from APA.   The following example shows you how to write REXX program to accept &SAMP, parse, and call CAZBATCH. Make sure that you change the STCID= that corresponds to your own system.
/*==========================>> REXX<<================================*/
PARSE ARG SAMP
PARSE VAR SAMP 'R' REQNO
SAY REQNO
PARAMETER.1 = "DELETE REQNUM=" ||REQNO||";"
"FREE FI(SYSIN SYSPRINT)"
"ALLOC FI(SYSIN) NEW REU RECFM(F B) LRECL(80)"
"ALLOC FI(SYSPRINT) DA(*)"
"EXECIO * DISKW SYSIN (FINIS STEM PARAMETER."
ADDRESS TSO CALL "'SHARE.APA14G.SCAZAUTH(CAZBATCH)'" "'STCID=CAZE'"
"FREE FI(SYSIN SYSPRINT)"
  The following example shows the JCL to call REXX program and delete report data sets.
//STEP1 EXEC PGM=IKJEFT01
//SYSEXEC  DD DSN=NEERAJK.COBOL,DISP=SHR
//STEPLIB  DD DSN=ADTOOLS.APAE10.SCAZAUTH,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN  DD *
//  %PURGER &SAMP
//*
//STEP30   EXEC PGM=IEFBR14
//DD1      DD   DISP=(MOD,DELETE),DSN=&USERID..&JOB..&SAMP..PDF,
//             SPACE=(CYL,(1,1))
//DD1      DD   DISP=(MOD,DELETE),DSN=&USERID..&JOB..&SAMP..XML,
//             SPACE=(CYL,(1,1))
//
 

Join The Discussion

Your email address will not be published. Required fields are marked *