170 likes | 323 Views
Data Replication: The SQL. Andy Engels 14 th NATURAL Conference October, 2006. Agenda. What they’re doing with Connx Why they’re doing it How they’re doing it How Connx works Additional features of Connx used. The Layout. Connx CICS Server. VB.net Application. ADABAS. SQL
E N D
Data Replication: The SQL Andy Engels 14th NATURAL Conference October, 2006
Agenda • What they’re doing with Connx • Why they’re doing it • How they’re doing it • How Connx works • Additional features of Connx used
The Layout Connx CICS Server VB.net Application ADABAS SQL Server NATURAL Trigger & Stored Procedure Assembler Connx ODBC Client
The Layout ADABAS VB.net Application Bridge 1 SQL Server Bridge 2 Pending Part 1 NATURAL
ADABAS COBOL The Layout Acct Pending Part 2
The Why Connx CICS Server VB.net Application ADABAS SQL Server NATURAL Trigger & Stored Procedure Assembler Connx ODBC Client
The Why VB.net Application SQL Server
The Steps • Systrans a DDM to the server • Using the Connx Data Dictionary, incorporate the Systrans file • Save the Connx CDD file • Define an ODBC source • Define a SQL Server Linked Server pointing to the Connx ODBC source • Set up a trigger to fire – as data is added to the SQL Server table, run the INSERT against ADABAS • 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
The Natural *************************************** *** 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………… 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
The Assembler 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 *===*
Connx ODBC driver Connx CDD File Pieces Connx “Data Dictionary” Utility SYSTRANS
Pieces CICS NX00 – Connx listener This background task fires off additional tasks as needed to handle calls ADABAS ADA0 – handles all Data base activity for a Caller. Spawned by NX00 ADABAS HP interface linked in (ADALNK)
NX00 ADA0 The Big Picture Connx CDD File TCP/IP Connx ODBC driver Application / SP SQL Query ADABAS
Additional Feature Connx CDD File NX00 TCP/IP Connx ODBC driver ADA0 Data Sync Utility SQL Server ADABAS
NX00 ADA0 Additional Feature Connx CDD File TCP/IP Connx ODBC driver SQL Server ADABAS SQL Query
Data Replication: The SQL Questions??? Andy Engels 14th NATURAL Conference October, 2006