alison coughtrie european ims architecture team … explorer.pdfispf sdsf jes user mods user exits...

77
© 2012 IBM Corporation IMS Explorer for Development April 2012 Alison Coughtrie European IMS Architecture Team

Upload: others

Post on 11-Mar-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation

IMS Explorer for Development April 2012

Alison Coughtrie European IMS Architecture Team

Page 2: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 2

Agenda

IMS Explorer for Development - Overview and Demo

Page 3: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 3

Important Disclaimer

© Copyright IBM Corporation 2012. All rights reserved. U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN ADDITION, THIS INFORMATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE. IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION. NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, NOR SHALL HAVE THE EFFECT OF, CREATING ANY WARRANTIES OR REPRESENTATIONS FROM IBM (OR ITS SUPPLIERS OR LICENSORS), OR ALTERING THE TERMS AND CONDITIONS OF ANY AGREEMENT OR LICENSE GOVERNING THE USE OF IBM PRODUCTS AND/OR SOFTWARE.

IBM, the IBM logo, ibm.com, Information Management, IMS, CICS, DB2, WebSphere and z/OS are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both. If these and other IBM trademarked terms are marked on their first occurrence in this information with a trademark symbol (® or ™), these symbols indicate U.S. registered or common law trademarks owned by IBM at the time this information was published. Such trademarks may also be registered or common law trademarks in other countries. A current list of IBM trademarks is available on the Web at “Copyright and trademark information” at www.ibm.com/legal/copytrade.shtml Other company, product, or service names may be trademarks or service marks of others.

Page 4: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 4

IMS Application Development Challenges

Difficult to test and deploy applications

Lack of integrated development solutions and tools

Difficult to find DLI programmers

Shrinking knowledge base around IMS & hierarchical data base model

Fewer experienced COBOL and PL/I programmers

Page 5: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 5

JCL ISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI

IMS interfaces

IMS TM/DB

Database

IMS NEW IMS interfaces

DDL Restful Schemas Dynamic Point and Click Drag and Drop

Installation and Operations

Application Development

Reporting and Analysis

Reduce the need for special, in-depth IMS skills

IMS AD Simplification Strategy

Page 6: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 6

Introducing IMS Explorer for Development… Simplifying IMS application development!

Easier visualization and editing of IMS Database and Program (PSB) Definitions

– Provide graphical editors to: • Display IMS database hierarchical structures • Display/create/edit PSBs • Change/add fields on a DBD

– Import COBOL copybooks and PL/I data structures to a database segment* – Generate DBD and PSB source – Generate metadata needed by Java applications and for SQL access from Explorer

Ability to easily access IMS data using SQL statements – Leveraging IMS 11 Universal JDBC driver and Open Database

Connectivity to the z/OS system – Browse a Data Set and submit JCL – Import and export DBD and PSB source files from a Data Set to the IMS Explorer, and

vice-versa

*Requires RDz 8.0 or later

Page 7: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 7

Displaying an IMS Database Structure via “Green Screen”

Understanding a database by

reading its source isn’t easy for

newcomers to IMS

Page 8: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 8

Displaying an IMS Database Structure with IMS Explorer

Much easier to

understand the database

structure

Page 9: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 9

Displaying an IMS Database Structure with IMS Explorer…

Much easier to understand the

hierarchy & related

databases

Page 10: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 10

Displaying an IMS Database Structure with IMS Explorer…

Page 11: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 11

Printing a Copy of the Visual Layout

To Print the

Layout

1. Right Click within the diagram. 2. Then select “Print” from the drop down box.

Page 12: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 12

PSB and PCB Definitions via “Green Screen”

Typical Green Screen

Display of PCB Definitions

within a PSB

Page 13: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 13

Building a PCB definition with IMS Explorer

To Display the PCB Graphically and Optionally edit

sensitivity

1. Click the required PSB. 2. Then select the required PCB. 3. Then select “Edit data sensitivity ...” on the right.

Page 14: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 14

Building a PCB definition with IMS Explorer …

1

2 The Senfld shows in the “Generated Source”

Page 15: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 15

Building a PCB definition with IMS Explorer …

1. The Senfld shows in the “Generated Source”

Compare the “Imported” & “Generated”

source

Page 16: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 16

Displaying an IMS Database’s contents with DFSDDLT0

Page 17: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 17

Displaying an IMS Database with IMS Explorer

View w/ the SQL results

