CA IDMS™ Modernization Series, part 2: Table Procedures and CA IDMS™ SQL Quick Bridge August 5, 2008 Cal J. Domingue.

Slides:



Advertisements
Similar presentations
Using the SQL Access Advisor
Advertisements

Module 3: Block 3 Call Management
1 Senn, Information Technology, 3 rd Edition © 2004 Pearson Prentice Hall James A. Senns Information Technology, 3 rd Edition Chapter 7 Enterprise Databases.
3rd Annual Plex/2E Worldwide Users Conference 13A Batch Processing in 2E Jeffrey A. Welsh, STAR BASE Consulting, Inc. September 20, 2007.
Process Description and Control
Advanced SQL Topics Edward Wu.
CA IDMS TM SQL Routines: An Overview July 22, 2008 Cal J. Domingue.
Chapter 7 Constructors and Other Tools. Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 7-2 Learning Objectives Constructors Definitions.
Copyright © 2003 Pearson Education, Inc. Slide 7-1 Created by Cheryl M. Hughes The Web Wizards Guide to XML by Cheryl M. Hughes.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 4 Computing Platforms.
Processes and Operating Systems
Slide 1 FastFacts Feature Presentation December 13 th, 2007 We are using audio during this session, so please dial in to our conference line… Phone number:
1 Hyades Command Routing Message flow and data translation.
David Burdett May 11, 2004 Package Binding for WS CDL.
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
6 Copyright © 2005, Oracle. All rights reserved. Building Applications with Oracle JDeveloper 10g.
Prepared by: Workforce Enterprise Services For: The Illinois Department of Commerce and Economic Opportunity Bureau of Workforce Development ENTRY OF EMPLOYER.
Local Customization Chapter 2. Local Customization 2-2 Objectives Customization Considerations Types of Data Elements Location for Locally Defined Data.
1 Chapter 12 File Management Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
1 NatQuery 3/05 An End-User Perspective On Using NatQuery To Extract Data From ADABAS Presented by Treehouse Software, Inc.
© Tally Solutions Pvt. Ltd. All Rights Reserved Shoper 9 License Management December 09.
Knowledge Extraction from Technical Documents Knowledge Extraction from Technical Documents *With first class-support for Feature Modeling Rehan Rauf,
Welcome. © 2008 ADP, Inc. 2 Overview A Look at the Web Site Question and Answer Session Agenda.
Version 1.0 digitaloffice.intel.com Intel ® vPro Technology Intel ® Active Management Technology Setup and Configuration HP Laptop – Compaq 6910p Small.
Break Time Remaining 10:00.
Configuration management
File Management in Operating System
13 Copyright © 2005, Oracle. All rights reserved. Monitoring and Improving Performance.
Database Performance Tuning and Query Optimization
© Telcordia Technologies 2004 – All Rights Reserved AETG Web Service Advanced Features AETG is a service mark of Telcordia Technologies. Telcordia Technologies.
PP Test Review Sections 6-1 to 6-6
Chapter 10: Applications of Arrays and the class vector
1 IMDS Tutorial Integrated Microarray Database System.
User Friendly Price Book Maintenance A Family of Enhancements For iSeries 400 DMAS from Copyright I/O International, 2006, 2007, 2008, 2010 Skip Intro.
Chapter 7 Working with Databases and MySQL
Introduction to Structured Query Language (SQL)
Microsoft Confidential. We look at the world... with our own eyes...
1 tRelational/DPS Overview. 2 ADABAS Data Transfer: business needs and issues tRelational & DPS Overview Summary Questions? Demo Agenda.
Health Artifact and Image Management Solution (HAIMS)
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 24.1 Test-Driving the Ticket Information Application.
Operating Systems Operating Systems - Winter 2010 Chapter 3 – Input/Output Vrije Universiteit Amsterdam.
HORIZONT TWS/WebAdmin TWS/WebAdmin for Distributed
Sample Service Screenshots Enterprise Cloud Service 11.3.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
Success with ModelSmart3D Pre-Engineering Software Corporation Written by: Robert A. Wolf III, P.E. Copyright 2001, Pre-Engineering Software Corporation,
 Copyright I/O International, 2013 Visit us at: A Feature Within from Item Class User Friendly Maintenance  Copyright.
