Sample MODIFY STATISTICS control statements

Use the sample control statements as models for developing your own MODIFY STATISTICS control statements.

Example 1: Deleting SYSIBM.SYSTABLES_HIST records by age

The following control statement specifies that the MODIFY STATISTICS utility is delete all statistics history records that are older than 60 days for table space DSN8D81A.DSN8S81E .

//STEP1    EXEC DSNUPROC,UID='IUIQU2UD.MODSTAT1',
//            UTPROC='',SYSTEM='DSN'
//SYSIN    DD *
  MODIFY STATISTICS TABLESPACE DSN8D13A.DSN8S13E
    DELETE ALL
    AGE 60
/*

Example 2: Deleting access path records for all objects in a list

The following MODIFY STATISTICS control statement specifies that the utility is to delete access-path statistics history rows that were created before 17 April 2000 for objects in the specified list. The list, M1, is defined in the preceding LISTDEF control statement and includes table spaces DB0E1501.TL0E1501 and DSN8D81A.DSN8S81E.

//STEP9    EXEC DSNUPROC,UID='JUOEU115.MDFYL9',       
//         UTPROC='',                                 
//         SYSTEM='SSTR'                              
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *                                       
                                                      
   LISTDEF M1 INCLUDE TABLESPACE DBOE1501.TLOE1501
              INCLUDE TABLESPACE DSN8D81A.DSN8S81E
   MODIFY STATISTICS LIST M1                          
                     DELETE ACCESSPATH DATE(20000417) 
/*  

Example 3: Deleting space-tuning statistics records for an index by age

The following control statement specifies that MODIFY STATISTICS is to delete space-tuning statistics records that are older than one day for index ADMF001.IXOE15S1 .

//STEP9    EXEC DSNUPROC,UID='JUOEU115.MOFYS9',     
//         UTPROC='',                               
//         SYSTEM='SSTR'                            
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *                                     
                                                    
   MODIFY STATISTICS INDEX ADMF001.IXOE15S1         
                     DELETE SPACE AGE 1             
/*    

Example 4: Deleting all statistics history records for an index space

The following control statement specifies that MODIFY STATISTICS is to delete all statistics history records for index space DBOE1501.IUOE1501. Note that the deleted records are not limited by date because (*) is specified.

//STEP8    EXEC DSNUPROC,UID='JUOEU115.MDFYL8',    
//         UTPROC='',                              
//         SYSTEM='SSTR'                           
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *                                    
   MODIFY STATISTICS INDEXSPACE DBOE1501.IUOE1501  
                     DELETE ALL DATE (*)           
/*
Start of change

Example 5: Deleting all statistics history records by age at the partition level

The following control statement specifies that MODIFY STATISTICS is to delete all statistics history records that are older than 60 days for partition 2 of table space DSN8D13A.DSN8S13E.

//STEP1    EXEC DSNUPROC,UID='IUIQU2UD.MODSTAT1',
//            UTPROC='',SYSTEM='DSN'
//SYSIN    DD *
  MODIFY STATISTICS TABLESPACE DSN8D13A.DSN8S13E  PART 2
    DELETE ALL
    AGE 60
/*
End of change
Start of change

Example 6: Deleting all statistics access path records at the partition level for all the objects in a list

The following control statement specifies that MODIFY STATISTICS is to delete access-path history statistics records that were created before 22 March 2020 for the objects in the specified list. The list, M1, is defined in the preceding LISTDEF control statement and includes all partitions in table spaces DB0E1501.TL0E1501 and DSN8D81A.DSN8S81E.The aggregate catalog history statistics (such as statistics in SYSTABLES_HIST and SYSCOLDIST_HIST) are not be deleted, because PARTLEVEL is specified.

///STEP9    EXEC DSNUPROC,UID='JUOEU115.MDFYL9',       
//         UTPROC='',                                 
//         SYSTEM='SSTR'                              
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *                                       
                                                      
   LISTDEF M1 INCLUDE TABLESPACE DBOE1501.TLOE1501 PARTLEVEL
              INCLUDE TABLESPACE DSN8D81A.DSN8S81E PARTLEVEL
   MODIFY STATISTICS LIST M1                          
                     DELETE ACCESSPATH DATE(20200322) 
/*  
End of change
Start of change

Example 7: Deleting all history statistics records at the partition level for an index space

The following control statement specifies that MODIFY STATISTICS is to delete all history statistics records for partition 3 of index space DBOE1501.IUOE1501. The deleted records are not limited by date, because (*) is specified.

//STEP8    EXEC DSNUPROC,UID='JUOEU115.MDFYL8',    
//         UTPROC='',                              
//         SYSTEM='SSTR'                           
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *                                    
   MODIFY STATISTICS INDEXSPACE DBOE1501.IUOE1501 PART 3  
                     DELETE ALL DATE (*)           
/*
End of change