This user exit is given control by the Adabas nucleus during a switch from one dual log to the alternate dual log for the purpose of copying the log before it is reused by Adabas. This switch occurs only if dual data protection logging or dual command logging is in effect for the session.
For more information regarding Standard MVS Calling Conventions and Return from User Exits please refer the respective sections in the Overview.
Note
UEX2 and UEX12 are mutually exclusive for an Adabas nucleus
session: only one can be specified.
The user exit routine must invoke a procedure whereby the appropriate function of the ADARES utility (CLCOPY or PLCOPY) is executed.
User exit 2 is invoked:
during Adabas nucleus startup if a PLOG/CLOG has to be copied;
whenever a dual command or dual protection log switch occurs between two log data sets;
at the end of a PLCOPY or CLCOPY job if ADARES determines there are more copies needed;
during Adabas nucleus shutdown.
The user exit is provided with information about the status of the dual log data sets.
The user exit can decide which action is to be taken:
Ignore the call;
Submit a job to copy the log data set just filled up (ADARES utility);
Wait for completion of the copy job just submitted.
Note
If automated CLOG merge is being used in a cluster environment,
it is critical that the exit 2 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.
If the data set to be overwritten contains data, console message ADAN46 Function not executable is issued.
An example of user exit 2 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 BASR 14,15 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 Output Parameter.
This document covers the following topics:


The input parameters for the address list are as follows:
| Parameter | A fullword address of . . . |
|---|---|
| 0 (R1) | the C/PLOG indicators with Flag 1 and Flag 2. |
| 4 (R1) | the four-byte timer 1 field. |
| 8 (R1) | the four-byte timer 2 field. |
| 12 (R1) | the current session's PLOG number, followed by the database ID. |
| 16 (R1) | a four-byte area where the first two bytes contain the number of PLOG1, and the second two bytes hold the number of PLOG2. |
Other input parameters are explained in the following table:
| Parameter | Usage | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Flag 1 | Status flags for DDPLOGR1 and DDCLOGR1; and | ||||||||||||||||
| Flag 2 |
|
||||||||||||||||
| Session Status |
|
||||||||||||||||
| TIMERn | Time-stamp (highest four bytes of a STCK instruction) for the time the first block of the log data set has been written. TIMER1 for DDPLOGR1 and DDCLOGR1, and TIMER2 for DDPLOGR2 and DDCLOGR2 | ||||||||||||||||
| PLOG | Current session protection log number (two bytes). This value is set for PLOG only; the field contains X`00' for CLOG. | ||||||||||||||||
| DBID | Database ID (two bytes). | ||||||||||||||||
| PLOG1/2 | Two 2-byte PLOG numbers found on PLOG 1 and PLOG 2. If the previous nucleus session ended abnormally, these four bytes contain that session`s PLOGNUM value, which can be used in the initial user exit 2 call to copy that session's PLOG. During any subsequent session, these bytes contain the current PLOGNUM value. If the preceding session ends abnormally, these four bytes contain the ended session's PLOG numbers during the nucleus start phase. This PLOG information is needed during the start phase to assign the correct PLOG numbers to the PLOG areas to be copied. During subsequent exit calls, the current PLOG values are in these fields. | ||||||||||||||||
| Parameter | Usage |
|---|---|
| R15 = 0 | Nucleus continues processing. |
| R15 > 0 | R15 is treated as the number of seconds to wait before calling user exit 2 again. During this time, the nucleus is in a "hard" wait. No commands are processed during the wait. |