Note: A bolded number or letter refers to an entire lesson or appendix. A Adding Data Through a View ADD_MONTHS Function 03-22, 03-23, 03-46,
4 Oracle Data Integrator First Project – Simple Transformations: One source, one target 3-1.
Database System Concepts and Architecture
Adding Up In Chunks.
Executional Architecture
: 3 00.
5 minutes.
Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do.
Types of selection structures
Chapter 12: Designing Databases
Clock will move after 1 minute
1 © 2004, Cisco Systems, Inc. All rights reserved. CCNA 1 v3.1 Module 9 TCP/IP Protocol Suite and IP Addressing.
Chapter 11 Creating Framed Layouts Principles of Web Design, 4 th Edition.
 2003 Prentice Hall, Inc. All rights reserved. 1 Chapter 13 - Exception Handling Outline 13.1 Introduction 13.2 Exception-Handling Overview 13.3 Other.
Select a time to count down from the clock above
1 © 2006 Cisco Systems, Inc. All rights reserved. Session Number Presentation_ID Using the Cisco Technical Support & Documentation Website for Online.
Import Tracking and Landed Cost Processing An Enhancement For AS/400 DMAS from  Copyright I/O International, 2001, 2005, 2008, 2012 Skip Intro Version.
Page 1 Orchard Harvest ™ LIS Find a Patient Training.
Advanced Users Training 1 ENTERPRISE REPORTING FINANCIAL REPORTS.
© Copyright 2011 John Wiley & Sons, Inc.
CA ERwin r8 installing the application things you should know before installing your CA ERwin r8 Data modeling application.
Presentation transcript:

CA IDMS™ Modernization Series, part 2: Table Procedures and CA IDMS™ SQL Quick Bridge August 5, 2008 Cal J. Domingue

Legal This presentation was based on current information and resource allocations as of August 5, 2008 and is subject to change or withdrawal by CA at any time without notice. Notwithstanding anything in this presentation to the contrary, this presentation shall not serve to (i) affect the rights and/or obligations of CA or its licensees under any existing or future written license agreement or services agreement relating to any CA software product; or (ii) amend any product documentation or specifications for any CA software product. The development, release and timing of any features or functionality described in this presentation remain at CA’s sole discretion. Notwithstanding anything in this presentation to the contrary, upon the general availability of any future CA product release referenced in this presentation, CA will make such release available (i) for sale to new licensees of such product; and (ii) to existing licensees of such product on a when and if-available basis as part of CA maintenance and support, and in the form of a regularly scheduled major product release. Such releases may be made available to current licensees of such product who are current subscribers to CA maintenance and support on a when and if-available basis.  In the event of a conflict between the terms of this paragraph and any other information contained in this presentation, the terms of this paragraph shall govern. As is standard with our forward looking presentations, I am obligated to advise you that all of the material presented today is true as of today and is subject to change August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Legal Certain information in this presentation may outline CA’s general product direction. All information in this presentation is for your informational purposes only and may not be incorporated into any contract. CA assumes no responsibility for the accuracy or completeness of the information. To the extent permitted by applicable law, CA provides this document “as is” without warranty of any kind, including without limitation, any implied warranties or merchantability, fitness for a particular purpose, or non-infringement. In no event will CA be liable for any loss or damage, direct or indirect, from the use of this document, including, without limitation, lost profits, lost investment, business interruption, goodwill, or lost data, even if CA is expressly advised of the possibility of such damages. And furthermore, that this material is for informational purposes and does not represent a contractual agreement. August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Abstract CA IDMSTM SQL allows you to access CA IDMSTM databases directly with SQL DML, regardless of whether the databases were originally defined as SQL or network data. For certain database structures or application needs, utilizing routines may make your implementation more efficient and robust; in rare cases they may be required. Part 1 of this 3-part series covered an overview of routines: table procedures, procedures, called procedures, and functions. The series continues in this webcast by exploring table procedures in depth, with details on how to design, code, and deploy them. It will also address how to use CA IDMSTM SQL Quick Bridge to create table procedures, including a live demo of the product.   August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Agenda Business Value of CA IDMS Modernization and SOA SQL routines Review How table procedures compare to other routines Table procedures: structure and coding Table procedures: run-time CA IDMSTM SQL Quick Bridge Session Summary August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Business Value of CA IDMS Modernization and SOA

