IMS TM Basics and Connectivity - uni-hamburg.de

111
IBM Software Group IMS & DB2 Denis Gäbler - IBM SW Technical Sales DM Infrastructure - [email protected] IMS TM Basics and Connectivity

Transcript of IMS TM Basics and Connectivity - uni-hamburg.de

Page 1: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group

IMS & DB2

Denis Gäbler - IBM SW Technical Sales DM Infrastructure - [email protected]

IMS TM Basics and Connectivity

Page 2: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Topics

IMS StructureIMS Transaction FlowLanguage EnvironmentIMS/Application CommunicationsMessage Format ServicesIMS SchedulingIMS Online LoggingArchiving OverviewIMS RestartIMS Security

BatchIMS System Definition (Sysgen)IMS PlexIMS ConnectivityIMS ConnectMQ SeriesIMS & XMLSOAP & Web ServicesIMS JavaXML DB

Page 3: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Structure and Overview

IMS DesignIMS Design

Page 4: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Structure

MVS SubsystemMultiple Address SpacesCommunicate with Asynchronous Work Elements (AWEs)

BMPMPPIFPMPPDLISASDBRCCONTROL REGION

OLDS RECON DB GSAM

WADSMESSAGEQUEUES

Page 5: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Structure ...

IMS Control Region

Communicates withTerminal Network - VTAM & BTAMAPPCOTMA

ManagesMessages QueuesMessage Format ServicesLoggingSchedulingIMS Checkpoint ProcessingSecurity CheckingFast Path Databases Output Processing

Page 6: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Structure ...

DBRC - Data Base Recovery Control RecordsLogging & Archiving Activity

ManagesDatabases & Recovery

Authorizes Database Access

DLISAS Database SupportDatabase Management VSAM & OSAMPool Management DMB & PSBDirectory Management

PDIR & DDIR

Page 7: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Structure ...Multiple Address Space Design

Cross-Memory DL/I Database Access DBRC

CSA and ECSA Common Blocks & Pools

IMS Design Advantages Application Integrity & Isolation Data Security Separate Program & Data Buffers Other Program's Area Not Accessible Parallelism in n-Way Environments

Queued Application Interface Simplified API (GU, GN, ISRT) Application Ignores Network IssuesTerminal Type Recovery

Page 8: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Transaction Flow

How IMS Transactions workHow IMS Transactions work

Page 9: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Transaction Flow

z/OS

IMS input message w/ tran code

IMS Appl Pgm

IMS output message

IMS Control Region

DB2IMSDB

Terminal

OTMA

Any Client3270APPC

orWeb

Client

DC

GU IOPCB (GN)Input ProcessingIMS System Services Calls (ICMD, INQY)Calls to DL/I Database

(GU, GN, ISRT, REPL, DLET, GNP, GHU, GHN,...)Calls to DB2 Database

(Exec SQL)ProcessingMore DB CallsOutput ProcessingISRT ALTPCB (Output to other destination)ISRT IOPCB

(End of Tran, implies Syncpoint and Commit to DBs)

MSGQueue

IMSLog

DLISAS

DBRC

RECONWADS

DB2MSGQueue

MFS

Page 10: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Transaction Flow

Message Input (VTAM) MFS Formatting

Message Logged

Placed on Message QueueTransaction Scheduled

PSB Located

DMBs Located

Program Located

Scheduled Logged

Page 11: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Transaction Flow ...

Application Program Processing Initialization

Obtain Message (GU)

Database Call(s) Changes Logged

Message Request(s) Output Messages(s) Logged

Obtain Next Message (Optional) Database Write(s) Queue Output to Destination Sync-Point Logged

Page 12: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Transaction Flow ...Normal Transaction Termination

Sync-Point (IMS responsible for syncpoint, not Application programmer)

Database Write(s) (multiple Logical UOW to database not possible, 1 transaction = 1 UOW)

Queue Output to Destination

Termination Logged

IMS Output Message Process Take Message from Message Queue

MFS Formatting

Send Message to Terminal

Send Completion Logged

Page 13: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Transaction Flow ...

Abnormal Termination

Database Changes Backed Out

Output Message(s) Cancelled

Orginal Transaction

Message Deleted or Retained

Depends on ABEND Type

DFS555I Sent to Terminal

Page 14: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Language Environment

What is LE?What is LE?

Page 15: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Prior to Language Environment

There were individual, language-specific librariesEach compiler had its own run-time library

FORTRANC/C++PL/ICOBOL

Compiler

Run-timeRun-time

Link-edit

Compiler

Link-edit

Compiler

Link-edit

Run-time Run-time

Link-edit

Compiler

Page 16: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Language Environment OverviewLE uses a common run-time environment

Replaces language-specific libraryProvided by operating system (z/OS, etc)

COBOL C/C++CompilerCompiler

PL/ICompiler

FORTRANCompiler

LANGUAGE ENVIRONMENT(Callable services interface, common services, and support routines)

Link-edit

Basic support routines: Initialization/termination, storage, messages, conditions, ...Callable services: Date, time, ...Language-specific routines: C, C++, COBOL, PL/I, FORTRAN

Run-time

A Java Virtual Machine

(JVM) is also an LE

Runtime Environment

Page 17: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS/Application Communication

Program Types, Presentation and Program Types, Presentation and SchedulingScheduling

Page 18: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS/Application CommunicationMPP (Message Processing Program)

Interactive ModeConversational and Non-Conversational Programs

Input Message (Transaction) Schedule Region Program Loaded Message Processed Databases Accessed Transaction Termination

Next Message Different Program Potential, application coded as loop Repeat Process

No Messages No Transactions Region Remains but Idle

Page 19: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Non-Conversational IMS Transaction

z/OS

IMS input message w/ tran code

IMS Non-convApplPgm

IMS output message

IMS

DB2 IMSDB

Terminal

OTMA

Any Client3270APPC

orWeb

Client

DC

Page 20: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Conversational IMS Transaction

z/OS

IMS output message

IMS input message

IMS output message

etc...

DC

IMSConvApplPgm

SPA

IMSIMS input message w/ tran code

DB2 IMSDB

Terminal

Client

Any Client3270APPC

orWeb

Page 21: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS/Application Communication ...

Fast Path ProcessingIFP (Fast Path Region)

Wait for Input (prestarted with application already loaded) Started by Operator PSB / Program JCL Defined

