JCL to unload or load journal records
The following example JCL performs two tasks:
- Unloads (copies) to the CCVUNLD data set all journal records that are older than 31 days.
- Deletes the unloaded records from the journal, except where deleting a record would leave less than two instances of a resource definition (identified by name, group, and type) in the journal. In such cases, the record remains in the journal, and also appears in the CCVUNLD data set.
//CCVXHKPU JOB your job statement information
//STEP EXEC PGM=CCVBHKP
//STEPLIB DD DISP=SHR,DSN=ccvhlq.SCCVAlang
// DD DISP=SHR,DSN=ccvhlq.
SCCVLINK
// DD DISP=SHR,DSN=cicshlq.SDFHEXCI
//CCVLOAD DD DSN=datahlq.JOURNAL.DATA
//CCVPRINT DD SYSOUT=*
//CCVWORK DD DSN=&WORK,
// DISP=(NEW,DELETE,DELETE),SPACE=(CYL,(10,1)),UNIT=SYSDA,
// DCB=(RECFM=VB,BLKSIZE=0,LRECL=27994,DSORG=PS)
//CCVUNLD DD DSN=datahlq.JOURNAL.DATA,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(10,1)),UNIT=SYSDA,
// DCB=(RECFM=VB,BLKSIZE=0,LRECL=27994,DSORG=PS)
//CCVPARMS DD *
CONNECT IPADDRESS=ip_address,PORT=ip_port_number
UNLOAD KEEPINSTANCES=2
CRITERIASET COND=(CREATETIME LT TODAY-31)
/*
Similar JCL is supplied in the sample library SCCVSAMP member CCVXHKPU.
The following example JCL loads previously unloaded journal records that were created as a result of Migrate or Copy commands, where the resource definition affected by the command belongs to a CICSĀ® configuration whose name starts with the letters PROD.
//CCVXHKPL JOB your job statement information
//STEP EXEC PGM=CCVBHKP
//STEPLIB DD DISP=SHR,DSN=ccvhlq.SCCVAlang
// DD DISP=SHR,DSN=ccvhlq.
SCCVLINK
// DD DISP=SHR,DSN=cicshlq.SDFHEXCI
//CCVPRINT DD SYSOUT=*
//CCVLOAD DD DSN=datahlq.JOURNAL.DATA
//CCVPARMS DD *
CONNECT IPADDRESS=ip_address,PORT=ip_port_number
LOAD
CRITERIASET COND=(API_COMMAND=MIGRATE),
COND=(CONFIGURATION=PROD*)
CRITERIASET COND=(API_COMMAND=COPY),
COND=(CONFIGURATION=PROD*)
/*
Similar JCL is supplied in the sample library SCCVSAMP member CCVXHKPL.
The job control statements that are specific to the batch housekeeping program are:
- CCVWORK
- Defines a temporary work file. This data set must
have the following DCB attributes:
- LRECL=27994
- RECFM=VB
- BLKSIZE=0
- DSORG=PS
- CCVUNLD or CCVLOAD
- Defines the sequential data set where the journal records are
to be unloaded to (CCVUNLD) or loaded from (CCVLOAD), depending on
whether CCVPARMS contains an UNLOAD or a LOAD command. The
CCVUNLD data set must have the following DCB attributes:
- LRECL=27994
- RECFM=VB
- BLKSIZE=0
- DSORG=PS
Follow the CONNECT command with an UNLOAD or a LOAD command, and then, optionally, one or more CRITERIASET parameters. You must supply the CONNECT command, the UNLOAD or LOAD command, and each CRITERIASET condition on separate input lines in the JCL. Each CRITERIASET can contain one or more conditions specifying the journal records that you want to load or unload. You can specify the same types of condition for either LOAD or UNLOAD.

When unloading, you can choose to specify the number of instances of a resource definition you want to keep in the journal, regardless of the conditions specified by CRITERIASET. You can also choose to unload journal records without deleting them from the journal.