I would like to know if the connection to the destination is down in order to automatically re-open the destination after 30 minutes, for example.
I can manually check and manage everything through AOS/Replicator Management. But I would like to do it programmatically.
I tried ADADBS OPERCOM RPLCHECK, as defined in the Manual, to see if the number SLOG records is greater than 0, but it failed - replication commands are not allowed with OPERCOM.
Another possibility would be to send an Adabas command from the mainframe to an file on the destination DB to check for RC148.
How do the replication gurus on this list solved the problem? Maybe SAG in Germany has an idea how to get the info?
You can run an ADAREP in batch on the SLOG file and check the “Records Loaded” value (ADAREP NOSTD,NOFDT,FILE=slog file number).
But remember to force a buffer flush with ADADBS RECOVER just before in order to have the “Records Loaded” as accurate as possible. This “Records Loaded” figure is in the FCB and is updated by Adabas nucelus but kept in memory and only written to disk when necessary. Because ADAREP reads the FCB from disk the value there may be outdated if you do not do a RECOVER.
I am using AOS in batch to get this information. Here are the steps that I created in one job:
Wrote a Natural program to check if the destination (Net-Work/DB) is available
If response code 148 then I sent out an email and stop the job.
If response code 0 then I continue with the job
Created an SLOG report by using AOS in batch
Read the output of the report with a Natural program and
checked for number of records in SLOG
If SLOG = blank I sent out an e-mail and the job ends
If SLOG > 0 I started another AOS batch job to
re-open the destination
And the statements for AOS to display SLOG:
PARM=‘…IM=D,STACK=(LOGON SYSAOS;MENU)’
//CMSYNIN DD *
O,replication-engine-db
X
F
B
,FIN
And the statements for AOS to re-open the destination:
PARM=‘…IM=D,STACK=(LOGON SYSAOS;MENU)’
//CMSYNIN DD *
O,replication-engine-db
X
A
K,D123001 destination
,FIN