IMS Explorer
IMS Explorer
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.
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
Understanding a
database by
reading its source
isn’t easy for
newcomers to IMS
Much easier
to
understand
the database
structure
Much easier to
understand the
hierarchy &
related
databases
To Print
the
Layout
1. Right Click
within the
diagram.
2. Then select
“Print” from
the drop down
box.
Typical
Green Screen
Display of
PCB Definitions
within a PSB
1
2 The Senfld shows in the “Generated Source”
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
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
Browse data
sets
Edit a data
set member
JES output
is displayed
here
IMS Catalog is Generally Available in IMS Version 12 from 23rd April 2012
– APAR PM45935/UK77995
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
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)
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
MODEL SALESPER
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);...
}
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
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
Columns Visible to
DBD Definitions SQL Application
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
For example:
SELECT * FROM AUTOLPCB.DEALER
Returns all rows and columns from the DEALER segment using the AUTOLPCB
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
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’
Start> All Programs > IMS Enterprise Suite Explorer for Development
Enter a Project
Name
e.g. Imsexplorerproject
Right Click on project name > Import … > IMS Resources then Next
Specify project name, click Next. Then select “z/OS System”, click Next
Click “Finish”
Source of DBD
IVPDB2 will be
included as it’s
in the same directory
Remember
to save the DBD
to save the changes
Before
After
Optionally set SSL on for the connection, and/or specify a log-in timeout value.
Click File > New > Other. In the “New” wizard, expand Data, select “SQL or
XQuery Script”
Right click in the pane as shown below and Add a Table to Select data from
Right click in the pane and Add a Table to Select data from …
Build the statement by pointing and clicking and using the panels
Click Windows > Preferences > Data Management > SQL Development
IMS 12 Redbook
IMS Explorer brochure:
ftp://submit.boulder.ibm.com/sales/ssi/ecm/en/imd14375usen/IMD14375USEN.PDF