JCL to unload or load journal records

The following example JCL performs two tasks:

  1. Unloads (copies) to the CCVUNLD data set all journal records that are older than 31 days.
  2. 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.
Figure 1. Example JCL: unloading records from the journal
//CCVXHKPU JOB your job statement information
//STEP     EXEC PGM=CCVBHKP
//STEPLIB  DD DISP=SHR,DSN=ccvhlq.SCCVAlang
//         DD DISP=SHR,DSN=ccvhlq.SCCVAUTH
//         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.

Figure 2. Example JCL: reloading records into the journal
//CCVXHKPL JOB your job statement information
//STEP     EXEC PGM=CCVBHKP
//STEPLIB  DD DISP=SHR,DSN=ccvhlq.SCCVAlang
//         DD DISP=SHR,DSN=ccvhlq.SCCVAUTH
//         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:
  • Start of change LRECL=27994 End of change
  • 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:
  • Start of change LRECL=27994 End of change
  • 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.

Figure 3. Batch housekeeping program: sequence of commands

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.


Information Information

Feedback


Timestamp icon Last updated: Friday, 7 February 2014


http://pic.dhe.ibm.com/infocenter/cicsts/v5r1/topic///ccv-batch-journal-unload-jcl.htm