You may want to use a log data set to monitor events that occur during product processing, or write records from environments that do not allow I/O. The rules language allows the products to schedule I/O requests to DD statements allocated in the DIF started task. DIF supports sequential (DSORG=PS), GDG and VSAM log files.
The LOG parameter on the DEFMSG statement can be used by the rules language to route a copy of the message to a log file allocated in the DIF started task. The DDNAME parameter on the DEFREC statement determines which DD statement in the DIF started task should receive records. For more information, examine the DEFMSG portal-2000-rules-lang-programming_defmsg.html#A7AD4C56-82246B4-7E14ADC55D10326-8565D0___bookmark431 on page 5-54 and the DEFREC portal-2000-rules-lang-programming_defrec.html#A7A52D4C-546B474-DE1487552503326-865AD0___bookmark505 on page 5-84.
Using Overflow Log and Record Files
When a sequential non-GDG log file has used the available space, DIF can switch to additional log files. For example, if SCC Monitor is writing records to the RTMDB file in the DIF started task and the file gets full, DIF will switch to the RTMDBA file if the DDname is available. By default, the overflow log facility will use an alphabetic sequence character added to the original file name (for example, the first overflow file concatenates an "A" to the original file name, the second uses "B", and so forth).
The DIF CLOSE command DIF CLOSE file RESET can be used to reset the log facility. When RESET is specified, the command will close an existing log file, and restart logging on the original file name. This command should be issued after dumping the original log files.
The DIF CLOSE command DIF CLOSE file SWAP can be used to force the DIF log facility to switch to the next overflow log file for non-GDG logs.
Using the Log Overflow Exit
When a log file gets full, DIF will capture the B37 condition and invoke a user exit called DIFLOGX. This exit is passed a 500 byte workarea in register 0, and a parameter list in register 1. The parameter list is a list of four-byte addresses as follows:
- Parm 1—the original DDname used for the log file
- Parm 2—the DDname for the current log file that has just filled
- Parm 3—the data set name for the current log file that has just filled
- Parm 4—the current volume name for the log file that has just filled
- Parm 5—the next sequence character used to generate the overflow name
- Parm 6—the address of the log file DCB that will be opened
On return, the log facility will examine the return code passed back in register 15. The return codes are handled as follows:
- RC=0—the log facility will attempt to open the next overflow log file name. The name is generated using an alphabetic next sequence character concatenated with the original file name.
- RC=4—returns the new DDname to use for the next log file. The name is returned in the parameter block; update Parm 2 DDname.
- RC=8—disables the overflow log facility on the log file.
For more information about user exits, examine User exits on page 3-46 and the DIF EXIT command on page 7-17 in the Product Installation Guide.
GDG Log Files
DIF also supports GDG log files. If an X37 abend occurs when writing data to a GDG log file, DIF will free the current file and allocate a new data set using the +1 generation with a space value of CYL(10,10). DIF will then open and use the new dataset. Additional generations are created as needed.
The JCL below can be used to create a GDG base and the initial log file.
The following JCL can be found in the DIFBLDG member of the SCC sample library: DTS.R71.SLyyddd.SAMPLIB. Fields represented with bold type may need to be modified before submission.
//DIFBLDG JOB ... (RC=0 EXPECTED)
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE DTS.GDG.LOGFILE.*
DELETE DTS.GDG.LOGFILE FORCE
DEFINE GDG(NAME(DTS.GDG.LOGFILE) LIMIT(10))
/*
//STEP2 EXEC PGM=IEFBR14
//DD1 DD DSN=DTS.GDG.LOGFILE,DISP=(NEW,KEEP),
// SPACE=(TRK,(0)),UNIT=SYSALLDA,VOL=SER=CATVOL
//STEP3 EXEC PGM=IEFBR14
//DD1 DD DSN=DTS.GDG.LOGFILE(+1),DISP=(NEW,CATLG),
// SPACE=(CYL,(10,10)),UNIT=SYSALLDA
After creating a GDG, the log file can be allocated in the DIF JCL with DISP=SHR and generation 0. If an X37 abend occurs when writing data to a GDG log file, DIF will free the current file and allocate a new data set using the +1 generation with a space value of CYL(10,10). DIF will then open and use the new dataset. Additional generations are created as needed.
A sample statement for the DIF started task:
//SAMPLOG DD DSN=DTS.GDG.LOGFILE(0),DISP=SHR
The DIF CLOSE command DIF CLOSE file SWAP can be used to force the DIF log facility to switch to the next GDG generation. When SWAP is specified for a GDG log file, the next I/O to the log file routes records to the next generation of the GDG group. You could add F DIF,CLOSE logfile SWAP commands to your automated operations procedures to produce scheduled generations of log data (i.e., daily log files).
VSAM Log
Files
VSAM KSDS files can also be used to store log records. The rules language used by the products uses DEFREC statements to define the records being sent to the log files. The DDNAME parameter on the DEFREC determines which log file receives the record.
The following JCL can be found in the DIFVSLOG member of the SCC sample library: DTS.R71.SLyyddd.SAMPLIB. Fields represented with bold type may need to be modified before submission.
//JOBNAME JOB ... (RC=0 EXPECTED)
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER(NAME(DTS.LOGFILE.DATABASE) + VOLUME(DTS001) SHAREOPTIONS(2) +
RECORDSIZE(474 474) CYL(20 20) +
INDEXED KEYS(124 4))
LISTCAT ENTRY(DTS.LOGFILE.DATABASE) ALL
/*