0% found this document useful (0 votes)
84 views77 pages

IMS Explorer

Uploaded by

JOE SCHOLTZ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views77 pages

IMS Explorer

Uploaded by

JOE SCHOLTZ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 77

Alison Coughtrie European IMS Architecture Team

IMS Explorer for Development


April 2012

© 2012 IBM Corporation


Agenda

 IMS Explorer for Development - Overview and Demo

2 © 2012 IBM Corporation


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.

3 © 2012 IBM Corporation


IMS Application Development Challenges

Shrinking knowledge base around IMS &


hierarchical data base model

Difficult to find DLI programmers

Fewer experienced COBOL and PL/I programmers

Lack of integrated development solutions and tools

Difficult to test and deploy applications

4 © 2012 IBM Corporation


IMS AD Simplification Strategy

NEW IMS interfaces IMS interfaces IMS

Installation and
Operations DDL JCL IMS TM/DB
ISPF
Restful SDSF
JES
Schemas User Mods
Application User Exits
Development Dynamic DBDGEN
PSBGEN
Point and Click ACBGEN Database
OLC
Drag and Drop DRD
Reporting and
Analysis DLI

Reduce the need for special, in-depth IMS skills

5 © 2012 IBM Corporation


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

6 © 2012 IBM Corporation


Displaying an IMS Database Structure via “Green Screen”

Understanding a
database by
reading its source
isn’t easy for
newcomers to IMS

7 © 2012 IBM Corporation


Displaying an IMS Database Structure with IMS Explorer

Much easier
to
understand
the database
structure

8 © 2012 IBM Corporation


Displaying an IMS Database Structure with IMS Explorer…

Much easier to
understand the
hierarchy &
related
databases

9 © 2012 IBM Corporation


Displaying an IMS Database Structure with IMS Explorer…

10 © 2012 IBM Corporation


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.

11 © 2012 IBM Corporation


PSB and PCB Definitions via “Green Screen”

Typical
Green Screen
Display of
PCB Definitions
within a PSB

12 © 2012 IBM Corporation


Building a PCB definition with IMS Explorer
1. Click the required PSB.
2. Then select the required PCB.
3. Then select “Edit data sensitivity ...” on the right.

To Display the PCB


Graphically and
Optionally edit
sensitivity

13 © 2012 IBM Corporation


Building a PCB definition with IMS Explorer …

1
2 The Senfld shows in the “Generated Source”

14 © 2012 IBM Corporation


Building a PCB definition with IMS Explorer …

Compare the
“Imported” &
“Generated” 1. The Senfld shows in the “Generated Source”
source
15 © 2012 IBM Corporation
Displaying an IMS Database’s contents with DFSDDLT0

16 © 2012 IBM Corporation


Displaying an IMS Database with IMS Explorer

SQL Builder
with content
assistance to
build a SQL
statement

View w/
Here you can the SQL
create SQL results
scripts with
Select,
Update,
Delete, Insert
statements

17 © 2012 IBM Corporation


Browsing Data Sets and Submitting JCL

18 © 2012 IBM Corporation


Browsing Data Sets and Submitting JCL with IMS Explorer

Browse data
sets

Edit a data
set member

JES output
is displayed
here

19 © 2012 IBM Corporation


IMS Explorer and IMS Catalog

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

20 © 2012 IBM Corporation


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

21 © 2012 IBM Corporation


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

22 © 2012 IBM Corporation


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- X X X X
enabled)

23 © 2012 IBM Corporation


Access IMS Data using JDBC and IMS Open Database

Windows z/OS

IMS
Cognos
IMS Explorer IMS Connect ODBM

IMS T S S
Universal PC
Database
T C C C O
Driver C P D
P
I I
I B CTL IMS
I P A DB

P TCPIP

24 © 2012 IBM Corporation


 IMS Explorer for Development

25 © 2012 IBM Corporation


IMS Java Hierarchical to Relational Mapping
DEALER

MODEL SALESPER

ORDER SALES STOCK SALESINF


 Each Segment Type maps to a Table
– Each segment is a row, each field is a column
Relational Design
Hierarchical Design Dealer Table
DealerNo DealerName DealerAddress

DEALER 53SJ7 George 555 Bailey Ave.