Parallel Scheduling AllowedProcesses Fast Path Transactions

Fast Path Transactions Entered from FP-eligible Terminal Dedicated Buffer (EMHB)

Single Segment Input / Output Response Mode (wait for reply before new transaction can be called) Non-conversational

Access to All Database Types

Page 22: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS/Application Communication ...

BMP (Batch Message Processing)

MVS / JES Scheduled

Initialization

Control Region Connection

Access Message Queue *

Access Databases *

Access MVS Files *

Termination

Region by MVS / JESNOTE: * Optional

Page 23: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS/Application Communication ...

TPPCB

DBPCB

I/OAREA

DEPENDENT REGION

TPPCBDBPCB

CNTLTERM

CONTROL REGION

SMBTRANCD

PDIRPGM

TERMDB

CNT - Communication Name TableSMB - Scheduler Message BlockPDIR - Program DirectoyPSB - Program Specification BlockPCB - Program Communication Block

DB PCB - Database AccessTP PCB - Message Access I/O PCB - Receive Messages - Send Message to Originator ALT PCB - Send Message to Destination

APPLPGM

Page 24: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS/Application Communication ...comparision to CGIBROWSER APPLICATION SERVERConnectSend HTTP Request

Receive - receive HTML PageDisplay Page

Disconnect

APPLICATION

STDINget Variables...processing...DB Updates...write Output to STDOUT(either CGI output or JSP)

Process msg(spawn CGI or thread)

CGI or Java Application Server flow

Send Output

CLIENT (e.g. 3270, APPC, OTMA) IMS APPLICATION

ConnectSend possible HeaderSend Message (LLZZTrancodeData)

Receive - receive MessageProcess Message ContentDisplay

Disconnect

IOPCBget Input Message...processing...DB Updates...write Output to IOPCBCommit

Process msgMessage Queueschedule Transaction in Message RegionMessage Logging

IMS Application Flow

Send Output

Page 25: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Message Format Services

Page 26: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Message Format Services...

Message Editor

Input & Output Messages

Device Independent Application

Logical Messages

Rearrange Screen Format

New Printer Forms Design

Physical & Logical Paging

/* A common structure for all data areas */ struct common { char name1[10]; /* last name */ char name2[10]; /* first name */ char ext[10]; /* extension number */ char zip[7]; /* internal zip code */ };

/* Input Message */ struct { short int inll; char infill[6]; char incmd[8]; struct common indata1; } input; /* Output Message */ struct out { char outmsg[40]; char outcmd[8]; struct common outdata1; };

Page 27: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Message Format Services

TPPCB

DBPCB

I/OAREA

DEPENDENT REGION

TPPCBDBPCB

CNTLTERM

CONTROL REGION

APPC

MFS

TERMDB

APPLPGM

OTMA

APPCClient

OTMAClient

Trancodellzz Segment 1 llzz Segment 2 ...

Data (e.g. Lastname X(10) Firstname X(10) ...)

Page 28: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Scheduling

Environment DEPENDENTREGION

DEPENDENTREGION

DEPENDENTREGION

DCFACILITY

MSGQ

MSG

TCT

SMB

PST

SCD

INTENTLIST

PDIR

PSB

DDIR

DMB

DEP REG PARM BK

TCT - Transaction Class TablePST - Program Status TableDMB - Database Management BlockDDIR - Database DirectorySCD - System Contents Directory

S C H E D U L I N G F A C I L I T I E S

Page 29: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Scheduling ...

Scheduling Phases

Select Candidate Transaction

By Class

By Priority within Class

Verify Resource Availability

Allocate & Reserve

Load Program

Dependent Region

Page 30: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS System Functionality

Logging, Archiving, DBRC,Logging, Archiving, DBRC,IMS Restart & SecurityIMS Restart & Security

Page 31: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Online Logging

IMSCONTROLREGION

DBRC

OLDS

RDS

IMS

ARCHIVE

UTILITY

SLDS

RLDS

OLDS - Online Log Data SetWADS - Write Ahead Data SetSLDS - System Log Data Set RLDS - Recovery Log Data SetRECON - Recovery Log Data SetRDS - Restart Data Set

RECONWADS

Page 32: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Online Logging ...

Online Log Data Set

Record of all System Activity

System Checkpoints

Schedule / Terminate PSB

Database Changes

Terminal Messages

Sync-Point

Trace / Diagnostics

Accounting

Page 33: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Online Logging ...

Write Ahead Data Set Used to Satisfy Log Write Ahead

May be Used to Close the OLDS

System Log Data Set Copy of All OLDS Records

Useable for Restart

Recovery Log Data Set Copy of All Database Records

Required for Database Recovery

Page 34: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Archiving Overview

Batch Utility - DFSUARC0

Single Pass of OLDS

Creates SLDS(s)

Optionally Creates RLDS(s)

Input of All Unarchived OLDS

Invoked

Automatically (ARC=n)

GENJCL.ARCHIVE

Page 35: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

DBRC OverviewLogging & Archiving

Records Information OLDS, SLDS, RLDS

Controls Database Access Registered Databases

GENJCL Support Verifies Input

Recovery Control Record Utility Information

Share Control Record Utility Information Checks Flags & Counters Database Authorization

Page 36: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Restart

Automated Process Type Determined During Restart Can be Overridden

COLD Initial Installation Change in IMS Configuration

WARM Normal Restart Successful Termination

/CHE FREEZE, PURGE, or DUMPQEmergency

After IMS or System Failure (/ERE)Database Backout

Automatic - Emergency Restart

Page 37: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS SecurityStandard IMS Security (SMU)

LTERM

Transaction

Command

Enhanced Security RACF

Sign-on Verifies User Access Userid Logged With Changes Transaction

Verifies User Access Dependent Region Connection

Verifies Region Access to IMS

RYO SecurityApplication Level Security

Page 38: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Batch

"Old" IMS Batch"Old" IMS Batch

Page 39: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Batch

Stand Alone MVS Job No Message Access Control Region Not Needed Checkpoint / Restart Support GSAM Support DASD Logging Optional DBRC Optional NO DEDB / MSDB Access

Private Database Access No Locking Access by This Job Only Logging Optional

Page 40: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Batch ...

Shared Database Access IRLM Required Locking

DBRC Required Database Access Control

Logging Required If Update Intent

DB2 Support DB2 Batch Attach Checkpoint / Restart Logging Required