SQL Builder with content assistance to build a SQL statement

Here you can create SQL scripts with

Select, Update,

Delete, Insert statements

Page 18: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 18

Browsing Data Sets and Submitting JCL

Page 19: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 19

Browsing Data Sets and Submitting JCL with IMS Explorer

JES output is displayed

here

Browse data sets

Edit a data set member

Page 20: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 20

IMS Explorer and IMS Catalog

IMS Catalog is Generally Available in IMS Version 12 from 23rd April 2012 – APAR PM45935/UK77995

Page 21: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 21

IMS Explorer … where do you get it from?

Download as part of IMS Enterprise Suite – ibm.com/ims – Click on IMS Enterprise Suite

Download the IMS Explorer ibm.com/ims Click on IMS Enterprise Suite

Page 22: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 22

IMS Explorer … two offerings

Stand-alone offering

Shell-sharing offering for use with RDz 8.0.3 or Optim Development Studio 2.2.1.1 or later

Page 23: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 23

Software Requirements

The IMS Explorer supports IMS Version 10 and later

To import COBOL and PL/I data structures, the IMS Explorer must be installed into Rational Developer for System z Version 8.0 or later

For SQL access to an IMS database from IMS Explorer, you must have IMS Version 11 or later on your host system

– Your host environment must be configured to support the Open Database enhancements

If you have a Technology Preview version of the IMS Explorer installed, you must uninstall it prior to installing Version 2.1.1

The IMS Explorer supports cross-product integration (shell-sharing) with the following products: – Rational Developer for System z Version 8.0.3 or later – IBM® Optim™ Development Studio Version 2.2.1.1 or later – IBM Problem Determination Tools Plug-ins for Eclipse

IMS Explorer for Development RDz shell-sharing environment non-RDz environment

Open Database IMS Catalog Open Database IMS Catalog

WITH WITHOUT WITH WITHOUT WITH WITHOUT WITH WITHOUT

Visualization/editing of PSB, DBD X X

Access z/OS system - Files & Sysouts X (through RDz's native function) X (through CICS Explorer Plugin & FTP)

Download & Upload PSB & DBD from z/OS X X

SQL access X X X X X X

Cobol and PLI import X X X X

Import source from Catalog (when Catalog-enabled)

X X X X

Page 24: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 24

Access IMS Data using JDBC and IMS Open Database

Windows z/OS

Cognos

IMS Universal Database

Driver

TCP

I

P

TCP

IP

IMS Connect

SCI

ODBM

SCI

ODBA

CTL IMS DB

PC

IMS

TCPIP

IMS Explorer

Page 25: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 25

IMS Explorer for Development

Page 26: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 26

IMS Java Hierarchical to Relational Mapping

Each Segment Type maps to a Table – Each segment is a row, each field is a column

Relational Design

DealerNo DealerName DealerAddress Dealer Table

53SJ7 George 555 Bailey Ave. 53SJ8 Bob 240 Elm St. 53SJ9 Mary 111 Penny Ln. ... ... ...

UU45 | Dodge | Viper PR27 | Dodge | Durango

53SJ9 | Mary | 111 Penny Lane 53SJ8 | Bob | 240 Elm St.

DEALER Segments

MODEL Segments

FF13 | Toyota | Camry

53SJ7 | George | 555 Bailey Ave.

Hierarchical Design

JPR27 | Dodge | Durango WJ45 | Mercury | Cougar

DLRNO NAME ADDRESS

MODID MAKE MODTYPE

DEALER

SALESINF

SALESPER

STOCK SALES

MODEL

ORDER

Model Table ID Make ModType DealerNo

UU45 Dodge Viper 53SJ7 PR27 Dodge Durango 53SJ7 FF13 Toyota Camry 53SJ7 JR27 Dodge Durango 53SJ8 WJ45 Mercury Cougar 53SJ8 ... ... ... ...

Virtual Foreign Key

Page 27: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 27

IMS Explorer Generated Metadata

Java Class that has a 1:1 relation with the IMS PSB (not a complete example)

package autpsb11; import com.ibm.ims.db.*; import com.ibm.ims.base.*; ...... // The following describes Segment: DEALER ("DEALER") in PCB: AUTOLPCB ("AUTOLPCB") private DLITypeInfo[] AUTOLPCBDEALERArray() { DLITypeInfo[] AUTOLPCBDEALERArray= { new DLITypeInfo("DealerNo", DLITypeInfo.CHAR, 1, 4, "DLRNO", DLITypeInfo.UNIQUE_KEY), new DLITypeInfo("DealerName", DLITypeInfo.CHAR, 5, 30, "DLRNAME"), new DLITypeInfo(“DealerCity", DLITypeInfo.CHAR, 35, 10, "CITY"), new DLITypeInfo(“DealerZip", DLITypeInfo.CHAR, 45, 10, "ZIP"), new DLITypeInfo(“DealerPhone", DLITypeInfo.CHAR, 55, 7, "PHONE"), new SecondaryIndexInfo("XFLD2","MODEL",AUTOLPCBDEALERKeys, "XFLD2", 20), };

...... DLITypeInfo[] AUTOLPCBDEALERArray = AUTOLPCBDEALERArray (); DLISegment AUTOLPCBDEALERSegment = new DLISegment ("DEALER","DEALER",AUTOLPCBDEALERArray,61); ...... DLISegmentInfo[] AUTOLPCBarray = new DLISegmentInfo[8]; AUTOLPCBarray[0] = new DLISegmentInfo(AUTOLPCBDEALERSegment,DLIDatabaseView.ROOT); AUTOLPCBarray[1] = new DLISegmentInfo(AUTOLPCBMODELSegment,0); AUTOLPCBarray[2] = new DLISegmentInfo(AUTOLPCBORDERSegment,1); AUTOLPCBarray[3] = new DLISegmentInfo(AUTOLPCBSALESSegment,1); AUTOLPCBarray[4] = new DLISegmentInfo(AUTOLPCBSTOCKSegment,1); AUTOLPCBarray[5] = new DLISegmentInfo(AUTOLPCBSALESPERSegment,0); AUTOLPCBarray[6] = new DLISegmentInfo(AUTOLPCBSALESINFSegment,6); AUTOLPCBarray[7] = new DLISegmentInfo(AUTOLPCBEMPLINFOSegment,6);... }

