Deleting Expired Datasets using the CA Sysview Event Capture CAPMAINT process

Document ID : KB000044553
Last Modified Date : 14/02/2018
Show Technical Document Details

Summary:  

The ideal solution would be to use SMS constructs for managing the retention for the capture datasets by codeing 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
.....