GSAM

Page 41: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS System Definition & Sysplex

IMS GensIMS GensWhat is an IMSPlexWhat is an IMSPlex

Page 42: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

System, Transactions, Databases, Communication

IMS Resources are defined in so-called IMS SysgenAssembling IMS Macros that represent IMS Resource DefinitionsNew transactions, databases and changes require IMS Gen

Until Online-change was introduced, IMS Restart was required to change resources

Online-changeRegen e.g. Transactions, Databases and Communication into staging libraryCopy into A or B target libraryDo IMS Online change and changes are active without IMS RestartThere are circumstances when Online-change fails

Target for future: genless IMS System (IMS V11 and Vnext)Dynamic Resource Definition available for Programs and DatabasesFuture item: IMS Catalog for Metadata of IMS Database and Programs (e.g.

Input and Output structures)

Page 43: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Basic ConfigurationIMSCTRL

Gen Type

All, MODBLKS,NUCLEUS,

ETC.

Class of Gen

DB/DCDBCTL, DCCTL

Specify names for DBRC and

DLI procedures

SYSGEN Macros

Page 44: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Applications

Transaction Code

Scheduling Priority(normal,limit,count)

INQUIRY=NOINQUIRY=(YES,NORECOV)

INQUIRY=(YES,RECOV)I

MODE=SNGLMODE=MULTControls when

database buffers are written to log

MODE=MULT is default.

MODE=SNGL is forced for WFI transactions.

Some examples

Page 45: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Database Definitions

DATABASEVery much the same as for non Fast Path and Fast PathOnly DL/I (Full Function) and Fast Path Databases need to be defined here (not DB2)

Page 46: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

What is an IMSPlex?

Shared Message Queues

Coupling Facility

IMS

Parallel Sysplex ArchitectureUp to 32 z/OS Images can be coupled to one SysplexDASD sharedMemory shared using Coupling Facility and Highspeed Links

IMSPlex exploits Parallel Sysplex ArchitecureShared Databases, shared User Structures, shared Buffers, shared Message QueuesDB2 Group Attach (DB2Plex) is possible

IMS

DASD

IMS Databases

Page 47: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Connectivity

How to access IMS Transactions How to access IMS Transactions and Databaseand Database

Page 48: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS subsystem access

IMS Connect (TCP/IP)

MQSeriesSNA/Network(APPC, 3270, VTAM)

Appl. Appl. . . . Appl.

IMS Database ManagerDB2

TransactionManager IMS Message Queues

IMS Data Comm. Open Transaction Manager Access (OTMA)

APPC Comm.(using XCF)

Common Interface (XCF)

Open DB Access Facility,

IMS DRA

OTMA Callable Interface

Client SoftwareApplication, Java, C Application Server

z/OS, z/Linux, WinXP, AIX...Servlet, EJB, Bean & JSP, SOAP, ESB

Browser

HATS

z/OSAS

DB2SP

CICS

WIICF

LU 6.2PCOM

z/OSAS

DB2SP

RRS

RRS

IMS

TM

Page 49: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

ArchitectureSynchronous

TMIMS Connect, OTMA CI (Component Broker, z/OS Applications, DB2 Stored Procedures), DCE/RPC, SNA (APPC, LU 6.2, 3270, HATS)DBODBA (DB2 Stored Procedures, z/OS Applications), DRA (WebSphere Information Integrator Classic Federation, CICS)

AsynchronousTMMQ Series

DBWebSphere Information Integrator Event Publisher

ChoicesArchitecture (2-Tier, 3-Tier, logical Physical)Interfaces, APIsProtocolsLanguages

Page 50: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Connect - the whole picture

z/OS

IMS

TRAN

IMS Connect

DATA

User Exit

User Exit

IMS TCP/IP Clientself written, any TCP/IP capable language & platform

IMS Connector for Java

XCF

TCP/IP

TCP/IP

IMS JAVA Clientself written, any Java Platform

IMS Connector for Java

any Java capable platform

OTMA

PC CALL

Page 51: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS ConnectSockets - Basic Flow

CLIENT (transaction socket) IMS CONNECT IMSConnectSend IRM(Commit-then-send, sync(CONF))Send LLzz trancode dataSend EOM

Receive - receive committed output msg

ACK Disconnect

IMS Appl

GU, IOPCB...ISRT,IOPCB

ACKSchedule tran

Process msg

Non-conv. txn

Deq msg

Syncpointsend output

ACK

ConnectSend IRM(Send-then-commit, sync(CONF))Send LLzz trancode dataSend EOM

Receive - receive uncommitted output msgACK Receive - receive RSM message indicating successful syncpoint

Disconnect

GU, IOPCB...ISRT,IOPCB

ACKSchedule tran

Process msg

Non-conv. txn

Send outputwait for ACKSyncpointACK

Send RSM msg

Close socket

Close socket

Commit-then-send flow

Send-then-commit flow

Send msg andrequest confirm

Send msg andrequest confirm

Page 52: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Access Transactions using IMS Connector for Java

TCP/IP

Web Browsers

WebSphere Application Server

Java Servlets/EJB using IMS

Connector for Java

HTTP

IMS Transactions

IMS

IMSConnect

OTMAXCF

DataTCP/IP

Java Applicationsusing IMS

Connector for Java

Tooling Support with Rational Application Developer Integration/Developer for zSeriesDelivered with IMS Connect or downloadable from IMS Website

Page 53: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Commit Window - 2PC

Application Server IMS CONNECT IMS IMS Appl

Sent TranA.html

Start Processing...ConnectSend IRM(Send-then-commit, sync(SYNCPT))Send LLzz trancode dataSend EOM

Receive - receive uncommitted output msg(check results, additional processing)ACK(check other subsystems and request prepare for commit)Receive - Request for SyncpointACKReceive - receive RSM message indicating successful syncpointDisconnectProcess ResultsSend TranAResults.jsp

ACKSchedule tran(UOW Begin)

Process msg

Non-conv. txn

Send outputwait for ACKReady to SyncpointSyncpoint(UOW End)

ACKSend Syncpoint Request

Send RSM msg

Close socket

Send msg andrequest confirm

HTTP GET /ims/TranA.htmlReceive /ims/TranA.htmlUser InputHTTP GET /servlets/TranA

Receive TranAResults.jsp

Browser

EJB

ACK