Not intended to be read by the programmer

IMS metadata Defines java names

View/PCB

Table/segment

Column/field

Defines data type of each column

Used by JDBC driver to convert SQL call into DL/1 equivalent

Page 28: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 28

IMS Explorer Generated Metadata ...

Java Class that has a 1:1 relation with the IMS PSB

Page 29: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 29

Query Governance

Cannot execute SQL queries that filter (search) results based on fields not defined in a DBD

– Columns in the WHERE clause must be DBD defined fields or subfields that make up the DBD defined field

Cannot execute SQL queries that join IMS segments that are not in the same hierarchic path (unless a logical relationship has been established between them)

A

E D B

C F G

Page 30: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 30

Virtual Foreign Key Fields

In relational databases, hierarchies can be logically built by creating foreign key relationships between tables

In IMS, the hierarchies are explicit and are part of the database definition itself

IMS 11 introduces the concept of virtual foreign keys to capture these explicit hierarchies in a relational sense

– makes the SQL syntax for IMS appear similar to standard SQL

When accessing IMS DB, every table that is not the root table in a hierarchic path will virtually contain the keys of all of its parent segments up to the root of the database

– called virtual foreign key fields

This allows SQL SELECT, INSERT, UPDATE, and DELETE queries to be written against specific tables and columns located anywhere in a hierarchic path.

There are no changes to the DBD to enable this support

Page 31: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 31

Virtual Foreign Key Fields …

A

B

C

DBD Definitions Sequence Field A1 Field A2 Field A3

Sequence Field B1 Field B2 Field B3

Sequence Field C1 Field C2

Columns Visible to SQL Application Key Field A1 Field A2 Field A3

Key Field B1 Field B2 Field B3 Virtual Foreign Key A_A1

Key Field C1 Field C2 Virtual Foreign Key A_A1 Virtual Foreign Key B_B1

Table A

Table C

Table B

Page 32: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 32

Virtual Foreign Key Fields …

With the “Classic” JDBC driver (prior to the IMS Universal JDBC drivers), an insert of a non-root segment required an SQL INSERT with a WHERE clause (non-standard SQL)

– To position the new segment correctly in the hierarchy

With the IMS Universal JDBC drivers, a standard SQL INSERT is used – Positioning established by use of the virtual Foreign Keys

Example:

INSERT INTO PCB01.C (A_A1, B_B1, C1, C2) VALUES ('12345', 'UVWXYZ', 'C1VALUE', 'C2VALUE')

