Data Replication: The SQL
Andy Engels14th NATURAL ConferenceOctober, 2006
Agenda
1. What they’re doing with Connx2. Why they’re doing it3. How they’re doing it4. How Connx works5. Additional features of Connx used
VB.net Application
Trigger & Stored Procedure
NATURAL
SQL Server
Assembler
ADABAS
Connx ODBC Client
Connx CICS Server
The Layout
VB.net Application
SQL Server
ADABAS
The Layout
NATURAL
Bridge 1
Bridge 2
Pending
Part 1Part 1
The Layout
ADABAS
COBOL
Pending
Acct
Part 2Part 2
VB.net Application
Trigger & Stored Procedure
NATURAL
SQL Server
Assembler
ADABAS
Connx ODBC Client
Connx CICS Server
The Why
VB.net Application
SQL Server
The Why
The Steps
1. Systrans a DDM to the server2. Using the Connx Data Dictionary, incorporate the
Systrans file3. Save the Connx CDD file4. Define an ODBC source5. Define a SQL Server Linked Server pointing to
the Connx ODBC source6. Set up a trigger to fire – as data is added to the
SQL Server table, run the INSERT against ADABAS
7. Start a batch job of a NATURAL program to scan for work in the ADABAS table
The SQL
INSERT INTO BridgeADA(AcctLicenseeName, AcctNbr, ProdNbr )FROM BridgeTable
ADD 1 TO SYNCS_PROCESSED
WRITE '(inside read) Handled a record' *TIME
END-READ /* (0530)
WRITE 'Going to sleep for a few seconds.' *TIME
CALL 'ISSLEEP' SLEEP_LENGTH
WRITE 'Woke up.' *TIME
END-REPEAT
***************************************
*** Housekeeping
***************************************
SLEEP_LENGTH := 10
FORMAT LS=133 PS=50
** Main loop
WRITE 'Now entering main loop to wait for work' *TIME
REPEAT
WRITE / 'Going to read bridge file looking for work.' *TIME
READ PAM BY STAT-ACCT-SER-KEY /* check this file for work
IF ACCT-LICENSEE-NAME = 'QUITQUIT’' THEN
WRITE 'Shutting down per request' *TIME
END-IF
………… Do stuff here – take data from pending and put into bridge tables …….
….. Relieve status field – mark as processed…………
The Natural
STM 0,15,SAVEREG STORE ALL REGISTERS *===*
SR R9,R9 MAKE SURE R9 IS CLEAN *===*
DROP 15 *===*
BALR R9,0 *===*
USING ISSLEEP,R9 *===*
LR R9,R15 POINT TO OURSELVES *===*
* ----------------------- *===*
* M A I N R O U T I N E *===*
* ----------------------- *===*
L R7,0(,R1) LOAD PASSED PARM ADDRESS LIST *===*
L R8,0(,R7) LOAD PASSED PARM INTO INTV REG *===*
STIMER SETIME (R8),ISTECB1 SET UP INTERVAL INTO ECB *===*
WAIT ISTECB1 GO TO SLEEP *===*
* OK, WAKE UP AND GO HOME *===*
* ----------------------- *===*
* E T G O H O M E ! ! *===*
* ----------------------- *===*
EXITHERE EQU * *===*
SR R15,R15 CLEAR OUT REGISTER 15 RC=0 *===*
LM 0,13,SAVEREG RESTORE REGISTERS *===*
BR R14 RETURN *===*
The Assembler
Pieces
Connx “Data Dictionary”Utility
SYSTRANS
Connx CDD File
Connx ODBC driver
Pieces
NX00 – Connx listener
This background task fires off additional tasksas needed to handle calls
ADA0 – handles all Data base activity for aCaller. Spawned by NX00
ADABAS HP interface linked in (ADALNK)
CICS
ADABAS
The Big Picture
NX00
ADA0
Connx CDD File
Connx ODBC driver
Application / SP SQL Query
TCP/IP
ADABAS
Additional Feature
NX00
ADA0
Connx CDD File
Connx ODBC driver
Data SyncUtility
TCP/IP
ADABASSQL Server
NX00
ADA0
Connx CDD File
Connx ODBC driver
SQL Query
TCP/IP
ADABAS
Additional Feature
SQL Server
Andy Engels14th NATURAL ConferenceOctober, 2006
Questions???
Data Replication: The SQL
Recommended