Actual Implementation might be different

UserInteraction

UserInteraction

GU, IOPCB...

ISRT,IOPCB

Commit Window

Page 54: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Introduction to MQ-IMS-Bridge

MVS Sysplex

OTMA

IMS ApplIMS/ESA 5.1

XCF

MVS/ESA 5.1MQSeries for MVS/ESA1.1.4

OTMAClient

Network GU IOPCB

ISRT IOPCB

OTMA is a published high-performance interface to IMS transactionsThe MQSeries - IMS bridge is an OTMA ClientThe connection uses MVS Cross System Coupling Facility (XCF)The MQSeries - IMS bridge provides

Access to unchanged IMS transactions Support of all types of IMS transactions Improved security High performance

Page 55: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Introduction to MQ-IMS-Bridge

IMS Bridge

XCF Calls

MQSeries for MVS/ESA

IMSMQ calls

MQput .. MQget

OTMA

Queue

Storage ClassIMSXCF

Any MQ -supported plattform and AS

LocalQueue

TransmissionQueue XCF

SNA

or

TCP/IP

Remote MQ

Page 56: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

XML & SOAP

IMS and XMLIMS and XMLUsing SOAP to access TransactionsUsing SOAP to access Transactions

Page 57: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

XML and IMS - Today

Processing XML Documents in New IMS Applications IMS supports XML documents in the data portion of the IMS messageTran code still must be EBCDIC, rest of data can be XML

IMS COBOL or PL/1 can be written to process XMLUsing COBOL or PL/1 XMP parser

IMS C++ or IMS Java applications can be written to process XML Using the XML Toolkit for OS/390

Bridging XML and Existing IMS Applications XML Processing in Websphere Application Server (Gateway

Transformation)Creating and Parsing XML documentsIMS Transaction access using IMS Connector for Java

Using MQSeries IntegratorDictionary support for messagesRouting and processing based on message content

Page 58: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Work Station

OS/390

IMS

Control Region

MPP/IFP/BMPCOBOL or PL/1 Application Pgm

IMS Connect

XML documents

XML documents

XML documents

Application

Application

WMB

XML documents

Perform XMLParsing and Translation

XML and IMS ...

Direct XML Communication with IMS Applications

Perform XMLParsing and Translation

Page 59: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

XML and IMS ...

Gateway Transformation: WebSphere

OS/390

IMS

Control Region

MPP/IFP/BMP

TransactionalApplicationProgram

IMS Connect

IMSConnectorFor Java

WebSphere Web ServicesPerformDataTransformation

XML documents

IMS XML Transaction Access

Page 60: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

SOAP Gateway

Enables Reuse of IMS Applications as Web Services Support WebService specificationsLeverages open standards and utilizes flexible tooling support

Provides IMS Transaction Interoperation with Client ApplicationsIndependent of location, programming language, and platform SOAP Clients can be Microsoft .Net, SAP, Java, etc.

IMS

OT

MA

OT

MA

MPP/IFP/JMP

GU IOPCB

ISRT IOPCB

ConnectConnect

Task Manager and XML Adapter

z/OS

IMSIMSSOAPSOAP

GatewayGateway

request via SOAP

WebSphereDeveloper for z

Page 61: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

SOAP Message Sample - Request

POST /Part HTTP/1.1Host: hostabcd.boeblingen.de.ibm.comContent-Type: text/xml; charset="utf-8"Content-Length: nnnnSOAPAction: "Some-URI"

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:PART xmlns:m="Some-URI"> <part number>ANC960C10</part number> </m:PART> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Page 62: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

SOAP Message Sample - Response

HTTP/1.1 200 OKContent-Type: text/xml; charset="utf-8"Content-Length: nnnn

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> <SOAP-ENV:Body> <m:PARTResponse xmlns:m="Some-URI"> <Part>ANC960C10</Part> <Proc Code>74</Proc Code> <Make Dept>12-00</Make Dept> <Make Time>63</Make Time> <Description>WASHER</Description> <Inventory Code>2</Inventory Code> <Plan Revision Number></Plan Revision Number> <Comm Code>14</Comm Code> </m:PARTResponse> </SOAP-ENV:Body></SOAP-ENV:Envelope>

Page 63: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

MFS Web Services

Enterprise Services Toolkit

Rational Application DeveloperWebSphere Developer for zSeries

Test Environment

Development Environment

MFS

MFS

Test

EAR

DeployIMSResourceAdapter

MFS Importer

such asWAS 6.1WAS z/OS 6.1

Production Environment

WebSphere ApplicationServer

MFS Format Handler

MFS Format Handler

proxies

WSDL

XMI

MFS CAM model

Page 64: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Web Services and Websphere Application Server

zOS

WAS 6.1 or WAS z/OS 6.1

Web Service Invocation Framework (WSIF) / JAX RPC

Java Proxy

SOAP Proxy

SOAPRPCRouter

IMSResourceAdapter

MFS Format Handler

Production Environment

IMSControl Region

MFS-basedApplicationProgram

IMS Connect

XMI

Byte Stream

EJB Proxy

MFS service

Page 65: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Integration Approaches

IMSDB

ODBA

WAS zOS+ JDBC Driver

IMS Distributed

JDBCJava

ComponentEJB / Bean

WSDL RMI/

IIOP

WAS

IMS DBIMS DB

IMS Distributed JDBC

IMSAppls.

OTMA

MQ-IMSBridge(XCF)

MQ

JMS to MQ

JavaComponentEJB / Bean

WSDL

MQ

QueuesWASIMS DBIMS DB

WebSphere MQ/ MQ/IMS Bridge

IMSAppls.

OTMA

IMSConnect

IMS Connector for

Java

JavaComponentEJB / Bean

WSDL TCP/IP

WAS

IMS DBIMS DB

IMS Connect / IMS Connect Java Client

IMSAppls.

OTMA

IMSConnect

WSDL TCP/IP

IMS SOAP Gateway

IMS DBIMS DB

IMS SOAP Gateway

WebSphere CF JavaComponentEJB / Bean

WSDL

WebSphere CF JDBC

Client

WAS

DRA or

ODBA

WebSphereCF

TCP/IP

IMS DB

IMSDB

APPC

IMS Appls

IMS TM

IMS DB

MQ or WebSphere CF Java

ComponentEJB / Bean

WSDL

WebSphere CF JDBC

Client

WAS