CA IDMS Business Value: Modernization and SOA Access CA IDMS mainframe assets Databases and business logic Enable Web access, Web services, SOA participation Use standard APIs with CA IDMS SQL, CA IDMS Server SQL, JDBC, ODBC, .NET, Web services … Partner solutions Provide business value benefits Use current developer skills Preserve existing data and applications Deploy on modern platforms: J2EE, .NET Tie CA IDMS assets into modern enterprise architecture Access CA IDMS mainframe assets as enterprise resources Databases and business logic Enable Web access, Web services, SOA participation Use standard APIs with CA IDMS SQL, CA IDMS Server SQL, JDBC, ODBC, .NET, Web services … Partner solutions Provide business value benefits Use current developer skills Preserve existing data and applications Deploy on modern platforms: J2EE, .NET Tie CA IDMS assets into modern architecture August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Modern Application Architecture SOA Web Applications CA IDMS data and business logic Internet CA IDMS™ Server Web and Application Servers August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

SQL Routines: Review How Table Procedures Compare To Other Routines

What is a Routine? Think PIP A routine is a user-written Program or dialog which is Invoked directly by the SQL engine when the routine is referenced in SQL DML; the call is managed by Parameters specified either as part of the definition or as part of a standard set of arguments included in the call. Implications Involves user-written code, must be tested and optimized Code must be written to interface successfully with engine Parameter values have great impact August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

CA IDMS Routines Invoked by SQL engine when referenced in SQL DML Definition specifies external routine name Parameters passed and returned Routine performs I/O and/or processing Possible iterations for table procedure Three types of SQL routines Table procedure Procedure Function August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Types of Routines Type Invoked via reference #Rows Returned #Rows Updated ADS ? SQL Proc Code Table Procedure Datasource in SQL DML 0-many; controlled by code No Procedure Datasource in SQL DML, Call 0-1 0-many OK SQL procedure Function Expression in SQL DML n/a: value n/a SQL function August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

When To Use Table Procedures? Value or Row(s) ? Multiple Rows ? Use SQL Code ? Rows No No Called Procedure Value Yes Yes Use SQL Code ? Table Procedure SQL Procedure No Called Function Yes SQL Function August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

When to Use Table Procedures When SQL access to data is required When direct SQL DML access does not meet needs When views do not meet needs to simplify complex SQL DML Analyze performance requirements Highly variable cardinality and statistics Sophisticated security, i.e. row level, external dependencies Reduce client/server communication To standardize common complex processes Not required for SQL access to some network structures Fixed occurs elements Update/Delete rows where no foreign key defined (ROWID) August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

When to Use Table Procedures (cont.) Required for SQL access to some network database structures Bill of Material Occurs depending on elements Multi-member sets Insert rows in sets and no foreign keys defined Structures requiring special, complex processing (REDEFINES) Within a single SQL transaction Transparently consolidate data from different databases Access segmented databases Access remote data (distributed across nodes) August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Table Procedures Structure and Coding