– If the foreign key values do not identify a valid hierarchic path, the SQL INSERT will fail because it violates the referential integrity constraint that all foreign keys must be provided with legal values

Table A

Table B

Table C

A1, A2, A3

B1, B2, B3, A_A1

C1, C2, A_A1, B_B1

Relational View

Note: There are no changes to the DBD to enable this support

Page 33: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 33

Using the SELECT Statement

Use the SELECT statement to retrieve data from one or more tables – Result is returned in a tabular result set

When using PSBs with multiple PCBs – Qualify segments in the FROM clause with a prefix of the PCB name or label

For example:

SELECT * FROM AUTOLPCB.DEALER Returns all rows and columns from the DEALER segment using the AUTOLPCB

SELECT DLRNAME FROM AUTOLPCB.DEALER WHERE PHONE=6667777 Returns the DLRNAME column from all rows where the PHONE equals the search string from the DEALER

segment in the AUTOLPCB

SELECT DISTINCT MODEL FROM AUTOLPCB.MODEL Returns the MODEL column from all distinct rows from the MODEL segment using the AUTOLPCB

SELECT ZIP,CITY,DLRNAME AS NAME FROM AUTOLPCB.DEALER ORDER BY ZIP Returns all rows from the ZIP, CITY, and DLRNAME columns. The DLRNAME column is referenced as NAME. The

Resultset is ordered by ZIP ascendingly by default

Supported SQL Keywords:

ALL, AND, AS, ASC, AVG, COUNT, DELETE, DESC, DISTINCT, FROM,

GROUP BY, INSERT, INTO, MAX, MIN, OR, ORDER BY, SELECT, SET,

SUM, UPDATE, VALUES, WHERE

Page 34: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 34

Using the INSERT Statement

The INSERT statement inserts new rows into a table

For Example:

The following sample SQL shows the insert of a record at root level: INSERT INTO AUTOLPCB.DEALER (DLRNO, ZIP, DLRNAME, CITY, PHONE) VALUES ('8888','71139',

'Thilo', 'Stuttgart', '555-888')

When inserting a record in a table at a non-root level, you must specify values for all of the virtual foreign key fields of the table:

INSERT INTO AUTOLPCB.MODEL (DEALER_DLRNO, MODTYPE, MAKE, MODEL, YEAR, MSRP, COUNT1) VALUES ('8888', 'S', 'LIDLA', 'SuperABC', '2010', '66000', '05') • This insert statement creates a MODEL record which refers to the DEALER segment with the primary key

DLRNO=8888

Page 35: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 35

Using the UPDATE Statement

The UPDATE statement is used to update existing records in a table

For Example: UPDATE AUTOLPCB.MODEL SET MSRP='50000' WHERE DEALER_DLRNO = '8888' AND MSRP

>='60000' • This UPDATE statement sets the MSRP value to 50000 for all MODEL records that refer to DEALER with

the DLRNO = 8888 and where the MSRP value is greater than or equal to 60000.

Page 36: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 36

Using the DELETE Statement

The DELETE statement removes rows in a table. DELETE operations are cascaded to all child segments.

For Example: – Deleting the root segment DEALER without a WHERE clause deletes the entire database and all

its records! • DELETE FROM AUTOLPCB.DEALER

– Deletes all entries in the MODEL table and all referenced segments under it in the database. • DELETE FROM AUTOLPCB.MODEL

– The following SQL statement deletes the root record of DLRNO= 8888 and all its dependent segments: • DELETE FROM AUTOLPCB.DEALER WHERE DLRNO =’8888‘

– The following SQL statement deletes the MODEL segments and all their dependent segments for the DEALER with DLRNO= 8888: • DELETE FROM AUTOLPCB.MODEL WHERE DEALER_DLRNO =’8888’

Page 37: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 37

Start IMS Explorer (stand-alone offering)

Start> All Programs > IMS Enterprise Suite Explorer for Development

Page 38: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 38

Start IMS Explorer (stand-alone offering) …

If prompted, specify the workspace to be used or take the default

Page 39: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 39

Welcome Page and “Help”

A “Welcome Page” may optionally be displayed and extensive “Help” is available

Page 40: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 40

Create an IMS Explorer Project

Create an IMS Explorer Project: File>New>IMS Explorer Project

Enter a Project Name

e.g. Imsexplorerproject

Page 41: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 41

Importing Resources to a Project

PSB and DBD source can be imported from either: –Local file system –z/OS