DRA or

ODBA

WebSphereCF

TCP/IP

IMS DBIMS DB

IMSDB

APPC

IMS Appls

IMS TM

IMS DB

MQ or

Page 66: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Java

Java Programming support in IMSJava Programming support in IMS

Page 67: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Background ...

What is Persistent Reusable JVM?Enhancement to JDK 1.3 that implements:Class cache storage management called a heapMaster JVM

Establishes the JVM runtime environmentRemains until IMS Dependent Region Termination

Worker JVMTransaction processing JVM runtime environment"reset" after transaction commit

IMS Java requires explicit commit

Gone with JDK 1.5Only one JVM, that can be reusedHighly optimized

Page 68: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Java Class Overview

CEETDLI Interface

JNI

Base

App DB

IMS JavaApp

DLIDatabase

View

JDBC / SQL

Customer Code

IMS Java Class Library

C Layer Interface to IMS

IMS DB MetadataBusiness Logic

1-to-1SSAfor Javainterface

IMS Dep. RegionTransaction and

Message Passing

JDBC 1.0 interface

Java to Cinterface

Page 69: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Sample JVMOPMAS Member

******************************************************************************************* The following two JVM options are required. ****************************************************************************************** -Djava.class.path=/u/gaebler/test.jar: /usr/lpp/ims/imsjava10/imsjava.jar ****************************************************************************************** * The following JVM options are subset of the options allowed under JDK 1.3.1S****************************************************************************************** -Xinitacsh1M-Xinitsh1M -Xinitth2M -Xmaxf0.6 -Xmine1M -Xminf0.3 -Xms1M -Xmx4M -Xoss400k

JVM Sample

DFSJVMMS is a supplied JVMOPMAS= member in the IMS sample library, changed to:

Page 70: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Sample ENVIRON Member

DFSJVMEV is a supplied ENVIRON= member in the IMS sample library and was changed to:

*********************************************************************** * LIBPATH environment variable * ---------------------------- * /usr/lpp/java/IBM/J1.5/bin/classic is path to libjvm.so * /usr/lpp/java/IBM/J1.5/bin is path to libatoe.so * /usr/lpp/ims/imsjava10 is path to libJavTDLI.so ***********************************************************************PATH=/usr/lpp/java/IBM/J1.5/bin:.:/binLIBPATH=/usr/lpp/ims/imsjava10:> /usr/lpp/java/IBM/J1.5/bin:> /usr/lpp/java/IBM/J1.5/bin/classic*LEOPT=Y

Page 71: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

DFSJVMAP Proclib Member

APPLCTN PSB=TESTJAVAPSBGEN LANG=JAVA,PSBNAME=TESTJAVA IMSecho.class exists in '/u/gaebler/denis/samples/testtran'

-Dibm.jvm.shareable.application.class.path=/u/gaeblerIMSecho.java contained in package "denis.samples.testtran"

IMSecho.class exists in '/u/gaebler/test.jar' -Dibm.jvm.shareable.application.class.path=/u/gaebler/test.jarIMSecho.java contained in package "denis.samples.testtran"

*********************************************************************** Pathname for TESTJAVA ***********************************************************************TESTJAVA=denis/samples/testtran/IMSecho

Maps IMS-specified names (8 bytes or less, uppercase) onto actual java class names to be executed

package class

Page 72: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

JMP startup procedure

Create a procedure or a member in IMSHLQ.JOBS...//*//IMSAM1 EXEC PROC=DFSJMP,TIME=(1440),// AGN=IVP,// NBA=6,// OBA=5,// TLIM=10,// IMSID=IVP1,// JVMOPMAS=DFSJVMMS,// JVMOPWKR=DFSJVMWK,// ENVIRON=DFSJVMEV//*...//JAVAOUT DD PATH='/tmp/imsjavaout1',PATHOPTS=(OWRONLY,OCREAT,OTRUNC),// PATHMODE=(SIRWXO,SIRWXG,SIRWXU) //JAVAERR DD PATH='/tmp/imsjavaerr1',PATHOPTS=(OWRONLY,OCREAT,OTRUNC),// PATHMODE=(SIRWXO,SIRWXG,SIRWXU) //RESETEV DD PATH='/tmp/resetEvents1.txt', // PATHOPTS=(OWRONLY,OCREAT,OTRUNC), // PATHMODE=(SIRWXO,SIRWXG,SIRWXU)

Page 73: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Preparations on the Client Platform

Application Development Application Development Environment and JDKEnvironment and JDK

Page 74: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Application Development Environment

Ftp clientCommand line or GUI, it's your choice

Java Development GUIRational ToolsEclipse Open Source Development EnvironmentEclipse uses the systems JVM, so make sure there is an JDK installed

as system JVM that matches the version of the mainframe JVM

Page 75: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Make IMS Java classes available to the client

Download imsjava.jar from z/OSBy default in /usr/lpp/ims/imsjava91Make sure to download it binary via ftp

ClasspathImsjava.jar has to be in classpath in order to be able to compile an IMS

Java applicationFor editor/JDK solution:

Edit classpath manually, add it to a makefile or when invoking javac Command line compiler

For GUI:Add it to the project workspace, project properties or whatever is Neccessary to get it into the classpath

Page 76: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

First steps TM

Sample echo transactionSample echo transaction

Page 77: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Todo for the first transaction

IMS SysgenPSBGENACBGENRestart or Online ChangeCoding the IMS Java transactionCompile and export as .jar fileFtp upload the .jar file to z/OSCheck the DFSJVxxx membersStart an JMPTest the transaction

Page 78: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

System Definition

Definition for both Java Test Transactions

APPLCTN PSB=USER0xTx,PGMTYPE=TP,SCHDTYP=PARALLEL TRANSACT CODE=USER0xTx,MODE=SNGL,EDIT=(ULC), X MSGTYPE=(MULTSEG,RESPONSE,1),MAXRGN=0, X PARLIM=0,PROCLIM=(10,100)

Page 79: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

PSB

This is the PSB used for all shown test transactions

ALTPCB PCB TYPE=TP,MODIFY=YES IVPDB2 PCB TYPE=DB,DBDNAME=IVPDB2,PROCOPT=A,KEYLEN=10 SENSEG NAME=A1111111,PARENT=0,PROCOPT=A PSBGEN LANG=JAVA,PSBNAME=TESTJAVA END