Implement Table Procedure: CrEATE Create statement: define table procedure in catalog Write the routine COBOL, Assembler, PL/I SQL DML, network DML, neither, or both Must create access module if using SQL DML Enable security Add program definition to system (DC/UCF) Test and debug Efficiency check: optimize & tune August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Create Statement: Define In The Catalog Schema and name External name: associates table procedure with load module Parameters: Name, SQL data type, optional default Language: Assembler, COBOL, PL/I Protocol IDMS Local and global work areas Default database current Other attributes: estimates, system/user mode, etc. August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Create Table Procedure: Example CREATE TABLE PROCEDURE DEMOEMPL.TBLPROC ( E_ID UNSIGNED NUMERIC(4), E_NAME CHARACTER(25), E_ADDRESS CHARACTER(46) ) EXTERNAL NAME TPROCPGM ESTIMATED ROWS 1000 ESTIMATED IOS 100 USER MODE LOCAL WORK AREA 800 GLOBAL WORK AREA 1200 KEY SHR1 TRANSACTION SHARING DEFAULT DEFAULT DATABASE CURRENT TIMESTAMP ; Black is required keywords; grey are user-supplied required parms; blue are optional parms … USER MODE Specifies the table procedure should execute as a user-mode application program within CA IDMS. This is the default value unless SYSTEM MODE is specified. SYSTEM MODE Specifies the table procedure should execute as a system-mode application program. To execute as system mode, the program must be: Written in Assembler Fully reentrant LOCAL WORK AREA CA IDMS allocates a local storage area on the first call to a table procedure for each SQL statement within a transaction or for a set of SQL statements which are related through reference to the same cursor (OPEN, FETCH, CLOSE, positioned UPDATE, and DELETE statements are related through a cursor). The same local storage area is passed to the table procedure for all calls for one statement or related statements. When the SQL statement has completed execution or when the cursor is closed, the local work area is released. Note: If you do not code a LOCAL WORK AREA clause, the default local storage size is 1024 bytes. GLOBAL WORK AREA CA IDMS allocates a global storage area once within a transaction and retains it until the transaction terminates. key-id Specifies the one- to four-character identifier for the global storage area. Advantage CA-IDMS passes the same piece of global storage within a transaction to all SQL routines that have the same global storage key. If you do not specify a storage key, Advantage CA-IDMS allocates each table procedure its own global storage area, which is not used for any other routine within the transaction. August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Create: Options on r16 & higher Default database option Enables database name inheritance Procedure inherits dbname of session Transaction sharing option Can share session locks Eliminates deadlocks Synchronization timestamp Defaults to current day/time Migrating to another environment Force recompilation of access modules Force renewal of statements in cache August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Write The Table Procedure CA IDMSTM SQL Quick Bridge Generates COBOL source, SQL DDL, Sysgen Program COBOL code can be modified if necessary Interface successfully with SQL engine Highly structured code and storage layout Parameter-driven (input and output) One for each parameter specified in the definition One null indicator for each parameter in the definition Common arguments Language-specific description must match SQL data type COBOL protocol BATCH for maximum portability Existing code possible to include within structured code August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Write The Table Procedure (cont.) Storage layout essential to communicate with SQL engine Code must test input parameters Perform appropriate code based on values Determine flow of control within sections Code must set output parameters SQLSTATE is required, controls when iteration is stopped 00000 -- Indicates success  01Hxx -- Indicates a warning 02000 -- Indicates no more rows 38xxx -- Indicates an error Values, indicators (0, -1) required to return row Customized error messages optional August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Write The Table Procedure: Work Areas Linkage Section in COBOL Local work area – can’t exceed size in definition Separate area for each scan Preserved over calls within scan (DML) Database position, input parameters, etc Global work area– can’t exceed size in definition Shared by procedures and scans in transaction Subschema control Has an associated key August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Write The Table Procedure: Work Areas COBOL working storage contents not retained across calls Values on first request for a scan might have been altered in prior request Working-storage section allocation and initialization varies Local mode vs. within the DC/UCF address space Concurrent scans are being processed Use working storage only for: Constants the SQL routine will never change Variables initialized and used within single call to program Other variables must be defined in local or global work area August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Write: Common Arguments 77 RESULT-IND PIC S9(4) USAGE COMP SYNC. 01 SQLSTATE. 02 SQLSTATE-CLASS PIC XX. 02 SQLSTATE-SUBCLASS PIC XXX. 77 PROCEDURE-NAME PIC X(18). 77 SPECIFIC-NAME PIC X(8). 77 MESSAGE-TEXT PIC X(80). 01 SQL-COMMAND-CODE PIC S9(8) USAGE COMP SYNC. 01 SQL-OP-CODE PIC S9(8) USAGE COMP SYNC. 88 SQL-OPEN-SCAN VALUE +12. 88 SQL-NEXT-ROW VALUE +16. 88 SQL-CLOSE-SCAN VALUE +20. 88 SQL-SUSPEND-SCAN VALUE +24. 88 SQL-RESUME-SCAN VALUE +28. 88 SQL-INSERT-ROW VALUE +32. 88 SQL-DELETE-ROW VALUE +36. 88 SQL-UPDATE-ROW VALUE +40. 01 INSTANCE-ID PIC S9(8) USAGE COMP SYNC. Optional for procedure, required for table procedure August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Write: Linkage Section Example