• Requires a connection before the resources can be imported

Page 42: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 43

Add Credentials

Page 43: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 44

Import Resources into Project…

Right Click on project name > Import … > IMS Resources then Next

Page 44: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 45

Import Resources into Project ….

Specify project name, click Next. Then select “z/OS System”, click Next

Page 45: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 46

Import Resources into Project ….

Click “Add PSB…”

Page 46: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 47

Import Resources into Project ….

Click “Add PSB…”

Page 47: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 48

Import Resources into Project ….

Click “Finish”

Page 48: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 49

Import IMS Resources from Local File System

Page 49: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 50

Import IMS Resources (DBDs and PSBs) from Local File System…

Source of DBD IVPDB2 will be included as it’s

in the same directory

Page 50: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 51

Imported Database Source

Click “DBD Source”, “Imported Source”

Page 51: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 52

Graphical View of DBD

Double-click “IVPDB2.dbd” to see the database graphically

Page 52: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 53

Metadata added Automatically

Metadata is added automatically when IMS resources are imported

Page 53: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 54

Edit the DBD to Add Fields

Page 54: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 55

Add Additional Fields to the DBD ….

Add more fields to the segment since

only the first 10 bytes are defined

Page 55: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 56

Add Additional Fields to the DBD ….

Add more fields to the segment since

only the first 10 bytes are defined

Page 56: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 57

Add Additional Fields to the DBD ….

Add more fields to the segment since

only the first 10 bytes are defined

Page 57: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 58

Add Additional Fields to the DBD ….

Remember to save the DBD

to save the changes

Page 58: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 59

Review Updates to Metadata

Double click DFSIVP37DatabaseView.java to view updates to the metadata

Before

After

Page 59: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 60

Using the Data Source Explorer

Using the Explorer to generate SQL statements for use with IMS Open DB

First add the definition for the Universal JDBC Driver: Click Window > Preferences > Data Management > Connectivity > Driver Definitions> Add

Page 60: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 61

Using the Data Source Explorer…

Page 61: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 62

Using the Data Source Explorer…

Right click “Database Connections”, in the DSE window, then “New”. Complete the Connection Parameters.

Page 62: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 63

Using the Data Source Explorer…

Optionally set tracing on in the Connection Parameters panel. Click the “Tracing” tab. Then deselect “Disable Tracing”

Page 63: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 64

Using the Data Source Explorer…

Optionally set SSL on for the connection, and/or specify a log-in timeout value.

Page 64: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 65

Using the Data Source Explorer…

Open the Database Development perspective. Click Windows > Open Perspective > Other and select Database Development

Page 65: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 66

Using the Data Source Explorer…

To test the connection:

Page 66: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 67

Using the Data Source Explorer…

Success! Results are returned:

Page 67: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 68

Using the Data Source Explorer…

Page 68: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 69

Using the Data Source Explorer…

Page 69: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 70

Creating SQL statements in the SQL Query Builder by using the File menu Click File > New > Other. In the “New” wizard, expand Data, select “SQL or

XQuery Script”

Page 70: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 71

Creating SQL statements in the SQL Query Builder by using the File menu Select SQL or XQuery Script

Page 71: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 72

Creating SQL statements in the SQL Query Builder by using the File menu Right click in the pane as shown below and Add a Table to Select data from

Page 72: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 73

Creating SQL statements in the SQL Query Builder by using the File menu Right click in the pane and Add a Table to Select data from …

Page 73: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 74

Creating SQL statements in the SQL Query Builder by using the File menu Build the statement by pointing and clicking and using the panels

Page 74: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 75

Creating SQL statements in the SQL Query Builder by using the File menu Results of queries are shown in the SQL Results panels

Page 75: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 76

Limiting the Number of Retrieved Rows

Click Windows > Preferences > Data Management > SQL Development

Page 76: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 77

More Information

IMS 12 Redbook

IMS Explorer brochure: ftp://submit.boulder.ibm.com/sales/ssi/ecm/en/imd14375usen/IMD14375USEN.PDF

Accessing IMS Data Using SQL?!

What is IMS Explorer?

Page 77: Alison Coughtrie European IMS Architecture Team … Explorer.pdfISPF SDSF JES User Mods User Exits DBDGEN PSBGEN ACBGEN OLC DRD DLI IMS interfaces IMS TM/DB Database NEW IMS interfaces

© 2012 IBM Corporation 78

Questions?