DLRNO NAME ADDRESS
Segments 53SJ8 Bob 240 Elm St.
53SJ9 | Mary | 111 Penny Lane
53SJ9 Mary 111 Penny Ln.
53SJ8 | Bob | 240 Elm St.
53SJ7 | George | 555 Bailey Ave. ... ... ...

MODEL JPR27 | Dodge | Durango


Segments WJ45 | Mercury | Cougar Virtual Foreign Key
Model Table
UU45 | Dodge | Viper ID Make ModType DealerNo
PR27 | Dodge | Durango
UU45 Dodge Viper 53SJ7
FF13 | Toyota | Camry
PR27 Dodge Durango 53SJ7
MODID MAKE MODTYPE FF13 Toyota Camry 53SJ7
JR27 Dodge Durango 53SJ8
WJ45 Mercury Cougar 53SJ8
... ... ... ...

26 © 2012 IBM Corporation


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") Not intended to
private DLITypeInfo[] AUTOLPCBDEALERArray() {
be read by the
DLITypeInfo[] AUTOLPCBDEALERArray= {
new DLITypeInfo("DealerNo", DLITypeInfo.CHAR, 1, 4, "DLRNO",
programmer
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"), IMS metadata
new DLITypeInfo(“DealerPhone", DLITypeInfo.CHAR, 55, 7, "PHONE"),
new SecondaryIndexInfo("XFLD2","MODEL",AUTOLPCBDEALERKeys, "XFLD2", 20),  Defines java names
};
......  View/PCB
DLITypeInfo[] AUTOLPCBDEALERArray = AUTOLPCBDEALERArray ();
DLISegment AUTOLPCBDEALERSegment = new DLISegment
 Table/segment
("DEALER","DEALER",AUTOLPCBDEALERArray,61);
......  Column/field
DLISegmentInfo[] AUTOLPCBarray = new DLISegmentInfo[8];  Defines data type of each
AUTOLPCBarray[0] = new DLISegmentInfo(AUTOLPCBDEALERSegment,DLIDatabaseView.ROOT); column
AUTOLPCBarray[1] = new DLISegmentInfo(AUTOLPCBMODELSegment,0);
AUTOLPCBarray[2] = new
AUTOLPCBarray[3] = new
DLISegmentInfo(AUTOLPCBORDERSegment,1);
DLISegmentInfo(AUTOLPCBSALESSegment,1);
Used by JDBC driver
AUTOLPCBarray[4] = new DLISegmentInfo(AUTOLPCBSTOCKSegment,1); to convert SQL call
AUTOLPCBarray[5] = new DLISegmentInfo(AUTOLPCBSALESPERSegment,0);
AUTOLPCBarray[6] = new DLISegmentInfo(AUTOLPCBSALESINFSegment,6);
into DL/1 equivalent
AUTOLPCBarray[7] = new DLISegmentInfo(AUTOLPCBEMPLINFOSegment,6);...
}

27 © 2012 IBM Corporation


IMS Explorer Generated Metadata ...
 Java Class that has a 1:1 relation with the IMS PSB

28 © 2012 IBM Corporation


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)

B D E

C F G

29 © 2012 IBM Corporation


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

30 © 2012 IBM Corporation


Virtual Foreign Key Fields …

Columns Visible to
DBD Definitions SQL Application

Sequence Field A1 Key Field A1 Table A


Field A2 Field A2
A Field A3 Field A3

Sequence Field B1 Key Field B1 Table B


Field B2 Field B2
B Field B3
Field B3
Virtual Foreign Key A_A1

Sequence Field C1 Key Field C1 Table C


Field C2 Field C2
C Virtual Foreign Key A_A1
Virtual Foreign Key B_B1

31 © 2012 IBM Corporation


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) Relational
– To position the new segment correctly in the hierarchy View
Table A
 With the IMS Universal JDBC drivers, a standard SQL INSERT is used
– Positioning established by use of the virtual Foreign Keys A1, A2,
A3
 Example:
INSERT INTO PCB01.C (A_A1, B_B1, C1, C2) Table B
VALUES ('12345', 'UVWXYZ', 'C1VALUE', 'C2VALUE') B1, B2,
– If the foreign key values do not identify a valid hierarchic path, B3, A_A1
the SQL INSERT will fail because it violates the referential
integrity constraint that all foreign keys must be provided
with legal values Table C
C1, C2,
A_A1, B_B1
Note: There are no changes to the
DBD to enable this support
32 © 2012 IBM Corporation
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
33 © 2012 IBM Corporation
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

