How to DEFRAG the Jobtrac Job Management Index (IXX) data set after DELETE HISTORY?
search cancel

How to DEFRAG the Jobtrac Job Management Index (IXX) data set after DELETE HISTORY?

book

Article ID: 53438

calendar_today

Updated On:

Products

Jobtrac

Issue/Introduction

To reduce the Jobtrac  data base space utilization, a frequent cleanup job is recommended. There are three types of records that can be deleted from the  Jobtrac JM database: HISTORY, AUDIT and STATISTICS. Deleting these types of records frees up the Index and Data space and makes them available for later reuse. To free up the Index space for immediate reuse, the DEFRAG command is recommended.

 



Environment

Release:
Component: JOBTRC

Resolution

JOBTRAC SAMPJCL(HISTMANT) member contains a sample job to DELETE expired AUDIT and HISTORY records from the  Jobtrac database. 

Sample history maintenance job to keep just the last 30 days of history and 100 days of audit data in the database:

//JPRG     EXEC GJTRJPRG   <- JCL procedure in the Jobtrac CAIPROC library
//SYSIN    DD  *
* DEFAULT FOR ALL EVENTS:
EVENT=*,DAYS=30,DELETE
AUDDAYS=100 
// 

After the records are deleted, run the following  Datacom job to DEFRAG the JOBTRAC Index data set:

//DBDEFRAG JOB ...
//*
//*******************************************************************
//*                                                                 *
//*  SAMPLE DEFRAG OF THE JOBTRAC DATABASE INDEX                 *
//*                                                                 *
//*  THIS JOB PERFORMS AN ONLINE COMPRESS OF THE INDEX FOR THE      *
//*  JOBTRAC DATABASE USING THE DATACOM DBUTLTY PROGRAM.      *
//*                                                                 *
//*  THIS JOB CAN BE RUN WHILE THE JOBTRAC DATABASE IS OPEN    *
//*  AND ACTIVE.                                                    *
//*                                                                 *
//*  THIS JOB WILL:                                                 *
//*     1. REFRESH CXX DISK-BASED STATISTICS                        *
//*     2. RUN A CXX TYPE=A REPORT ON DBID 161                      *
//*     3. DEFRAGMENT THE INDEX BLOCKS                              *
//*     4. REFRESH THE CXX STATISTICS AGAIN                         *
//*     5. PRODUCE A FINAL CXX TYPE=A REPORT                        *
//*                                                                 *
//*******************************************************************
//*
//*   SET CUS=YOUR DATACOM CUSLIB
//*   SET CAI=YOUR DATACOM CAAXLOAD
//*   SET CXX=YOUR CXX FILE NAME
//*
//DEFRAG   EXEC PGM=DBUTLTY,REGION=4M
//STEPLIB  DD   DISP=SHR,DSN=&CUS
//         DD   DISP=SHR,DSN=&CAI
//SYSPRINT DD   SYSOUT=*
//CXX      DD   DISP=SHR,DSN=&CXX
//SYSIN    DD   *
COMM   DBID=161,OPTION=STATS
REPORT DBID=161,AREA=CXX,TYPE=A
DEFRAG DBID=161
COMM   DBID=161,OPTION=STATS
COMM OPTION=STATS,DBID=161
REPORT AREA=CXX,DBID=161,TYPE=A
/*

The above DEFRAG job should be defined to Jobtrac  and should run weekly after GJTRJPRG job.