Page 80: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Definitions for Sample Transaction

Definition for Input/Output Message PIC X(80).

import com.ibm.ims.base.*;import com.ibm.ims.application.*;

public class Message extends IMSFieldMessage { static DLITypeInfo[] fieldInfo = {

new DLITypeInfo("Message",DLITypeInfo.CHAR,1,80) };

public Message() {

super(fieldInfo, 80, false); }}

Page 81: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Sample Echo Transactionpackage denis.samples.testtran;

import com.ibm.ims.base.*;import com.ibm.ims.application.*;

public class IMSecho extends IMSApplication { public IMSecho() {} public void doBegin() throws DLIException, IMSException { IMSMessageQueue messageQueue = new IMSMessageQueue(); Message inputMessage = new Message(); messageQueue.getUniqueMessage(inputMessage); Message outputMessage = new Message(); outputMessage.setString("Message", inputMessage.getString("Message")); messageQueue.insertMessage(outputMessage); IMSTransaction.getTransaction().commit(); } public static void main(String args[]) { IMSecho test = new IMSecho(); test.begin(); }}

Page 82: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Modifyable Alternate PCB

Alternate PCB outputProgram Switches (no Output to IOPCB)

IMSMessageQueue messageQueueALT = new IMSMessageQueue("ALTPCB"); messageQueueALT.setModifiableAlternatePCB("TESTJAV2"); messageQueueALT.insertMessage(outputMessage);

Page 83: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Message Definitions for Conversational Transaction

Definition for Input/Output Message PIC X(80).

import com.ibm.ims.base.*;import com.ibm.ims.application.*;

public class Message extends IMSFieldMessage { static DLITypeInfo[] fieldInfo = { new DLITypeInfo("Message",DLITypeInfo.CHAR,1,80) };

public Message() { super(fieldInfo, 80, false); }}

Definition for SPA Message PIC X(80).

import com.ibm.ims.base.*;import com.ibm.ims.application.*;

public class SPAMessage extends IMSFieldMessage { static DLITypeInfo[] fieldInfo = { new DLITypeInfo("Message",DLITypeInfo.CHAR,1,80) };

public SPAMessage() { super(fieldInfo, 80, true); }}

Page 84: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Conversational Transaction (SPA = Session object)import com.ibm.ims.base.*;import com.ibm.ims.application.*;

public class Test extends IMSApplication { public Test() {} public static void main(String args[]) { Test test = new Test(); test.begin(); }

public void doBegin() throws DLIException, IMSException { IMSMessageQueue messageQueue = new IMSMessageQueue(); SPAMessage sPAMessage = new SPAMessage(); messageQueue.getUniqueMessage(sPAMessage); Message inputMessage = new Message(); messageQueue.getNextMessage(inputMessage); Message outputMessage = new Message(); outputMessage.setString("Message", sPAMessage.getString("Message")); messageQueue.insertMessage(outputMessage); sPAMessage.setString("Message", inputMessage.getString("Message")); messageQueue.insertMessage(sPAMessage, true); IMSTransaction.getTransaction().commit(); }}

Page 85: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

More Complex Message DefinitionsDefinition for Input Message of IVP Phonebook Transactions

import com.ibm.ims.base.*;import com.ibm.ims.application.*;

public class IVTInputMessage extends IMSFieldMessage{

static DLITypeInfo[] typeInfo = {new DLITypeInfo("Filler", DLITypeInfo.CHAR,1,4),new DLITypeInfo("ProcessCode", DLITypeInfo.CHAR,5,8),new DLITypeInfo("LastName", DLITypeInfo.CHAR,13,10),new DLITypeInfo("FirstName", DLITypeInfo.CHAR,23,10),new DLITypeInfo("Extension", DLITypeInfo.CHAR,33,10),new DLITypeInfo("ZipCode", DLITypeInfo.CHAR,43,7)

};}

public IVTInputMessage() { super(typeInfo, 51, false);

}

Page 86: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

First steps DB

DLI and SQL AccessDLI and SQL Access

Page 87: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Java Classes

DL/1 DB SupportEach segment field is represented by the class DLITypeInfo

DLITypeInfo pnum = new DLITypeInfo("Personnel Number", DLITypeInfo.CHAR, 4, "EMPNO");

Each segment is represented by an instance of DLISegmentAlias segment name, Actual DB segment nameThe array of DLITypeInfo objectsLength of segment

Associated with each segment class there is a DLISegmentInfo classContains reference to (name of) segment object plus information about position in

hierarchyPCB (view) is a user class that extends DLIDatabaseViewcontains an array of DLISegmentInfo objects

Page 88: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

JDBC with IMS Java

JDBC is the set of java classes that enables the execution of SQL calls to a connected database managerIMS Java maps each segment to a row and each field to a columnProgramming with JDBC

Load the IMS JDBC driverClass.forName("com.ibm.ims.db.DLIDriver");

Establish connection to DB manager (create Connection object)Connection con = DriverManager.getConnection("jdbc:dli:MyPCBView");

Build SQL statement objectStatement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,

ResultSet.CONCUR_READ_ONLY);Specify and execute SQL call

ResultSet answer = stmt.executeQuery("SELECT Field1, Field2 FROM PCBView.Segment ...");

Access individual rows and extract columns..... answer.next() ......

Page 89: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Metadata

DEALER

MODEL

STOCK

SALESPERSON

DEALER

MODEL

SALESPERSON

STOCK

SegmentInfo[]

DLITypeInfo[]

DLITypeInfo[]

DLITypeInfo[]

DealerIDDealerNameDealerAddres

DLITypeInfo[]DealerID

DealerNameDealerAddres

DBDLIB, PSBLIB, COPYLIB DLIDatabaseView

Page 90: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

DBD NAME=AUTODBD, ACCESS=DEDBSEGM NAME=DEALER,PARENT=0SEGM NAME=MODEL,PARENT=DEALERSEGM NAME=ORDER,PARENT=MODELSEGM NAME=SALES,PARENT=MODELSEGM NAME=STOCK,PARENT=MODELSEGM NAME=BACKLOT,PARENT=STOCKSEGM NAME=SALESPERSON,PARENT=DEALERSEGM NAME=SALESINFO,PARENT=SALESPERSON

