Deleting Expired Datasets using the Sysview Event Capture CAPMAINT process
search cancel

Deleting Expired Datasets using the Sysview Event Capture CAPMAINT process

book

Article ID: 44553

calendar_today

Updated On:

Products

SYSVIEW Performance Management

Issue/Introduction

How to delete expired datasets using the SYSVIEW Event Capture CAPMAINT process

Resolution

The ideal solution would be to use SMS constructs for managing the retention for the capture datasets by coding AllocDataClass, AllocStorClass, and AllocMgmtClass in the CAPTURE parmlib member so the retention coded for AllocRetention would not be in conflict with SMS.

Instructions:

Should you not want to use the SMS constructs to manage the capture datasets, you can have the CAPMAINT capture do the HDELETES. Using the supplied sample Rexx Exec, the following steps will be required:

  • Copy the attached CAPMAINT sample exec into the SYSVIEW REXXLIB (CNM4BREX)

  • Update the CAPMAINT member in CAPLIB (CNM4BCAP) so that it calls the CAPMAINT exec by making the following updates: 

    CONTROL NOFLUSH
    CAPPARMS DESCR c'Capture index maintenance'

    XTSO CAPMAINT /* <--- Added this line */
    CAPTURE /* <--- Added this line */

    CAPMAINT DSNAME
    . . . .

Here is the sample exec:

.....
/* REXX =============================================================*
/*                                                                   *
/*  CA SYSVIEW                                                       *
/*                                                                   *
/*===================================================================*
/*                                                                   *
/*  Description                                                      *
/*                                                                   *
/*      This REXX exec can be called using XTSO from the CAPMAINT    *
/*      CAPLIB member to do an HDELETE of any MIGRAT'ed capture      *
/*      datasets.                                                    *
/*                                                                   *
/*===================================================================*
ADDRESS 'LINK' 'GSVXRXAA'
ADDRESS 'SYSVIEWE'
"C(CAPMAINT;SELECT CAPVOL = MIGR= AND IDXSTAT = EXPIRED) STACK(NO)"
"C(XVEXTRAC DATA CapDsname CapDsname.)"
ADDRESS 'TSO'
IF CapDsname.0 > 0 THEN
   DO i = 1 to CapDsname.0
      cmd = "HDELETE '"CapDsname.i"'"
      say cmd
      cmd
      say
   END
ELSE
   say 'No migrated capture datasets to delete'
ADDRESS 'SYSVIEWE'
"C(END)"
EXIT
.....