Version 8.1.4
 —  User, Hyperdescriptor, and Collation Descriptor Exits  —

User Exit 2 (Dual Log Processing)

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.

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:

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:

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:


User Exit 2 Calling Sequence

graphics/dual_log_flow.png

Dual Log Processing Flow

Top of page

Input Parameters

graphics/dual_log_parms.png

Dual Log Processing User Exit (2) Parameters

The input parameters for the address list are as follows:

Parameter A fullword address of . . .
0 (R1) the C/PLOG indicators and flag 1/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 DD/PLOGR1 and DD/CLOGR1; and
Flag 2
Status flags for DD/PLOGR2 and DD/CLOGR2:
B'1... ....' : Data set being written by nucleus
B'.1.. ....' : Data set has been completed by nucleus
B'.11. ....' : Being copied by ADARES
B'0000 0000' : Data set is empty (or copied) and reusable for the nucleus.
All other flag 1/2 field values are reserved. For DD/CLOGR1/2 only: X`08' for CLOGLAYOUT=5. Flag 1/2 bit settings can be combined (X`40' and X`20' as X`60', for example).
If OPENOUT is specified, these flags are set after OPEN is issued for the output data set; otherwise, the flags are set before the OPEN is issued.
Session Status
Contains information about the status of the nucleus when the exit was called:
X'S' Called during nucleus session startup.
X'T' Called while terminating the nucleus session.
X'W' Called following a dual protection log switch.
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 DD/PLOGR1 and DD/CLOGR1, and TIMER2 for DD/PLOGR2 and DD/CLOGR2
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.

Top of page

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 2 again. During this time, the nucleus is in a "hard" wait. No commands are processed during the wait.

Top of page

BS2000 Options for Invoking User Exit 2

When using user exit 2 with BS2000 systems, the name of the ADARES CLCOPY or PLCOPY job is no longer "hard-coded" in the user exit as in previous releases. Therefore, there are now two ways of specifying the /ENTER job:

Method 1

Create a job variable containing the complete "enter job" command. For example:

/DCLJV   ENTER.ADARES.PLCOPY,LINK=*DDJBPLC
/SETJV *DDJBxLC,C'ENTER JOB.ENTER.ADARES.PLCOPY,ST=IMM'

Note that all operands of the /ENTER command may be used. The presence of the /DCLJV statement overrides the other possibilities. If necessary, the content of the job variables can be changed during a nucleus session.

Use the link names "*DDJBPLC" for assigning the ADARES PLCOPY job, and "*DDJBCLC" for assigning the ADARES CLCOPY job.

Method 2

Omit the JV specification. The user exit 2 will then issue the following command:

'ENTER   RES.E.xLCO'

Note:
For BS2000 systems, user exit 2 is delivered as a source element only.

Top of page