public class DealerDatabaseView extends DLIDatabaseView { static DLISegmentInfo[] autoPCBSegments = { new DLISegmentInfo( dealerSegment, ROOT), new DLISegmentInfo( modelSegment, 0), new DLISegmentInfo( orderSegment, 1), new DLISegmentInfo( salesSegment, 1), new DLISegmentInfo( stockSegment, 1), new DLISegmentInfo( backLotSegment, 4), new DLISegmentInfo( salesPersonSegment, 0), new DLISegmentInfo( salesInfoSegment, 6) }; public DealerDatabaseView() { super("AUTOPSB", "DealerPCB", "AUTOPCB", autoPCBSegments); addDatabase("PCB2Alias", "AUTOPCB2", autoPCB2Segments); }}

SalesInfo

Dealer

Model

Order Sales Stock

Backlot

Salesperson

Define Database LayoutPCB TYPE=DB,DBDNAME=AUTODBD,PROCOPT=A,KEYLEN=4,PCBNAME=AUTOPCB PSBNAME=AUTOPSB

PSBDBD

Page 91: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Java Tooling

DLIDatabase

View

IMS JavaApp

BaseJNI

DB

APP

JDBC / SQL

CEETDLI Interface

DBDLIB

PSBLIB

COPYLIB

DBDGEN

PSBGEN

ACBGEN

IMS-J Tooling

Problems:Confusion generating IMS Java Metadata (DLIDatabaseView)Time consumingToo prone to simple mistakes

Solution:Tooling support to:Parse DBD, PSB, and COBOL CopyLibsProduce XML to act as a standard form of IMS Metadata Generate the IMS Java Metadata (DLIDatabaseView) from the XML

Page 92: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

DBD

This is the DBD of IVPDB2 database used for all database samples

*-----------------------------------------------------------* BYTES 1-10 LAST NAME (CHARACTER) - KEY * BYTES 11-20 FIRST NAME (CHARACTER) * BYTES 21-30 INTERNAL PHONE NUMBER (NUMERIC) * BYTES 31-37 INTERNAL ZIP (CHARACTER) * BYTES 38-40 RESERVED *----------------------------------------------------------- DBD NAME=IVPDB2,ACCESS=HDAM,RMNAME=(DFSHDC40,40,100) DATASET DD1=DFSIVD2,DEVICE=3380,SIZE=2048 SEGM NAME=A1111111,PARENT=0,BYTES=40,RULES=(LLL,LAST) FIELD NAME=(A1111111,SEQ,U),BYTES=010,START=00001,TYPE=C DBDGEN FINISH END

Page 93: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Java Database DefinitionRepresentation from IVTDB2 database would be only one field, so copybook was used for additional field determination

package denis.samples.testtran;

import com.ibm.ims.db.*;import com.ibm.ims.base.*;

public class IVPDB2DatabaseView extends DLIDatabaseView {

static DLITypeInfo[] PHONEAPA1111111Array = { new DLITypeInfo("LastName", DLITypeInfo.CHAR, 1, 10, "A1111111"), new DLITypeInfo("FirstName", DLITypeInfo.CHAR, 11, 10), new DLITypeInfo("Extension", DLITypeInfo.CHAR, 21, 10), new DLITypeInfo("ZipCode", DLITypeInfo.CHAR, 31, 7) }; static DLISegment PHONEAPA1111111Segment = new DLISegment("A1111111", "A1111111", PHONEAPA1111111Array, 40);

static DLISegmentInfo[] PHONEAParray = { new DLISegmentInfo(PHONEAPA1111111Segment, DLIDatabaseView.ROOT) };

public IVPDB2DatabaseView() { super("TESTJAVA", "IVPDB2", "IVPDB2", PHONEAParray); }}

Page 94: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

DL/I Access to IMS Database

Access using DL/I call and SSA

IVPDB2DatabaseView dbView = new IVPDB2DatabaseView();DLIConnection connection = DLIConnection.createInstance(dbView);DLISegment ivpDB2Segment = dbView.cloneSegment("IVPDB2","A1111111");

SSA ssa = SSA.createInstance("A1111111","A1111111",SSA.EQUALS,"LAST3");SSAList ssaList = SSAList.createInstance("IVPDB2");// Set the SSA List for retrieving the segment from the databasessaList.addSSA(ssa);// Retrieve the segment from the databaseif (!connection.getUniqueSegment(ivpDB2Segment,ssaList)){ // Data not found in database

outputMessage.setString("Message","Not found");}else{ // Set output data fields

short statusCode = connection.getAIB().getDBPCB().getStatusCode();outputMessage.setString("Message", ivpDB2Segment.getString("FirstName") +ivpDB2Segment.getString("LastName"));

}

Page 95: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Generic DL/I Access

Use when not known which segment type is expected from DL/I call (e.g. GNP)DLIConnection connection = DLIConnection.createInstance(dbView);DLISegment anySegment;

SSAList ssaList = SSAList.createInstance("IVPDB2");// Retrieve the segment from the databaseanySegment = connection.getUniqueSegment(ssaList);if (!anySegment.getSegmentName().equals("A1111111")) {

outputMessage.setString("Message","Not found");} else {

outputMessage.setString("Message", anySegment.getString("FirstName") +anySegment.getString("LastName"));

}

Page 96: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

JDBC Access Prefered method when no DL/I skill available

try { Class.forName("com.ibm.ims.db.DLIDriver"); Connection connectionJDBC =

DriverManager.getConnection("jdbc:dli:denis.samples.testtran.IVPDB2DatabaseView"); Statement statement = connectionJDBC.createStatement();

ResultSet results = statement.executeQuery("SELECT * FROM A1111111 " + "WHERE LastName = 'LAST3'");

if (results.next()) { outputMessage.setString("Message", "Person found!" + results.getString("LastName") +

results.getString("FirstName")); } else { outputMessage.setString("Message", "Display failed! LAST3 does not exist."); }

} catch (SQLException e) { System.out.println("During connection creation: " + e.toString()); } catch (ClassNotFoundException e) { System.out.println("Could not load DLIDriver." + e.toString()); }

Page 97: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Todo for an IMS Java transaction accessing an existing DB

IMS SysgenPSBGENDBDGENACBGENRestart or Online ChangeCoding the IMS Java transactionCompile and export as .jar fileFtp upload the .jar file to z/OSCheck the DFSJVxxx membersStart an JMPTest the transaction

Page 98: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Hints and Tips

Errors, DebuggingErrors, Debugging

