Using ODBC from DC-COBOL and BATCH COBOL

672 views
572 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
672
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Using ODBC from DC-COBOL and BATCH COBOL

  1. 1. Using ODBC from DC-COBOL and BATCH COBOL VG-COBOL Precompiler Overview
  2. 2. Contents Overview Input and output SQL access mode Using the precompiler Precompiler parameters Link edit considerations
  3. 3. Contents Extended unit of work Abnormal end of unit of work System requirements
  4. 4. Overview Enables COBOL applications to access and update CA-IDMS/DB IBM DB2 ODBC-compliant databases (via VG-ODBC Server) Supported environments DC-COBOL BATCH COBOL
  5. 5. Overview Runs in BATCH Embedded SQL DB2 SQL COBOL ODBC target DBMS ODBC functions DATABASE(), CURDATE(), etc. Target DBMS functions TO_NUMBER, TO_CHAR, etc. Bulk fetch in ODBC
  6. 6. SQL Access Mode Dynamic SQL Stored procedures are supported in ODBC input, output and return parameters a single result set automatic bulk fetch
  7. 7. Using the Target DBMS Precompilation against the target database Enable/disable in Options Table Problem some ODBC drivers may execute SQL statements in SQLPrepare function
  8. 8. Using the Target DBMS If enabled SQL tables must exist in the target system most of the errors are detected at precompilation time If disabled errors are detected at run-time syntax errors data conversion errors result set definitions are built using FETCH and SELECT INTO
  9. 9. Precompiler parameters DEBUG=YES/NO enable only if we needed by us GENCOM automatically generates CA-IDMS COMMIT/ROLLBACK LINES lines per page in the output listing LIST Errors/SQL/Y(all source statements)
  10. 10. Precompiler parameters RUNENV Batch IDMS X run time environment is resolved at link edit phase - SQLKWD SQL keyword recognized by the precompiler default is in Options Table
  11. 11. Link Edit Considerations RUNENV Execution Resolved by parameter Environment Reference INCLUDE of Batch Batch MSQLBINT MSQLBINT IDMS CA-IDMS/DC/UCF MSQLDINT MSQLDINT X Batch MSQLXINT MSQLBXNT CA-IDMS/DC/UCF MSQLXINT MSQLDXNT All All MSQLEDIT MSQLEDIT All All MDB2EV01 MDB2EV01
  12. 12. Extended Unit of Work Unit of Work starts upon the first executable SQL statement Control verbs terminate the Unit of Work STOP RUN, GOBACK, EXIT PROGRAM, TRANSFER (no return), DC RETURN To extend the Unit of Work insert the following statement immediately before a control verb MOVE ‘Y’ TO WDB2EXT
  13. 13. Abnormal end of Unit of Work CALL to a sub-program if there is no SQL, Unit of Work continues if control does not return, application abends solution insert CALL ‘SQLDALC’ before calling the sub- program
  14. 14. System Requirements COBOL compiler OS/VS COBOL COBOL II COBOL/MVS To access DB2 VG-IDMS/DB2 Batch Server (CAF) IBM DB2 V2R2 or later
  15. 15. System Requirements To access ODBC ODBC c - ompliant DBMS System 32bit ODBC driver VG O - DBC Server If TCP/IP is used VG-IDMS Gateway TCP/IP Option TCP/IP Systems Software for OS/390 (IBM or CA-NetworkIT TCPAccess) If APPC is used CA-IDMS-DC 10.2x or later MS SNA Server 2.11 or later
  16. 16. End of Presentation See www.vegasoft.com for international distributors.

×