Date post: | 09-Apr-2018 |
Category: |
Documents |
Upload: | mzlapq-fgdhsjakal |
View: | 217 times |
Download: | 0 times |
of 26
8/7/2019 IMS with WebSphere - Alan Cooper
1/26
IBM Software Group
IMS and WebSphereJune 2005
IMS and WebSphereJune 2005
Alan Cooper
Pan-EMEA Technical Sales
IBM Software Group | DB2 Information Management Software
Page 2IMS and WebSphere - June 2005
AgendaAgenda
What is IMS?
WebSphere and IMS Transactions
WebSphere and IMS Databases
8/7/2019 IMS with WebSphere - Alan Cooper
2/26
IBM Software Group | DB2 Information Management Software
Page 3IMS and WebSphere - June 2005
What is IMS?
IBM Software Group | DB2 Information Management Software
Page 4IMS and WebSphere - June 2005
What is IMS?What is IMS?
Information Management System
IMS DB can be used with IMS TM and/or CICS
IMS TM can use IMS DBs and/or DB2 databases
A Data Base Manager
AND
A Transaction Manager
For the z/OS Platform
Use either or both
8/7/2019 IMS with WebSphere - Alan Cooper
3/26
IBM Software Group | DB2 Information Management Software
Page 5IMS and WebSphere - June 2005
IMS Early HistoryIMS Early History
IMS was designed and written jointly by IBMand Rockwell in the mid to late 1960s
IMS/360 announced in 1968
Objective was to provide an accessiblerepository for storing information about theseveral million parts that go to make aSaturn V rocket
Part of Apollo Lunar Space Mission
The Saturn V parts database was inherentlyhierarchical (components made of assembliesmade from . made from elemental parts)
So IMS databases are Hierarchical DBs
In those days, terminals were start/stopdevices on BTAM networks
IBM Software Group | DB2 Information Management Software
Page 6IMS and WebSphere - June 2005
System/360
Data BaseConcurrent UpdateFrom Multiple User/System
Multiple Systems Coupling(MSC)
Batch
DBMS
Exploit MPArchitecture
Two Phase Commit
Deadlock
Detection
Local Hot StandbyDBMS (XRF)
1968
2005+
ConcurrentImage Copy
Parallel SystemsN-WayData Sharing
2-way Data Sharing
Local or remoteJDBC Access
Remote SiteRecovery
APPC/IMS
Internet Access
Shared Message Queues
Extended TerminalOption (ETO)
> 1000 TransactionsPer Second
> 21000 Trans/sec(withz990)
20020055 -- 3377th Year Anniversaryth Year Anniversaryand still leading the industry !!!and still leading the industry !!!
...
Magnetic storage
IMSplex operator interface
1977 System 3033
z990
8/7/2019 IMS with WebSphere - Alan Cooper
4/26
IBM Software Group | DB2 Information Management Software
Page 7IMS and WebSphere - June 2005
IMS TodayIMS Today
Most Corporate Data is Managed by IMS Over 95% of Fortune 1000 Companies use IMS
IMS Manages over 15 Million GBs of Production Data
$2.5 Trillion/day transferred through IMS by one customer
Over 50 Billion Transactions a Day run through IMS
IMS Serves Close to 200 Million Users a Day
Over 100 Million IMS Trans/Day Handled by One Customer
120M IMS Trans/day, 7M per hour handled by another customer
21,000 Trans/sec (near 1 Billion/day) with IMS Data/Queue Sharing on a singleprocessor with database updates
6000 Trans/sec across TCP/IP to single IMS
IMS Revenue is approaching $1Billion per year and growing Currently about 10% growth per annum
MIPS growth is even faster
IBM Software Group | DB2 Information Management Software
Page 8IMS and WebSphere - June 2005
IMS DB TerminologyIMS DB Terminology DB Hierarchy Segment Levels Root / Dependent Parent / Child
EMPLOYEE NO. 6
EMPLOYEE NAME 30
DEPARTMENT 2
DATE HIRED 6
ADDR
LINE (S)
O-n
EMPLOYEE
(44 bytes)
SALARY
(15 bytes)
ADDRESS
(25 bytes)
TAXES
(21 bytes)
DEDUCT
(12 bytes)
GROSS SALARY 6
SALARY CLASS 3
AUTH DATE 6
Level 1
Level 2
Level 3
Up to 15 levelsand
255 segment types
8/7/2019 IMS with WebSphere - Alan Cooper
5/26
IBM Software Group | DB2 Information Management Software
Page 9IMS and WebSphere - June 2005
IMS DB Terminology IMS DB Terminology
DB Record Twins
Twins
Twins
Root
Segment
B1
B2
SALARY
TAXES
C11
C12
ADDRESS
D1
D2
DEDUCT
C21
C22C23
EMPLOYEE
A
Twins
Twins
No defined limiton number ofsegments in a
record or numberof records in a DB
IBM Software Group | DB2 Information Management Software
Page 10IMS and WebSphere - June 2005
IMS DB FundamentalsIMS DB Fundamentals IMS DBs are stored on DASD They can be partitioned (up to 1001 partitions) Some implementations use a primary index to access roots by key Alternatively, IMS provides an algorithmic technique for locating root
segments by key Segment hierarchic relations are maintained by control information
(pointers) in segment headers
Not seen by applications
Secondary indexes can be set up to access any segment directly Two or more physical DBs with data in common can be joined to
provide a logical DB
statically managed by IMS
The IMS DB Manager offers the most cost-effective and efficientway of storing and accessing data
Ideal for high performance production systems
But less flexible and dynamic than relational DBs (e.g. DB2)
The IMS DB Manager offers the most cost-effective and efficientway of storing and accessing data
Ideal for high performance production systems
But less flexible and dynamic than relational DBs (e.g. DB2)
8/7/2019 IMS with WebSphere - Alan Cooper
6/26
IBM Software Group | DB2 Information Management Software
Page 11IMS and WebSphere - June 2005
IMS DB MetadataIMS DB Metadata
Physical (and Logical) DB is described by a control block called a DBD(Data Base Descriptor)
Defines segments and their hierarchy
Defines segment key (sequence) fields andsearch fields (fields used as search criteria)
Other fields are optional
Defines secondary index access paths
An applications view of one or more DBs is defined by a PSB(Program Specification Block)
Which DBs
Each DB view is named andrepresented by a PCB
(Program Communication Block)Which segments
How they can be accessed (get,replace, insert, delete)
DBD NAME=EMPLOYEE , ACCESS=HDAM...DATASET DD1=EMPLDATAS EGM NAME =EMPLOYE E , BYT ES= 44 , PA RE NT =0FIELD NAME=(SERIAL , SEQ , U) , BYTES=6 , START=1F IEL D NA ME =F ULNAME , BYT ES= 18 , ST ART =2 0SEGM NAME=SALARY , BYTES=15 , PARENT=EMPLOYEEFIELD NAME=RATE , BYTES=5 , START=5SEGM NAME=TAXES , BYTES=21 , PARENT=SALARYSEGM NAME=DEDUCT , BYTES=12 , PARENT=SALARYFIELD NAME=T YPE , BYTES=4 , START=1
.
.END
PCB TYPE=DB , DBDNAME=EMPLOYEE , PCBNAME=EMPDB..SENSEG NAME=EMPLOYEE , PROCOPT=GSENSEG NAME=SALARY , PARENT=EMPLOYEE , PROCOPT=GRSENSEG NAME=TAXES , PARENT=SALARYSENSEG NAME=DEDUCT , PARENT=SALARYPCB TYPE=DB , DBDNAME=PROJECT , PROCOPT=G , KEYLEN=22
SENSEG NAME=PROJECT..
PSBGEN LANG=COBOL , PSBNAME=EMPLPROJEND
IBM Software Group | DB2 Information Management Software
Page 12IMS and WebSphere - June 2005
IMS XML DB SupportIMS XML DB Support An extension of the IMS Java
JDBC functions
IMS PSB/DBDSource
DLIModelUtility
XML Schema
IMS JavaApplication
XML Document
IMS DBYou have the optionof
accessing astandard IMS DBrecord as an XMLdocument (andv.v.)
Or
Storing/accessingan XMLdocument intactin an IMS DB
8/7/2019 IMS with WebSphere - Alan Cooper
7/26
IBM Software Group | DB2 Information Management Software
Page 13IMS and WebSphere - June 2005
IMS Transaction ManagerIMS Transaction Manager
IMS TM is a Queueing System All input messages (transactions) and reply (output) messages are secured
(logged to make them recoverable) on an IMS queue before beingacknowledged and processed
Terminal/network control characters are removed by IMS beforequeueing an input message.Terminal/network control charactersare added by IMS before sendingapplication-created reply message
Transaction application programsare Device Independent
The same program can be used toservice messages from any SNAterminal, TCP/IP terminal, MQ,WebSphere, etc.
IBM Software Group | DB2 Information Management Software
Page 14IMS and WebSphere - June 2005
IMS TM ArchitectureIMS TM Architecture Highly Parallel Architecture
In z/OS terminology, multiple addresses spaces(upto ~1000) each with multiple tasks
Transaction programs (MPPs) are loaded and deletedon demand by the IMS control region
Batch programs (called BMPs) can also berun concurrently
DLISASDBRCCONTROL
REGION
IMS
LogRECON DB
MESSAGE
QUEUES
BMPsMPPs
Upto 999Dependent
Regions
Program
languages
supported are
Assembler, C,
COBOL,
FORTRAN,Java, PASCAL
and PL/1
8/7/2019 IMS with WebSphere - Alan Cooper
8/26
IBM Software Group | DB2 Information Management Software
Page 15IMS and WebSphere - June 2005
IMSPlexIMSPlex
Multiple IMS systemscan run together inmultiple z/OS systems tocreate a single systemimage
Shared Databases
Shared Queues
Shared SystemsManagement Functions
CouplingFacility
CQS = CommonQueue Server
VTAM Generic Resources
VTAM
IMS1 CTL
CQS
Dependent
Regions
VTAM
IMS3 CTL
CQS
Dependent
Regions
VTAM
IMS2 CTL
CQS
Dependent
Regions
Shared QueuesShared Queues
DBs
Provides highest possible levels of
availability, workload balancing, and
incremental growth
Allows continuous user service over
unscheduled and scheduled outages
Provides highest possible levels of
availability, workload balancing, and
incremental growthAllows continuous user service over
unscheduled and scheduled outages
IBM Software Group | DB2 Information Management Software
Page 16IMS and WebSphere - June 2005
IMS ConnectivityIMS Connectivity BTAM was eventually replaced by VTAM (SNA)
IMS provided specific support for several differentSNA LU types
LU0, SLU1, SLU2, LU6.1 (ISC) and LU6.2 (APPC)
Other network clients required access to IMS
Especially TCP/IP and MQ
IMS provided a general purpose access facility OTMA
Open Transaction Manager Access
Defines a messaging protocol
TCP/IP access is provided by IMS Connect
Performs protocol conversion between TCP/IP and OTMA
MQ access uses the MQ Bridge feature of WebSphereMQ
Bridges between MQ queues and IMS OTMA
8/7/2019 IMS with WebSphere - Alan Cooper
9/26
IBM Software Group | DB2 Information Management Software
Page 17IMS and WebSphere - June 2005
IMS Connectivity IMS Connectivity
IMS Connect(TCP/IP or local)
MQSeriesSNA/NetworkSNA/Network
Application Application . . . Application
IMS Database ManagerDB2
IMSTransaction
ManagerIMS Message Queues
IMS Data Comm.IMS Data Comm.Open TransactionOpen Transaction
Manager Access (OTMA)Manager Access (OTMA)APPC Comm.APPC Comm.
Open DBOpen DBAccessAccess(ODBA)(ODBA)
RYORYO
PC call
OperationsManager
(OM)
Structured CallInterface (SCI)
JDBC
CICSDB2Std Procs
WebSphereEJBs
CICS
Common Interface (XCF)Common Interface (XCF)
DB2StoredProcedures
IBM Software Group | DB2 Information Management Software
Page 18IMS and WebSphere - June 2005
IMS Application Programming InterfacesIMS Application Programming Interfaces The traditional API was a standard CALL facility,
known as DL/I (data language interface)
Often called DL/1 or data language one
E.g. CALL CBLTDLI USING
DL/I Calls
Used to access message queues
Used to access IMS DBs
SQL Calls are used to access DB2
Java applications can use DL/I-like methods, but JDBC isavailable and recommended
JDBC provides SQL access to IMS DB (and DB2) in IMS java programs
8/7/2019 IMS with WebSphere - Alan Cooper
10/26
IBM Software Group | DB2 Information Management Software
Page 19IMS and WebSphere - June 2005
Open Data Base Access (ODBA)Open Data Base Access (ODBA)
Provides a callable interface to IMS databases from any z/OS programsthat are not managed by IMS
Typical examples include
DB stored procedures
WebSphere EJBs or servlets
z/OS provides the sync point manager
Resource Recovery Services (RRS)
Any Applicationusing RRS
Any Applicationusing RRS
ODBA
D
B
R
CDLISAS
IMS
DBCTL orTM/DB
Managed by z/OS RRS
z/OS
DBs
Any Applicationusing RRS
IBM Software Group | DB2 Information Management Software
Page 20IMS and WebSphere - June 2005
E-Business On Demand - Customer Wants and NeedsE-Business On Demand - Customer Wants and Needs
Increased return on existing investments
improved reuse of legacy assets
simplified access & better integration with WebSphere Application Server
Lower total cost of ownership
improved AD productivity
easier systems management
Solutions which are scalable, available, reliable and secure
8/7/2019 IMS with WebSphere - Alan Cooper
11/26
IBM Software Group | DB2 Information Management Software
Page 21IMS and WebSphere - June 2005
IMS TM/DB Fulfilling these NeedsIMS TM/DB Fulfilling these Needs
IMS Strategy Easier Systems Management (Common Service Layer, Dynamic Resource Definition, etc.)
Availability and capacity (Shared Queues, IMSPlex, etc)
Exploit new programmer skills (IMS Java) Enhanced connectivity and integration
Improved development productivity provided by WebSphere Studio (ApplicationDeveloper Integration Edition and Enterprise Developer)
IBM Software Group | DB2 Information Management Software
Page 22IMS and WebSphere - June 2005
WebSphere
and
IMS Transactions
8/7/2019 IMS with WebSphere - Alan Cooper
12/26
IBM Software Group | DB2 Information Management Software
Page 23IMS and WebSphere - June 2005
Accessing IMS TM from the InternetAccessing IMS TM from the Internet
Direct access from end-user devices via TCP/IP Via IMS Connect or MQBridge
Web Server Access
Initially, a variety of solutions and associated tools, were made availableto enable CGI programs (and equivalents) to submit IMS transactions
But customers demanded to be told the IBM recommended solution
IBMs response was Use Java Servlets
Tooling and connectors were made available
Then came J2EE architecture, and a new recommendation appeared
Use EJBs to access IMS TM
IBM Software Group | DB2 Information Management Software
Page 24IMS and WebSphere - June 2005
J2EE Server ModelJ2EE Server Model
Graphic Here
J2EE Core Services
Web Container EJB ContainerWebBrowserClient
RMI/IIOP
HTTP/HTTPS
J
DBC
/JCA
ResourceAdapters
J
DBC
/JCA
ResourceAdapters
(or other
EIS)
JSPs
Servlets
EJBs
Doing business on the Web continues to be a top priority for companies worldwide. Many are
turning to Java 2 platform Enterprise Edition (J2EE) technology as the foundation for their
web-based applications. META estimates J2EE is utilized by at least 80% of the Global 2000.
IMSDB
IMS TM
8/7/2019 IMS with WebSphere - Alan Cooper
13/26
IBM Software Group | DB2 Information Management Software
Page 25IMS and WebSphere - June 2005
IMS Connector for Java (IC4J)IMS Connector for Java (IC4J)
A J2EE Connector Architecture (JCA) resource adapter
Used to develop and run J2EE application that access IMS transactionsvia IMS Connect
Offers a highly scalable and flexible topology
Supports rapid application development with WebSphere StudioApplication Developer Integration Edition
Runs in WebSphere Application Server on both z/OS and distributedplatforms
Shipped with RAD (was WSADIE) for
development platform, and withIMS Connect for deployment platform
Also known as
IMS Resource Adapter WebSphere Adapter for IMS
IBM Software Group | DB2 Information Management Software
Page 26IMS and WebSphere - June 2005
DB
J2EE Connector Architecture with IMSJ2EE Connector Architecture with IMS
IMSConnect
IMS TM
TCP/IP
WebSphere Application ServerWebSphere Application Server
EnterpriseBean
IMSIMS
ConnectorConnectorfor Javafor Java
Managers:
Transaction Connection Security
WebComponent
CCIApplicationContract
SPISystem
Contracts
(z/OS, Windows, AIX,
Solaris, Linux, zLinux)
X
CF
OTMA
DB
8/7/2019 IMS with WebSphere - Alan Cooper
14/26
IBM Software Group | DB2 Information Management Software
Page 27IMS and WebSphere - June 2005
Features of IC4J with IMS ConnectFeatures of IC4J with IMS Connect
Provides full support for - Distributed two phase commit between EJB and IMS transaction (optional)
Secure Sockets (optional)
Timeouts
Connection Pooling
Container and Component Managed Sign-on
Supports a variety of IMS options
Commit modes 0 and 1
Conversational or non-conversationalprocessing
Distributed Two
Phase Commit
IMS
Co
ntrolRegion
D
LISAS
z/OS
IMSIMSConnectConnect
User Exit
XMem XMem
IMS
User ExitUser Exit
OTMA
XCF
WASEJB
EJB
EJB
DBRC
AddressSpace
TCP/IP
IBM Software Group | DB2 Information Management Software
Page 28IMS and WebSphere - June 2005
Creating an EJB for IMS Transaction AccessCreating an EJB for IMS Transaction Access Use the tooling provided in RAD
import a transactions COBOL, C or MFS source that defines the inputand output message layouts
define the IMS transaction as an IMS Enterprise Service
a sequence of panels gathers information about the IMS transaction
TCP/IP data about IMS Connect
Default user security information
Default IOPCB values for LTERMname and MODname
Commit mode, request type, timeout value, etc.
8/7/2019 IMS with WebSphere - Alan Cooper
15/26
IBM Software Group | DB2 Information Management Software
Page 29IMS and WebSphere - June 2005
Creating an EJB for IMS Transaction Access Creating an EJB for IMS Transaction Access
RAD generates three things1. Java classes representing the input and output messages
Objects of these classes are the message beans
Methods for setting and getting fields in the message beans
2. Java Format Handler classes
Providing methods for converting between Message beans and IMSmessages (byte streams)
3. Service definition created in Web Service Description Language(WSDL)
Still using RAD
Use the WSDL Editor (if needed) to specify additional parameters whichwill be passed when calling the IMS EJB
User security data, LTERMname for IOPCB, Timeout values, etc.
IBM Software Group | DB2 Information Management Software
Page 30IMS and WebSphere - June 2005
.....
LookupNameProxy proxy = new LookupNameProxy();
INPUTMESSAGE input = new INPUTMESSAGE();
OUTPUTMESSAGE output = new OUTPUTMESSAGE();
/* build input message bean */
input.setIn_ll(18);
input.setIn_zz(0);
input.setIn_trancode("LOOKUP");
input.setIn_person_number("015771");
.....
/* execute transaction */
output = proxy.runLookUpName(input);
/* display output in RAD console window */
..... output.getOut_firstname() ....
..... output.getOut_lastname() ...
WSIF
Java proxy
IMS
Connector forJava
IMS
ConnectIMS
TCP/IPor
Local Option
XCF
Java Classes
WSDL
Web Services InvocationFramework (WSIF) parsesWSDL and uses it todetermine how todynamically call the service
CCI
.....
LookupNameProxy proxy = new LookupNameProxy();
INPUTMESSAGE input = new INPUTMESSAGE();
OUTPUTMESSAGE output = new OUTPUTMESSAGE();
/* build input message bean */
input.setIn_ll(18);
input.setIn_zz(0);
input.setIn_trancode("LOOKUP");
input.setIn_person_number("015771");
.....
/* execute transaction */
output = proxy.runLookUpName(input);
/* display output in RAD console window */
..... output.getOut_firstname() ....
..... output.getOut_lastname() ...
INPUTMESSAGE
OUTPUTMESSAGE
Unit testUnit testprogramprogram
Creating an EJB for IMS Transaction Access Creating an EJB for IMS Transaction Access Use RAD to test the components of the Enterprise Service
create the java proxy, the class which contains the method that is executed to run theIMS transaction
write and run a java test program that puts values into the input message fields, callsthe run transaction method of the proxy, and handles the reply
Execute Run transactionmethod of proxy
22
Build OTMA headers
Build IMS Connect header (IRM)44
66
77
88
Call input format handler to convertinput bean to IMS msgbyte stream33
Use methods ofOUTPUTMESSAGEto retrievethe fields of the reply message
1111
Use methods of
INPUTMESSAGE to build theinput messagebean
11
1010Call output format handler to convertIMS output msgto an output bean
55 Issue TCP/IP socket calls to- send transaction
- get reply99
Remove headers from reply
11
22
1111
8/7/2019 IMS with WebSphere - Alan Cooper
16/26
IBM Software Group | DB2 Information Management Software
Page 31IMS and WebSphere - June 2005
Creating an EJB for IMS Transaction Access Creating an EJB for IMS Transaction Access
Use RAD to generate the EJB for the IMS Enterprise Service
generate the deploy code for EJB access to the IMS transaction service
RAD builds an EJB and additional WSDL, and packages all the generatedcomponents in an Enterprise Archive (EAR) file
Use RAD to test the EJB
create the EJB proxy, the class which contains the method that is executed torun the IMS transaction
Reuse the java test program that puts values into the input message fields,calls the run transaction method of the proxy, and handles the reply
IBM Software Group | DB2 Information Management Software
Page 32IMS and WebSphere - June 2005
/* OUTPUTMSG class */
getOut_lastname() ...
getOut_firstnam() ...
/* INPUTMSG class */
setIn_ll() ....setIn_zz() ....
setIn_trancode() ...
setIn_person_number() ...
IMS
EJB
WSIF
IMS Connectorfor Java
IMS
Connect
TCP/IP
or
Local Option
Accept input messageBuild OTMA headersBuild IMS Connect header(IRM)Issue socket callsRemove reply headersReturn reply message
Invoking the Transaction via an EJBInvoking the Transaction via an EJB.......
LookupNameEJBProxy proxy =new LookupNameEJBProxy();
INPUTMSG input = new INPUTMSG();
OUTPUTMSG output = new OUTPUTMSG();
/* build input message bean */
input.setIn_ll(18);
input.setIn_zz(0);
input.setIn_trancode("LOOKUP");
input.setIn_person_number("015771");
.....
/* execute transaction */
output = proxy.runLookUpName(input);
/* retrieve response from reply bean*/
..... output.getOut_firstname() ....
..... output.getOut_lastname() ...
.....
Servlet, EJB
or java testprogram
WSDL
XCF
/* EJB Proxy class */
....
runLookUpName() ...
....
WSIF Seria
lized
mess
ageb
eans
(i.e.m
sgdata)
RMI/IIOP
message beans
CallFormatHandlers
8/7/2019 IMS with WebSphere - Alan Cooper
17/26
IBM Software Group | DB2 Information Management Software
Page 33IMS and WebSphere - June 2005
Creating a Web Service for the IMS TransactionCreating a Web Service for the IMS Transaction
Use RAD to generate a Web Service from the IMS Enterprise Servicegenerate the deploy code for SOAP access to the IMS transaction service
RAD builds an EJB (if not already done) and additional WSDL, andpackages all the generated components in an Enterprise Archive (EAR)file
Use RAD to test the Web Service
create the SOAP proxy, the class which contains the method that is executedto run the IMS transaction
encapsulates the details of writing, sending, receiving, and parsing theSOAP XML documents
Reuse the java test program that puts values into the input message fields,calls the run transaction method of the proxy, and handles the reply
IBM Software Group | DB2 Information Management Software
Page 34IMS and WebSphere - June 2005
/* OUTPUTMSG class */
getOut_lastname() ...
getOut_firstnam() ...
/* INPUTMSG class */
setIn_ll() ....setIn_zz() ....
setIn_trancode() ...
setIn_person_number() ...
IMS
EJB
WSIF
IMSConnector for
Java
IMS
Connect
TCP/IP
or
Local Option
Accept input messageBuild OTMA headersBuild IMS Connect header(IRM)Issue socket callsRemove reply headersReturn reply message
Invoking the Transaction as a Web ServiceInvoking the Transaction as a Web Service.......
LookupNameSOAPProxy proxy =new LookupNameSOAPProxy();
INPUTMSG input = new INPUTMSG();
OUTPUTMSG output = new OUTPUTMSG();
/* build input message bean */
input.setIn_ll(18);
input.setIn_zz(0);
input.setIn_trancode("LOOKUP");
input.setIn_person_number("015771");
.....
/* execute transaction */
output = proxy.runLookUpName(input);
/* retrieve response from reply bean*/
..... output.getOut_firstname() ....
..... output.getOut_lastname() ...
..... Servlet,EJB,java
testprogram,etc.
WSDL
XCF
/* SOAP Proxy class */
....
runLookUpName() ...
....
WSIF XML
SOAP
CallFormatHandlers
message beans
8/7/2019 IMS with WebSphere - Alan Cooper
18/26
IBM Software Group | DB2 Information Management Software
Page 35IMS and WebSphere - June 2005
WebSphere
and
IMS Data Bases
IBM Software Group | DB2 Information Management Software
Page 36IMS and WebSphere - June 2005
Access to IMS DBs from WebSphereAccess to IMS DBs from WebSphere Servlets can use JDBC to access IMS DBs
When WAS and IMS are in same z/OS
EJBs can use JDBC to access IMS DBs
When WAS and IMS are in same z/OS
When WAS V5 is on a different platform from IMS
Requires latest release of IMS (Version 9)
Requires WAS V5 for z/OS as well as distributed WAS
IMSDBsIMS
z/OS
WAS for z/OS
OODDBB
AAXMem
JDBCJDBCResourceResourceAdapterAdapter
IMSEJBEJB
Windows / AIX / Solaris
EJBEJB
(CM)(CM)
EJBEJB
(BM)(BM)
Distributed WAS
DistributedDistributedJDBCJDBC
ResourceResourceAdapterAdapter
IIOP over
SSL
OR
EJBEJB
IMSJDBCResource
Adaptersaretype3
8/7/2019 IMS with WebSphere - Alan Cooper
19/26
IBM Software Group | DB2 Information Management Software
Page 37IMS and WebSphere - June 2005
EJB Access to IMS Data BaseEJB Access to IMS Data Base
WAS z/OS Setup Install IMS JDBC Resource Adapter (using supplied .rar file)
Provided with IMS distribution files
Add load library to WAS for z/OS JCL
Containing executables that enable WAS to use ODBA / IMS
Install WAS Custom Service
To connect to IMS ODBA at WAS startup and disconnect at WAS shutdown
Distributed WAS Setup
Download additional IMS Java files from IMS Web Site (ibm.com/ims) fordistributed WAS platform
Deploy the two IMS provided EJBs on WAS for z/OS
Install Distributed JDBC Resource Adapter and special data source in JNDI
At runtime, the client applications data source properties will be propagatedto an instance of this data source.
Setup is documented in the IMS Java Guide and Reference (SC18-7821-02for V9)
IBM Software Group | DB2 Information Management Software
Page 38IMS and WebSphere - June 2005
IMS Java for IMS Database ProcessingIMS Java for IMS Database Processing IMS Java includes classes to enable DL/I calls to be written by the
programmer
Two levels available, high and low
connection.getUniqueSegment (mySegment , ssalist)
JavaToDLI.execute("GU",dbaib,ioArea,ssa.getBytes())
But it is always recommended to use the Java standard technique,
namely - JDBC
A standard Java API for accessing relational databases ortabular data sources(e.g. spreadsheets) from Java applications
Enables sending ofSQL statements to a database and processing the tabular datareturned (the result set)
But how do we map a hierarchical DB
onto a relational DB structure?
But how do we map a hierarchical DB
onto a relational DB structure?
Not permittedin WAS
programs
8/7/2019 IMS with WebSphere - Alan Cooper
20/26
IBM Software Group | DB2 Information Management Software
Page 39IMS and WebSphere - June 2005
Hierarchical to Relational MappingHierarchical to Relational Mapping
Segment type maps to a tableEach segment is a row, each field is a column
UU45 | Dodge | Viper
PR27 | Dodge | Durango
53SJ9 | Mary | 111 Penny Lane
53SJ8 | Bob | 240 Elm St.
DealerSegment
ModelSegment
FF13 | Toyota | Camry
53SJ7 | George | 555 Bailey Ave.
Hierarchical DesignRelational Design
DealerID DealerName DealerAddressDealer Table
53SJ7 George 555 Bailey Ave.
53SJ8 Bob 240 Elm St.
53SJ9 Mary 111 Penny Ln.
... ... ...
JPR27 | Dodge | Durango
WJ45 | Mercury | Cougar
DealerID Name Address
ID Make Model
DEALER
SALESINF
SALESPER
STOCKSALES
MODEL
ORDER
Model TableID Make Model DealerID
UU45 Dodge Viper 53SJ7
PR27 Dodge Durango 53SJ7
FF13 Toyota Camry 53SJ7
JR27 Dodge Durango 53SJ8
WJ45 Mercury Cougar 53SJ8
... ... ... ...
Implicit Relational JOIN
IBM Software Group | DB2 Information Management Software
Page 40IMS and WebSphere - June 2005
JDBC SQL with IMS JavaJDBC SQL with IMS Java
A segment/table is implicitly joined withall the segments/tables up the hierarchicalpath to the root segment/table
Selected columns (SELECT) and selection criteria (WHERE) can refer toany columns up the hierarchy to the root
In fact, it is strongly recommended to specify WHERE criteria for alltables (segments) up to the root
SELECT FROM ORDER automatically selects the parent MODEL andDEALER segments with each ORDER segment selected
SELECT * FROM ORDERonly returns columns from ORDER
Use SELECT DEALER.*, MODEL.* FROM MODEL to return allcolumns of both DEALER and MODEL
DEALER
SALESINF
SALESPER
STOCKSALES
MODEL
ORDER
8/7/2019 IMS with WebSphere - Alan Cooper
21/26
IBM Software Group | DB2 Information Management Software
Page 41IMS and WebSphere - June 2005
JDBC Needs Runtime Java MetadataJDBC Needs Runtime Java Metadata
To use IMS DB requires java metadata that describes and names thedetails of the database views (PCBs)
For DB2, it is taken from the DB2 Catalogue
For IMS DB, it is generated by the DLIModel Utility
IMS Java
Metadata Class(HFS)
IMS Java
Report(HFS)
COBOLcopybook
XMI members
Control statements tospecify:
1) PSBs/DBDs
2) Copybook members
3) Aliases, data types,
additional fields
If youcan readthisyou donot needglasses;howeverthis is just silly writtingto
representthecontrolstatements that are theinput
tothe utility.
PSB
DBD(PDS)
(HFS or PDS)
DL/I ModelDL/I Model
UtilityUtilitypackage samples.dealership;
import com.ibm.ims.db.*;import com.ibm.ims.base.*;
public class AUTPSB11DatabaseViewextends DLIDatabaseView{// The following DLITypeInfo[] arraydescribesSegment:DEALER in
PCB:AUTOLPCBstatic DLITypeInfo[]AUTOLPCBDEALERArray={
new DLITypeInfo("DealerNo",DLITypeInfo.CHAR, 1, 4, "DLRNO"),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")
};static DLISegmentAUTOLPCBDEALERSegment= new DLISegment
("DealerSegment","DEALER",AUTOLPCBDEALERArray,61);...
// Anarray of DLISegmentInfoobjectsfollows todescribe theviewfor PCB: AUTOLPCB
static DLISegmentInfo[] AUTOLPCBarray= {new DLISegmentInfo(AUTOLPCBDEALERSegment,DLIDatabaseView.ROOT),new DLISegmentInfo(AUTOLPCBMODELSegment,0),new DLISegmentInfo(AUTOLPCBORDERSegment,1),new DLISegmentInfo(AUTOLPCBSALESSegment,1),new DLISegmentInfo(AUTOLPCBSTOCKSegment,1),new DLISegmentInfo(AUTOLPCBSTOCSALESegment,4),new DLISegmentInfo(AUTOLPCBSALESINFSegment,5)
};
...
}
DLIModelIMSJavaReport========================Class: AUTPSB11DatabaseView inpackage: samples.dealershipgeneratedforPSB: AUTPSB11
====================================== ============PCB: Dealer====================================== ============Segment: DealerSegmentField: DealerNoType=CHARStart=1Length=4 ++PrimaryKeyField++Field: DealerNameType=CHARStart=5Length=30 (SearchField)Field: DealerCity Type=CHARStart=35Length=10 (SearchField)Field: DealerZipType=CHARStart=45Length=10 (SearchField)Field: DealerPhoneType=CHARStart=55Length=7 (SearchField)====================================== ============
Segment: ModelSegmentField: ModelKey Type=CHARStart=3Length=24 ++ PrimaryKeyField
++Field: ModelTypeType=CHARStart=1Length=2 (SearchField)Field: MakeType=CHARStart=3Length=10 (SearchField)Field: ModelType=CHARStart=13Length=10 (SearchField)Field: Year Type=CHARStart=23Length=4 (SearchField)Field: MSRPType=CHARStart=27Length=5 (SearchField)Field: CountType=CHARStart=32Length=2 (SearchField)========================================== ========
Segment: OrderSegmentField: OrderNoType=CHARStart=1Length=6 ++PrimaryKeyField ++Field: LastNameType=CHARStart=7Length=25 (SearchField)Field: FirstNameType=CHARStart=32Length=25 (SearchField)Field: DateType=CHARStart=57Length=10 (SearchField)Field: TimeType=CHARStart=67Length=8 (SearchField)===================================== =============Segment: SalesSegmentField: SaleNoType=CHARStart=49Length=4 ++PrimaryKeyField++
...
metadata
XMI
IBM Software Group | DB2 Information Management Software
Page 42IMS and WebSphere - June 2005
DLIModel Input Control StatementsDLIModel Input Control Statements//******************************
// Options
//******************************
OPTIONS PSBds=SAMPLE.PDS.AUTO
DBDds=SAMPLE.PDS.AUTO
GenJavaSource=YES
OutPath=samples/dealership
Package=samples.dealership
//******************************
// PSB + PCB Definitions
//******************************
PSB psbName=AUTPSB11
JavaName=AUTPSB11DatabaseView
PCB pcbName=AUTOLPCB JavaName=Dealer
PCB pcbName=AUTS1PCB JavaName=OrderPCB pcbName=AUTS2PCB JavaName=DealerStock
PCB pcbName=AUSI2PCB JavaName=SecIndx2
PCB pcbName=EMPLPCB JavaName=EmployeePCB
//******************************
// Physical Segment Definitions
//******************************
SEGM DBDName=AUTODB SegmentName=DEALER
JavaName=DealerSegment
FIELD Name=DLRNO JavaType=INTEGER
JavaName=DealerNo
FIELD Name=DLRNAME JavaName=DealerName
FIELD Name=CITY JavaName=DealerCity
FIELD Name=ZIP JavaName=DealerZip
FIELD Name=PHONE JavaName=DealerPhone
SEGM DBDName=AUTODB SegmentName=MODEL
JavaName=ModelSegment
FIELD Name=MODKEY JavaName=ModelKeyFIELD Name=YEAR JavaName=Year
FIELD Name=MSRP JavaType=PACKEDDECIMAL
TypeQualifier=999999.99
JavaName=MSRP
metadata
JavaPCB
names
8/7/2019 IMS with WebSphere - Alan Cooper
22/26
IBM Software Group | DB2 Information Management Software
Page 43IMS and WebSphere - June 2005
Running the DLIModel UtilityRunning the DLIModel Utility
You can run this java utility from z/OS UNIX System Services, the z/OSBPXBATCH utility, or from a downloadable Eclipse plug-in
metadata
//DLIMODEL PROC DSNAME=,SOUT='*'
//********************************************************************
//* THIS PROC RUNS THE IMS JAVA UTILITY IN BATCH MODE
//********************************************************************
//STEP1 EXEC PGM=BPXBATCH,
// PARM='SH "/usr/lpp/ims/imsjava91/dlimodel/go" "&DSNAME"'
//STDENV DD DUMMY
//STDOUT DD PATH='/tmp/&SYSUID..out',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// PATHMODE=SIRWXU
//STDERR DD PATH='/tmp/&SYSUID..err',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// PATHMODE=SIRWXU
//*----------------------------------------------
//* Redirect stdout and stderr output to SYSOUT:
//STEP2 EXEC PGM=IKJEFT01 ,DYNAMNBR=300,COND=EVEN
//SYSTSPRT DD SYSOUT=&SOUT
//HFSOUT DD PATH='/tmp/&SYSUID..out'
//HFSERR DD PATH='/tmp/&SYSUID..err'
//STDOUTL DD SYSOUT=&SOUT,DCB=(RECFM=VB,LRECL=133,BLKSIZE=137)//STDERRL DD SYSOUT=&SOUT,DCB=(RECFM=VB,LRECL=133,BLKSIZE=137)
//SYSPRINT DD SYSOUT=&SOUT
// PEND
IBM Software Group | DB2 Information Management Software
Page 44IMS and WebSphere - June 2005
DLIModel Generated MetadataDLIModel Generated Metadata Java Class that has a 1:1 relation with the IMS PSB
metadata
package samples.dealership;
import com.ibm.ims.db.*;
import com.ibm.ims.base.*;
public classAUTPSB11DatabaseView extends DLIDatabaseView {
// The following DLITypeInfo[] array describes Segment: DEALER in PCB: AUTOLPCB
static DLITypeInfo[] AUTOLPCBDEALERArray= {
new DLITypeInfo("DealerNo", DLITypeInfo.INTEGER, 1, 4, "DLRNO"),
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")
};
static DLISegment AUTOLPCBDEALERSegment= new DLISegment
("DealerSegment","DEALER",AUTOLPCBDEALERArray,61);......
// An array of DLISegmentInfo objects follows to describe the view for PCB: AUTOLPCB
static DLISegmentInfo[] AUTOLPCBarray = {new DLISegmentInfo(AUTOLPCBDEALERSegment,DLIDatabaseView.ROOT),
new DLISegmentInfo(AUTOLPCBMODELSegment,0),
new DLISegmentInfo(AUTOLPCBORDERSegment,1),
new DLISegmentInfo(AUTOLPCBSALESSegment,1),
new DLISegmentInfo(AUTOLPCBSTOCKSegment,1),
new DLISegmentInfo(AUTOLPCBSTOCSALESegment,4),
new DLISegmentInfo(AUTOLPCBSALESINFSegment,5)
};
...
}
Not intended toNot intended to
be read by thebe read by the
programmerprogrammer
Two types of metadata
1. Defining & Mappingjava names to IMSnames
Table/segment
Column/field
2. Hierarchy for implicitjoining
Note:
The prefix AUTOLPCB isthe PCB name
8/7/2019 IMS with WebSphere - Alan Cooper
23/26
IBM Software Group | DB2 Information Management Software
Page 45IMS and WebSphere - June 2005
DLIModel Generated IMS Java ReportDLIModel Generated IMS Java Report
metadata
DLIModel IMS Java Report
========================
Class:AUTPSB11DatabaseView AUTPSB11DatabaseView in package: samples.dealership generated for PSB: AUTPSB11
==================================================
PCB: Dealer
==================================================
Segment: DealerSegment
Field: DealerNo Type=INTEGER ++ Primary Key Field ++
Field: DealerName Type=CHAR (Search Field)
Field: DealerCity Type=CHAR (Search Field)
Field: DealerZip Type=CHAR (Search Field)
Field: DealerPhone Type=CHAR (Search Field)
==================================================
Segment: ModelSegment
Field: ModelKey Type=CHAR ++ Primary Key Field ++
Field: Year Type=CHAR (Search Field)
Field: MSRP Type=PACKEDDECIMAL TypeQualifier=999999.99 (Search Field)
Field: Count Type=INTEGER (Search Field)
==================================================
Segment: OrderSegment
Field: OrderNo Type=CHAR ++ Primary Key Field ++
...Field: Time Type=TIME (Search Field)
==================================================
Segment: SalesSegment
Field: SaleNo Type=CHAR ++ Primary Key Field ++
...
Name of metadata class to use
for establishing connection
to this database
Hierarchy of segments
(level of indention)
Fields within segments, eitherDBD defined, defined by
imported copybook or bycontrol statements with data
type and field type
information (sec. Index,
search fld. etc.)
Names (alias names) of PCB,
segments and fields to use in
SQL (JDBC) calls
This is what theThis is what the
programmer usesprogrammer uses
IBM Software Group | DB2 Information Management Software
Page 46IMS and WebSphere - June 2005
Programming with JDBC - OverviewProgramming with JDBC - Overview Establish connection to DB manager (create Connection object)
Build SQL statement object and define type of result setStatement stmt =
con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
Specify and execute SQL callResultSet answer = stmt.executeQuery("SELECT ......");integer count = stmt.executeUpdate("INSERT ......");
For a SELECT, access individual rows and extract columns..... answer.next() ......
Note the result of a JDBC SELECT is a Result Set (a setof rows) rather than a single segment
8/7/2019 IMS with WebSphere - Alan Cooper
24/26
IBM Software Group | DB2 Information Management Software
Page 47IMS and WebSphere - June 2005
JDBC - Connecting to the Target Database (IMS PSB)JDBC - Connecting to the Target Database (IMS PSB)
The JDBC API includes connecting to the target database.There are two ways of doing this in general -
1. Load and Use the IMS-provided JDCB DriverClass.forName("com.ibm.ims.db.DLIDriver");String url =
"jdbc:dli:samples.dealership.AUTPSB11DatabaseView";Connection con = DriverManager.getConnection(url);
2. Use the DataSource technique to create a connection factory for a database
PSB, which will then generate the connection. The DataSource is pre-registered
with the Java Naming and Directory Interface (JNDI)
Context ctx = new InitialContext();
DataSource dataSource =
(DataSource)ctx.lookup("DealershipDB");Connection con = dataSource.getConnection();
or
PSB
Required
in EJBs
IBM Software Group | DB2 Information Management Software
Page 48IMS and WebSphere - June 2005
JDBC IMS-Supported SQL FunctionsJDBC IMS-Supported SQL Functions
SELECT
UPDATE
INSERT
DELETE
FROM
WHERE
ALL
AND
AS
ASC
AVG
COUNT
DESC
DISTINCT
GROUP BY
INTO
MAX
MIN OR
ORDER BY
SUM
IMS Javas implementation of JDBC supports a selected subset of the fullfacilities of the JDBC 2.1 API
Two unique features are
1. Implicit joining of tables up IMS hierarchy
2. WHERE clause on INSERTs
8/7/2019 IMS with WebSphere - Alan Cooper
25/26
IBM Software Group | DB2 Information Management Software
Page 49IMS and WebSphere - June 2005
SQL ExamplesSQL Examples
SELECT EMPNO AS EmployeeNumber
FROM MyPCB.Employee
WHERE EMPNO > 54321
SELECT AVG(age), Dept AS Department
FROM MyPCB.Employee
GROUP BY Department
SELECT * FROM MyPCB.Employee
ORDER BY lastName ASC, firstName DESC
INSERT INTO DealershipDB.Model(ModelTypeCode, CarMake, CarModel, CarYear, Price,EPACityMileage, EPAHighwayMileage, Horsepower)
VALUES (?,?,?,?,?,?,?,?)
WHERE Dealer.DealerNumber=?
DELETE FROM DealershipDB.Order
WHERE Dealer.DealerNumber = 123 AND Order.OrderNumber = 345
UPDATE DealershipDB.Order
SET SerialNo = 93234, DeliverDate = 12/11/2004
WHERE Order.OrderNumber = 123
UseUse Prepared StatementPrepared Statementsswhenever possiblewhenever possibleNB. INSERT requires
WHERE
Column in result setis AVG_age
IBM Software Group | DB2 Information Management Software
Page 50IMS and WebSphere - June 2005
JDBC SELECT Result Set TypesJDBC SELECT Result Set Types The output from a JDBC SELECT is a Result Set (= a table)
The characteristics of this result set are determined by an option of the
create statementmethod
Statement stmt = con. createStatement(type,CONCUR_READ_ONLY)
TYPE_FORWARD_ONLY
Only function allowed after executeQuery(query) is ResultSet.next()
Each next call accesses the IMS DB
TYPE_SCROLL_INSENSITIVE
executeQuery hits DB, and caches all results
Subsequent Calls: ResultSet.next()
ResultSet.previous()
ResultSet.absolute(int)
ResultSet.relative(int)
Data is as it was at time ofquery. No locks are held
Aggregates, ORDER BY, and
GROUP BY always useTYPE_SCROLL_INSENSITIVE
8/7/2019 IMS with WebSphere - Alan Cooper
26/26
IBM Software Group | DB2 Information Management Software
Page 51IMS and WebSphere - June 2005
SummarySummary
Many customers have huge irreplaceable investments in IMS DBsand Transactions
IMS still provides unmatched levels of performance, reliability, availability,scalability and security
But customers also want (need) to move to Service OrientedArchitecture and On Demand environments
The old and new worlds have different IT terminology and (usually)different IT personnel
Misunderstanding, fear and lack of communication abound!
But businesses need cooperation and integration
WebSphere is the bridge between thetwo worlds
Provides deployment of IMS
transactions and IMS databases inthe new paradigms