Page 99: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

DescriptionAn error occurred during Java dependent region processingModule and Register content may indicate error

AnalysisFor all instances of this abend, the user should examine the dependent region JOB

output for the cause of the failure by searching on the character string "DFSJVM00:" which can indicate:

LE error messagesCaught thrown exceptions from the IMS Java applicationJVM error messages

Java Errors/Exceptions obtained in STDERR or STDOUT (must be coded in JCL)//JAVAOUT DD PATH='/tmp/imsjavaout',PATHOPTS=(OWRONLY,OCREAT,OTRUNC),// PATHMODE=(SIRWXO,SIRWXG,SIRWXU) //* //JAVAERR DD PATH='/tmp/imsjavaerr',PATHOPTS=(OWRONLY,OCREAT,OTRUNC),// PATHMODE=(SIRWXO,SIRWXG,SIRWXU)

IMS Java Region U0101 Abends

Page 100: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Enterprise COBOL Interoperability

Supported with IBM Enterprise COBOL for z/OS and OS/390 V3R2Can start with COBOL Main and run in MPP or BMP regionCan start with Java Main and run in JMP or JBPCall OO COBOL module (OO COBOL classes can call procedural COBOL

modules)OO COBOL program can call Java Classes

RestrictionsIn JBP COBOL routines cannot read messages from the IMS QueueAIB interface in COBOL is required (PCBs must have names)In general same restrictions as for Java apply to COBOL programs running in

JMP or JBP

Page 101: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Outbound IMS Java Communication

No implicit communication support only explicitIMS does not know about UOW at remote siteRemote UOW is separate from IMS UOWApplication must commit or rollback remote changesRemote UOW is neither logged nor Recoverable with IMS UOWsNo API support in IMS, use Java APIs

Possible scenariosIMS Transaction sends Email via SMTP (e.g. Sun Mail Classes)IMS Transaction issues HTTP Request via TCP/IP (JDK HTTP Classes)IMS Transaction does FTP via TCP/IPIMS Transaction issues SOAP Request via TCP/IPIMS Transaction invokes EJB on remote Application Server via RMI/IIOP

Page 102: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

IMS Java - The Big Picture

DLIDatabase

View

IMS JavaApp

BaseJNI

DB

APP

JDBC / SQL

CEETDLI InterfaceAERTDLI Interface

DBDLIB

PSBLIB

COPYLIB

IMS DB(DBCTL)

ODBADRA

CICS 2.1

DB2 V7

WAS4.0.1

DBDGEN

PSBGEN

ACBGEN

IMS-J Tooling

JVMLE

IMS TMV7

MPP BMP IFP JMP JBP

JavaStored Procedure

EJB

JCICS/EJB

JMP JBP

IMS TMV8

Page 103: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

XML DB

IMS the XML datastoreIMS the XML datastore

Page 104: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

XML-DB Decomposed vs. Intact

Decomposed (data-centric storage)XML tags are stripped from XML dataIdentical as current IMS storageStrict data-centric XML Schema validated dataEBCDIC encodingSearching on IMS Search Fields

Intact (document-centric storage)Entire XML document is stored (including tags)Relaxed un-validated dataAny desired encoding is possibleSearching is through XPath specified and generated Secondary Indexed

Side Segments

Page 105: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Decomposed Storage

XML document must be parsed and validated.Data must be converted to traditional IMS types

COMP-1, COMP-2, etc.EBCDIC CHAR, Picture Strings

Stored data is searchable by IMS and transparently accessible by non-XML enabled applicationsIMS DB Restrictions apply

Max. of 15 hierarchie levels

Page 106: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Decomposed XML Storage in IMS

AA

BBB CC

DD

XML Schema/Metadata

<A><f1> </f1><f2> </f2><f3> </f3>

Composed XML

<B><f4> </f4><f5> </f5>

</B><B>

<f4> </f4><f5> </f5>

</B><C>

<f6> </f6><f7> </f7><D>

<f8> </f8><f9> </f9>

</D></C>

</A>

<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns:ims="http://www.ibm.com/ims"xmlns="http://www.ibm.com/ims/PSBName/PCBName"targetNamespace="http://www.ibm.com/ims/PSBName/PCBName"elementFormDefault="qualified">

<xsd:annotations go here/>

<xsd:element name=“A”><xsd:complexType>

<xsd:sequence><xsd:element name=“field1" type="xsd:int"/><xsd:element name=“field2">

<xsd:simpleType>…<xsd:element name=“B”>

<xsd:complexType>…<xsd:element name = “C”>

<xsd:complexType>…<xsd:element name = “D”>

<xsd:complexType>

Page 107: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Intact Storage

No (or little) XML Parsing or Schema validationStorage and Retrieval Performance

No (or little) data type conversionsUnicode storage

Stored documents are no longer searchable by IMS and only accessible to XML-enabled applications

XPath side segments

Page 108: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Intact XML Storage in IMS

<A><f1> </f1><f2> </f2><f3> </f3><B>

<f4> </f4><f5> </f5>

</B><B>

<f4> </f4><f5> </f5>

</B><C>

<f6> </f6><f7> </f7><D>

<f8> </f8><f9> </f9>

</D></C>

</A>

AA

ooooo

Incoming XML

Page 109: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Intact Storage Secondary Indexing

XPath expression identifying Side SegmentsSide segment is converted to traditional data type and copied into

segment.Side Segments are secondary indexed with documents root as target.

A

o s ss …

XPath=“/Dealer/Model[Year>1995]/Order/LastName”XPath=“/Dealer/DealerName”

Example:

Page 110: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

XMS Java Interface

Adds 2 User Defined Funtions (UDF) to the IMS Java JDBC SQL interface

retrieveXML()storeXML()

Runs as an IMS Java ApplicationJDR (JMP, JBP)DB2 Stored ProcedureCICSWebSphere

Page 111: IMS TM Basics and Connectivity - uni-hamburg.de

IBM Software Group | IMS & DB2 Information Management Software

Summary TMMulti-Region Structure

Transaction FlowIO Area similar to CGI, 1 Transaction = 1 DB UOW

Features and FunctionsCommit, Rollback, DB Backout, Deadlock Resolution, Scheduling

LoggingInput, Output and Database Changes, Integrity & Performance

ConnectivityMany Different Possibliltes and Architecture Choices

XML & SOAP

Java Programming

XML DB