Enable Security Security identical to a table Grant and revoke SELECT, INSERT, UPDATE, DELETE, DEFINE privileges To create Own the schema in which the table procedure is Hold the CREATE privilege on table procedure To invoke, either own or hold privilege for verb August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Add Program Definition to System Required when executing in CA IDMS Central Version Example ADD PROGRAM CAAVLREC DUMP THRESHOLD IS 0 ERROR THRESHOLD IS 5 ISA SIZE IS 0 LANGUAGE IS COBOL . Before sysgen cycle, use dynamic definition for testing DCMT VARY DYN PRO CAAVLREC COBOL . August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Test and Debug Routines DISPLAY commands in COBOL, PL/I to print to file (LE/370) Automatically generated by CA IDMS SQL Quick Bridge Reference in local mode DML to trace path through logic SYSIDMS parameters DMLTRACE=ON SQLTRACE=ON PROCTRACE=ON (with either above) “DEBUG”  COBOL statements (compile with DEBUG option) CV mode testing CA IDMSTM Performance Monitor or other monitor for statistics WRITE TO LOG or SNAP commands for trace, data structures DISPLAY commands to trace logic path, show values Evaluate logical results DISPLAY: LE/370 support required for this to work under DC; fine for local August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Efficiency: Statistics and Optimization Code efficiency only concern if routine is sole data source Statistics provided manually (only) Table procedure definition, key definition ESTIMATED ROWS ESTIMATED IOS Lower values encourage execution of table procedure first Very useful in joins with other data sources Verify access path with EXPLAIN Test thoroughly Document extensively Keys values override those on the definition *iF8 values are August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Efficiency: Keys CREATE KEY EMP1 ON DEMOEMPL.TBLPROC(E_ID) Define with CREATE KEY statement Specifying key columns KEY estimated values override routine values if all KEY elements specified Influences join strategy Statistics for KEY used in optimization Using a key in join operations Specify in “WHERE” clause Encourage use by specifying low value for statistics CREATE KEY EMP1 ON DEMOEMPL.TBLPROC(E_ID) ESTIMATED ROWS 1 ESTIMATED IOS 1; August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Table Procedures Run-Time