34 © 2012 IBM Corporation


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.

35 © 2012 IBM Corporation


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’

36 © 2012 IBM Corporation


Start IMS Explorer (stand-alone offering)

 Start> All Programs > IMS Enterprise Suite Explorer for Development

37 © 2012 IBM Corporation


Start IMS Explorer (stand-alone offering) …

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

38 © 2012 IBM Corporation


Welcome Page and “Help”

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

39 © 2012 IBM Corporation


Create an IMS Explorer Project

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

Enter a Project
Name
e.g. Imsexplorerproject

40 © 2012 IBM Corporation


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

41 © 2012 IBM Corporation


Add Credentials

43 © 2012 IBM Corporation


Import Resources into Project…

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

44 © 2012 IBM Corporation


Import Resources into Project ….

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

45 © 2012 IBM Corporation


Import Resources into Project ….

 Click “Add PSB…”

46 © 2012 IBM Corporation


Import Resources into Project ….

 Click “Add PSB…”

47 © 2012 IBM Corporation


Import Resources into Project ….

 Click “Finish”

48 © 2012 IBM Corporation


Import IMS Resources from Local File System

49 © 2012 IBM Corporation


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

Source of DBD
IVPDB2 will be
included as it’s
in the same directory

50 © 2012 IBM Corporation


Imported Database Source

 Click “DBD Source”, “Imported Source”

51 © 2012 IBM Corporation


Graphical View of DBD

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

52 © 2012 IBM Corporation


Metadata added Automatically
 Metadata is added automatically when IMS resources are imported

53 © 2012 IBM Corporation


Edit the DBD to Add Fields

54 © 2012 IBM Corporation


Add Additional Fields to the DBD ….

Add more fields to the


segment since
only the first 10 bytes
are defined

55 © 2012 IBM Corporation


Add Additional Fields to the DBD ….

Add more fields to the


segment since
only the first 10 bytes
are defined

56 © 2012 IBM Corporation


Add Additional Fields to the DBD ….

Add more fields to the


segment since
only the first 10 bytes
are defined

57 © 2012 IBM Corporation


Add Additional Fields to the DBD ….

Remember
to save the DBD
to save the changes

58 © 2012 IBM Corporation


Review Updates to Metadata

 Double click DFSIVP37DatabaseView.java to view updates to the metadata

Before

After

59 © 2012 IBM Corporation


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

60 © 2012 IBM Corporation


Using the Data Source Explorer…

61 © 2012 IBM Corporation


Using the Data Source Explorer…
 Right click “Database Connections”, in the DSE window, then “New”. Complete
the Connection Parameters.

62 © 2012 IBM Corporation


Using the Data Source Explorer…

 Optionally set tracing on in the Connection Parameters panel. Click the


“Tracing” tab. Then deselect “Disable Tracing”

63 © 2012 IBM Corporation


Using the Data Source Explorer…

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

64 © 2012 IBM Corporation


Using the Data Source Explorer…

 Open the Database Development perspective. Click Windows > Open


Perspective > Other and select Database Development

65 © 2012 IBM Corporation


Using the Data Source Explorer…

 To test the connection:

66 © 2012 IBM Corporation


Using the Data Source Explorer…

 Success! Results are returned:

67 © 2012 IBM Corporation


Using the Data Source Explorer…

68 © 2012 IBM Corporation


Using the Data Source Explorer…

69 © 2012 IBM Corporation


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”

70 © 2012 IBM Corporation


Creating SQL statements in the SQL Query Builder by using the File menu

 Select SQL or XQuery Script

71 © 2012 IBM Corporation


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

72 © 2012 IBM Corporation


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 …

73 © 2012 IBM Corporation


Creating SQL statements in the SQL Query Builder by using the File menu

 Build the statement by pointing and clicking and using the panels

74 © 2012 IBM Corporation


Creating SQL statements in the SQL Query Builder by using the File menu

 Results of queries are shown in the SQL Results panels

75 © 2012 IBM Corporation


Limiting the Number of Retrieved Rows

 Click Windows > Preferences > Data Management > SQL Development

76 © 2012 IBM Corporation


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?

77 © 2012 IBM Corporation


 Questions?

78 © 2012 IBM Corporation

You might also like