User Exit 12 (Multiple Data Set Log Processing)

Note:
UEX2 and UEX12 are mutually exclusive for an Adabas nucleus session: only one can be specified.

This user exit is given control by the Adabas nucleus during a switch from one multiple log data set to another for the purpose of copying the log data set before it is reused by Adabas. This switch occurs only if multiple data set data protection logging and/or multiple data set command logging is in effect for the session.

The user exit routine is designed to invoke a procedure that will execute the appropriate function (ALCOPY, CLCOPY or PLCOPY for Audit Log, Command Log or Protection Log) of the ADARES utility.

User exit 12 is invoked

  • during Adabas nucleus startup if a multiple PLOG/CLOG/ALOG data set has to be copied;

  • whenever a switch to another log data set occurs;

  • at the end of a PLCOPY, CLCOPY or ALCOPY job if ADARES determines there are more copies needed;

  • during Adabas nucleus shutdown.

The user exit is provided with information about the type of log (PLOG, CLOG or ALOG) and the status of the multiple log data sets.

The user exit can decide which action is to be taken:

  • Ignore the call and allow Adabas to proceed;

  • Submit a job to copy and mark as empty the log data set just filled (ADARES utility);

  • Direct Adabas to wait for a specified interval, then call the user exit again with updated PLOG/CLOG/ALOG data set status information. During the wait interval, no commands that may produce log records for the log type being processed are allowed to proceed.

    Note:
    If automated CLOG merge is being used in a cluster environment, it is critical that the exit 12 is used in the suggested manner to copy the CLOGs in a timely fashion as illustrated in the sample exit. Invoking the CLCOPY process in a different manner can result in time stamp inconsistencies between the CLOG datasets in a cluster environment causing CLOG merge issues. The PLOG merge is always automatic and also requires that the PLOGs are copied in a timely manner.

An example of user exit 12 is supplied with the Adabas installation procedure. Refer to the Adabas Installation documentation for more information.

The call to the user exit is made using a standard BASSM R14,R15 Assembler instruction. All registers must be saved when control is received and restored immediately prior to returning control to Adabas. Register 15 contains an action code as described in the user exit 2 section Output Parameter.

For more information regarding Standard MVS Calling Conventions and Return from User Exits please refer the respective sections in the Overview.

Note:
User exit 12 must return the same AMODE value to the calling program that was active when user exit 12 was called. The recommended Assembler instruction to return is BSM 0,R14.

This document covers the following topics:


User Exit 12 Calling Sequence

graphics/multi_log_flow.png

Multiple Log Processing Flow

User Exit Interface

Optionally, the user exit may initialize its operation. It may store any value in field EX12USER of the EX12PARM parameter block to keep track of its resources. This field is considered as "owned" by the user exit and is supplied again for all subsequent executions of the exit. It is set to zero when the exit is first called and is not modified by Adabas thereafter.

The user exit is called again during termination to do any necessary finishing or 'cleanup' work.

Parameters

graphics/ue12parms.png

User Exit 12 Parameters

DSECT of the EX12PARM Parameter Block

         MACRO
         EX12PARM
.**********************************************************************
.*                                                                    *
.* Name          Ex12Parm                                             *
.*                                                                    *
.* Component     ADABAS User Exit                                     *
.*                                                                    *
.* Function      Parameter list for User Exit 12                      *
.*               (replacement for User Exit 2 for use when there are  *
.*                two or more PLOGs, CLOGs or ALOGs)                  *
.*                                                                    *
.* Parameters    None                                                 *
.*                                                                    *
.* Restrictions  None                                                 *
.*                                                                    *
.* Notes         None                                                 *
.*                                                                    *
.**********************************************************************
.*
EX12PARM DSECT ,                   User Exit 12 Parameter List
*
EX12HDR  DS    0F                  Common header section
*
EX12USER DS    F                   Reserved for the user.  This field  +
                                   is initialized to zero before the   +
                                   exit is called the first time, and  +
                                   will not be altered by ADABAS after +
                                   that.  It can be used to maintain   +
                                   information across invocations.
*
EX12LOGT DS    X                   Log type
EX12PLOG EQU     C'P'                PLOG
EX12CLOG EQU     C'C'                CLOG
EX12ALOG EQU     C'A'                ALOG										 
*
EX12TYPE DS    X                   Call type
EX12TBEG EQU     C'S'                Nucleus start
EX12TSW  EQU     C'W'                Log switch
EX12TEND EQU     C'T'                Nucleus termination
EX12TFRC EQU     C'F'                Forced switch
         DS    XL2                 Reserved