Invoking a Table Procedure SQL DML statements Reference in FROM, like view or table Use in any DML statement Program DML independent of SQL DML Parameter values passed dependent on type of DML Possible to use a CALL statement For CA IDMSTM Server 5.0, from JDBC procedure call For CA IDMSTM Server r16, from ODBC procedure call “Where” filters output from table procedure Not required; no “where” returns all occurrences it is possible to invoke a table procedure using an SQL CALL statement by setting CallSelect = 1 either in the Windows registry, caidms.cfg file or in a Java properties file.  Generally a client would only want to do this if they had changed the SYSCA.ACCESSIBLE_PROCS view to include type “R” (table procedures) in addition to “P” (procedures).  The difference is that then the CALL statement will be treated exactly like a SELECT in that a result set will be returned which can be fetched like any other result set.  Ordinarily, a CALL statement causes input/output or output parameters to be filled in without the program having to open a cursor or fetch data.    In Server r16, we implemented this capability in ODBC (it existed in JDBC in r5.0).  In talking with Dave Ross, the CallSelect feature was something he thought might be handy for compatibility purposes, but I don’t know that any client has actually used it.  It’s not something we encourage, but it is there if anyone needs it. August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Table Procedure Called iteratively, returns 0 to many rows Invoked repetitively Must return SQLSTATE=02000 or 38nnn to stop invocations Next call determined based on SQLSTATE of previous call Results rows determined by values returned and WHERE Runs as subroutine called by SQL engine Highly structured program code Formalized Linkage Section Matching PROCEDURE DIVISION USING August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Interpret Parameters: Command Code First thing to check in the program code SQL-OP-CODE element in common arguments Indicates type of SQL DML for which the call is issued SELECT FETCH INSERT Etc. Based on value, code must perform appropriate sections August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Interpret Parameters: Operation Code Queries: Open, Next Row, Close operation codes Open Allocate resources Retrieve the values of input parameters Perform processing needed to get ready to retrieve the rows Next Row Retrieve and return the database row Close Release resources August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Translating DML to Table Procedure Calls SQL DML Open Scan Next Row Delete Row Update Row Close Scan Insert Row Suspend Scan Resume Scan SELECT X 2, 3… Delete Search 2a,3a… 2b,3b… UPDATE Searched DELETE Positioned UPDATE Positioned OPEN FETCH CLOSE INSERT SUSPEND RESUME August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Explicit Parameters Used to pass values to table procedure Specify via table procedure reference By position Keyword/value pairs Specify in a WHERE clause, passed if They are part of an equality test Equality test is not combined with OR Equality test not preceded by NOT “Where” filters output from table procedure SELECT * FROM EMP.ORG (MGR_ID = 7) WHERE EMP_ID = 127 August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Explicit Parameters Passed by Operation Open Selection criteria from WHERE Parameter values in procedure reference Default value if WITH DEFAULT specified in definition Update row Previous “Next Row” values Overlaid with SET value Insert row From VALUES of INSERT or SELECT Defaults or nulls Other calls Undefined input August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Explicit Parameters To Return From table procedure to SQL engine Always return a value for SQLSTATE Required to determine subsequent call 02000 or 38000 required to terminate processing If operation code is NEXT ROW Provide values for all parameters Set indicator variables to -1 if no value Optional 80-byte message area (embedded in standard DB message) August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

SQLSTATE Value Description SQL Engine Action 00000 Request was Next call (see chart); or successful return to application 01Hxx Success with Next call (see chart); or warning return to application 02000 No more rows to Close call; or be returned return to application 38xxx Procedure Rollback any changes and detected an error return to application August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

TBLPROC Example SELECT * FROM DEMOEMPL.TBLPROC WHERE E_ID = 371; August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

TBLPROC Example (cont.) SQL Engine E_ID = 371 E_ID_I = 0 Command=SELECT Operation=OPEN Check Operation Call OPEN Section Bind RU Bind Employee Ready Area Save E_ID if not null Evaluate SQLSTATE 00000, so NEXT SQLSTATE = 00000 August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

TBLPROC Example (cont.) SQL Engine TBLPROC Check Operation Call NEXT Section Check CALC-DONE flag Obtain CALC Employee Set flag CALC-DONE Command=SELECT Operation=NEXT Evaluate SQLSTATE 00000, so evaluate returned row with where clause values Then issue NEXT E_ID = 0371 E_ID_I = 0 E_NAME=Beth Cloud E_NAME_I = 0 E_ADDRESS=3456 Pinky Ln E_ADDRESS_I = 0 SQLSTATE = 00000 August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

TBLPROC Example (cont.) SQL Engine TBLPROC Check Operation Call NEXT Section Check CALC-DONE Return no more rows Command=SELECT Operation=NEXT Evaluate SQLSTATE 02000, so CLOSE SQLSTATE = 02000 August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

TBLPROC Example (cont.) SQL Engine TBLPROC Command=SELECT Operation=CLOSE Check Operation Call CLOSE Section FINISH Evaluate SQLSTATE 0000, so return to application SQLSTATE = 00000 August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

CA IDMSTM SQL Quick Bridge Function and Use

SQL Quick Bridge: QO93444 GUI front-end Uses existing ODBC data source definitions Pull-down menus Structured approach to walk network structure Specify schema, subschema Walk record from top to bottom in network structure Specify desired records, key fields, target elements Generates definition, sysgen program statement and COBOL program Can upload all components to CV Latest version can be downloaded via the APAR August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Connect to Data Source August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Define New Table Procedure:. - SQL schema, name, external name Define New Table Procedure: - SQL schema, name, external name - Specify network schema & subschema - Specify supported DML statements Specify existing SQL schema, dynamic names for TP & external name Pull-down menus will display all valid nonSQL schemas. Once schema selected, all valid subschemas will be displayed. Can control security by identifying what type SQL DML is to e supported; any call not specified here will be rejected with an error. August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Entry Point - Calc or index record - Specify calckey or sortkey August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Path Records. - Drill down using sets Path Records - Drill down using sets - Identify key fields for each record August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Identify Target Record. - Identify desired fields Identify Target Record - Identify desired fields - Auxiliary records as desired August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Generate Then Upload August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Live Demo August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Summary

Session Summary Use table procedures Table Procedures When SQL access is required When direct SQL DML access doesn’t meet needs To access certain network database structures For some performance reasons Table Procedures CrEATE: follow the steps Return multiple rows from a single call Are highly structured in storage layout and code Must interpret parms to direct flow of control Must set value for SQLSTATE on every call Create statement: define table procedure in catalog Write the routine Enable security Add program definition to system (DC/UCF) Test and debug Efficiency check: optimize & tune August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Session Summary (cont.) SQL Quick Bridge GUI front-end for developing Table Procedures Walks network CA IDMS database Entry record: chose Calc or Indexed record Path records: top-down hierarchical structure Target record: lowest in hierarchy Auxiliary records Generate & upload Test and verify results August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

For More Information Recorded Webcast: support.ca.com http://ca.com/us/webcasts/ondemand/default.aspx CA IDMSTM Modernization: Overview of CA IDMSTM SQL Routines CA IDMSTM Modernization: CA IDMSTM Procedures, Advanced Topics support.ca.com CA IDMS knowledge documents Product manuals CA IDMS SQL Reference Guide CA IDMS r17 Release Summary (available at GA) Technical support Analyst white paper on CA IDMS modernization and SOA Leveraging CA IDMS™ Business Value for Innovation See ca.com/idms under Analyst Reports August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

CA WORLD 2008: November 16th – 20th The Venetian Congress Center and Sands Expo, Las Vegas The biggest Mainframe ISV Event in the world in 2008! CA IDMS sessions in Mainframe and Multi-Platform Application Development Focus Area Customer, Partner and CA speakers Optimization, Modernization, SOA and r17 sessions Pre-conference Education EC802EN CA IDMS: Implementing and Maintaining the Database EC801EN CA IDMS Performance and Tuning Networking Opportunities Technical Campground, Birds-of-a-Feather session, Exhibition Center, Power lunches Visit www.caworld.com for more details August 5, 2008 CA IDMS™ Modernization Series:Table Procedures and CA IDMS™ SQL QuickBridge Copyright © 2008 CA

Questions & Answers

Thank You for Attending Today’s Webcast