*
EX12NLOG DS    F                   Number of logs
EX12DBID DS    F                   Database ID
EX12NUCI DS    F                   Nucleus ID
*
EX12PLGN DS    F                   Current session PLOG number         +
                                     (zero for CLOGs)
EX12NCMP DS    F                   Log just completed                  +
                                     (zero during initialization and   +
                                      for forced CLOG switch)
EX12STAT DS    X                   Flags of next log in sequence
EX12WNUC EQU     X'80'               Being written by the nucleus
EX12FULL EQU     X'40'               Completed by the nucleus
EX12RES  EQU     X'20'               Being copied by ADARES
EX12CL5  EQU     X'08'               CLOGLAYOUT=5
EX12NMRG EQU     X'04'               Records include time stamp (PLOG)
*                                     CLOG not merged (cluster)
EX12PMRG EQU     X'02'               Log partially merged (cluster)
EX12UNUS EQU     X'00'               Unused and/or copied
         DS    XL3                 Reserved
         DS    4F                  Reserved
*
EX12HDRL EQU   *-EX12HDR           Length of header section
*
EX12ENT  DSECT ,
EX12LOG  DS    0F                  Start of individual log dataset     +
                                   entries.  This section is repeated  +
                                   for the number of logs specified in +
                                   field EX12NLOG
*
EX12LTIM DS    XL8                 Time stamp of write to log dataset
EX12LNUM DS    F                   Number of log dataset
EX12LFLG DS    X                   Flags (mapped as in EX12STAT)
         DS    XL3                 Reserved
         DS    4F                  Reserved
*
EX12LOGL EQU   *-EX12LOG           Length of a log dataset entry
*
*
         MEND

Output Parameter

Parameter Usage
R15 = 0 Nucleus continues processing.
R15 > 0 R15 is treated as the number of seconds to wait before calling user exit 12 again with updated status for all log data sets. During this time, no commands that may create log entries are processed.

Activating the Sample User Exit

The sample user exit is written in Assembler language. It performs the following functions:

  • Issues a message identifying the reason and the type of log for which it was called.

  • Issues a message with the status and timestamp of all log data sets that are not empty.

  • If any log data set is full and at least one log data set has a status that is different from the last time the exit was called, the exit reads 80-byte records from an input file and writes them to an output file. It replaces all occurrences of the character "?" with either "P", "C" or "A", depending on whether the exit was invoked to process a PLOG, CLOG or ALOG event, respectively. This allows the input file to accommodate an event for either log type. Normally, the input file contains job control statements and the output file is directed to a job execution queue.

  • If a record in the model job starts with the special stop mark “//*?” the exit will:

    • replace the stop mark with “//* ”,

    • stop copying further records to the output if it is PLOG or CLOG, or

    • continue copying records and replacing “?” with “A” if it is ALOG.

  • If at least one log data set is not full, the exit returns to the caller with R15 zero, which allows Adabas to proceed.

  • If all log data sets are full, the exit returns to the caller with R15 nonzero, which directs Adabas to wait for the number of seconds in R15, then call the exit again with an updated status of all log data sets. The default delay time is 30 seconds.

Warning:
Sample user exits and programs and are not supported under any maintenance contract agreement.

Activating in z/OS

The sample user exit UX12SAMP is delivered on z/OS as source and as a load module that can be used without change or reassembly.

The source and load forms of the user exit are delivered in the Adabas source and load libraries, respectively. The job to assemble the user exit UX12ASML is located in the Adabas jobs library. The jobs library also contains a sample job UX12CJOB to be customized and submitted by the user exit that invokes the ADARES utility PLCOPY or CLCOPY function.

Activate the sample user exit as follows:

  1. In addition to ADARUN NxLOG={2-8}, specify ADARUN UEX12=UX12SAMP for the Adabas nucleus.

  2. Supply the job control model that the user exit is supposed to submit under the DDNAME COPYJOB.

Provide the following DD statement:

//INTRDR2  DD  SYSOUT=(*,INTRDR)

Note:
The same DD statement is used by the sample user exit 2 or 12 for submitting PLCOPY, CLCOPY or ALCOPY jobs.