Transaction Management Systems on z/OS. © Copyright IBM Corp., 2008. All rights reserved. Topic...

62
Transaction Management Systems on z/OS

Transcript of Transaction Management Systems on z/OS. © Copyright IBM Corp., 2008. All rights reserved. Topic...

Transaction Management Systems on z/OS

© Copyright IBM Corp., 2008. All rights reserved.

Topic Objectives

You should be able to:

• Describe the role of large systems in a typical online business.

• List the attributes common to most transactional systems.

• Explain the role of CICS in online transaction processing

• Describe CICS programs, CICS transactions, and CICS tasks

• Explain what conversational and pseudo-conversational programming is

• Explain CICS and Web-enabling• Describe IMS transactional components

© Copyright IBM Corp., 2008. All rights reserved.

Key terms

•BMP•BMS•conversational•CICS TS•CICS command•IRLM•multithreading•multitasking

• task/thread• region• PSB• IMS TM• transaction• unit of work• two-phase commit• wireless access point (WAP)

© Copyright IBM Corp., 2008. All rights reserved.

At a recent exclusive briefing to select industry analysts and editors, Steve Mills, senior vice president for IBM Software Group, shared these mainframe key facts:

• 95 percent of the Fortune 1000 enterprises use IMS, originally written in 1968 to support NASA's Apollo moon landing program.• 25 of the world's top 25 banks, 23 of the top 25 US retailers, and nine out of 10 of the world's largest insurance companies run DB2 for zSeries.• 490 of IBM's top 500 customers run CICS.• IBM's CICS handles more than 30 billion transactions a day.• IBM has 50,000 CICS customer licenses, and 16,000 customers.• There are more than 950,000 CICS application programmers.

6 bullets

Mainframes Still Dominate Top Enterprises

Mainframes Still Dominate Top Enterprises

© Copyright IBM Corp., 2008. All rights reserved.

Example of online processing: a travel agency

Mainframe applications designed for:• employee and customer information• contacts with car rental companies• hotels• airline schedules

Changes must be immediately reflected to application end-users (in real time)

Contrast with batch processing

© Copyright IBM Corp., 2008. All rights reserved.

Example of online processing (continued)

Car Rental Agency Hotel Airline

Travel Agency

WAP HTTP

© Copyright IBM Corp., 2008. All rights reserved.

CarRentalAgency

Hotel Airline

TravelAgency

WAP

HTTP

A practical example

© Copyright IBM Corp., 2008. All rights reserved.

Transactional Systems

Requirements: ACID Atomicity either all of the tasks of a transaction are

performed or none of them are

Consistency consistent state before the start of the

transaction and after the transaction is over (whether successful or not).

Isolation a transaction appear isolated from all other

operations

Durability the transaction will persist, and not be undone

No need to worry about incomplete work

1 ani - properties

© Copyright IBM Corp., 2008. All rights reserved.

Example of Resource Managers on z/OS

Definition: A resource manager (RM) is a subsystem or component which managers resources involved in a transaction. RMs can be categorized as work managers, data resource managers and communication managers.

LOCKING and LOGGING Functions

© Copyright IBM Corp., 2008. All rights reserved.

RRS ResourcesCan only be used on z/OSResource enlists with the RRS Unit of Recovery (UR)

Resources can enlist without the WebSphere transaction manager begin aware of it

Can have local (unprotected) and global (protected) modesUse RRS services (ATRxxxx) to proceed the syncpoint and query statusCan be logged with the RRS URCan communicate on local system or other systems in a plex using z/OS specific protocols (usually faster)

XA ResourcesCan be written for any platformTransaction Manager enlists the Resource

Resources have to enlist in the current transaction through JTA SPIs

Can have local (LocalTransaction) and global (XAResource) modesUse XA mappings (xares.xxxx) provided in the JTA spec to proceed the syncpoint Need to provide external logging APIs.Usually requires a platform-neutral communication protocol (usually slower)

Overview of RRS and XA

© Copyright IBM Corp., 2008. All rights reserved.

Use SDSF / DA

------------------------------------------------------------------------------- SDSF DA SC04 SC04 PAG 0 CPU/L/Z 5/ 5/ 0 LINE 1-7 (7)

COMMAND INPUT ===> SCROLL ===> PAGE

NP JOBNAME StepName ProcStep JobID Owner C Pos DP Real Paging SIO

RASP RASP NS FF 417 0.00 0.00

RMF RMF IEFPROC STC28030 STC NS FE 19T 0.00 0.00

RRS RRS RRS NS FD 2506 0.00 0.00

RACF RACF RACF STC28123 RACF NS FE 511 0.00 0.00

RESOLVER RESOLVER IEFPROC NS FE 236 0.00 0.00

RMFGAT RMFGAT IEFPROC STC28189 STC NS FE 6035 0.00 0.00

REXECD REXECD RXSERVE STC28172 STC LO FF 446 0.00 0.00

prefix r*

Another namefor RRS}

© Copyright IBM Corp., 2008. All rights reserved.

Transactional Systems: Terminology

Commit and roll back

Multitasking

Multithreading

Thread

ReentrancyProgram

PGM

PGM

PGM

PGM

PGM

PGMPGM

PGM

Single copyof App Pgm

“””” “”“”” “””“”” “””“”” “””

© Copyright IBM Corp., 2008. All rights reserved.

CSTORAuxSTOR

ESTOR

No Access Task

Task

Task

Online Systems and Operating Systems

Managing and Dispatching tasks

Controlling user access

Managing use of memory

Managing concurrency to data

Providing device independence

Task

© Copyright IBM Corp., 2008. All rights reserved.

Characteristics of a transactional systems

Many users

Repetitive

Short interactions

Shared data

Data integrity

Low cost / transaction

© Copyright IBM Corp., 2008. All rights reserved.

INITIATOR Agent of A Agent of B

Update local resources Update local resources Update local resources

Prepare Receive

Prepare Receive

SYNCPOINT

SYNCPOINT

Commit

Commit

SYNCPOINT

Phase 1

Phase 2

AA BB CC

Two-phase commit

© Copyright IBM Corp., 2008. All rights reserved.

You can manage indoubt UOW

© Copyright IBM Corp., 2008. All rights reserved.

What is CICS?

Customer Information Control System

Transactional subsystem of z/OS which:

• run online applications

• the same time, many users, same application(s)

• manages the sharing of resources

• integrity of data

• prioritization of execution, with fast response.

© Copyright IBM Corp., 2008. All rights reserved.

Terminal orientedtransactions areentered in the leftcorner of screen

CSMG

Good Morning Transaction ID – CICS is up !

© Copyright IBM Corp., 2008. All rights reserved.

• Task Control• Application Program(s)• Basic Mapping Support• File Control• Program Control• Temporary Storage Control• Transient Data Control• Journal Control (logging)• Trace Control• Dump Control• Interval Control• Storage Control

A CICS Task executing in Multi-Tasking

© Copyright IBM Corp., 2008. All rights reserved.

CICS in a z/OS system – “middleware”

z/OSz/OS

CICS

ApplicationApplicationProgramProgramDATADATA

User

© Copyright IBM Corp., 2008. All rights reserved.

Languages & Platforms

Languages:COBOLOO COBOLCC++JAVA (JCICS)PL/IAssembler

Platforms:

zSeries (z/OS, OS/390, VSE)

Intel servers

TXSeries (AIX, HP-UX, Solaris and Windows)

COBOL JAVA

© Copyright IBM Corp., 2008. All rights reserved.

CICS’ API

© Copyright IBM Corp., 2008. All rights reserved.

TranslatedProgram

//DFHRPL DD DSN=CICSV3.SDFHLOAD1,DISP=SHR// DD DSN=CICSV3.SDFHLOAD2,DISP=SHR// DD DSN=CICSV3.ULOADLIB,DISP=SHR

1)

2)

3)

Generating a CICS Application Program

ObjectModule

LinkEdit

LoadModule

ProgramLibrary

Note - the LOADLIBconcatenation

Example: COBOL

© Copyright IBM Corp., 2008. All rights reserved.

The API provides CICS multi-tasking

COBOL verison

C version

PL/I version

Assembler version

“ Interrupt = task switch “

Language Examples

© Copyright IBM Corp., 2008. All rights reserved.

CICS Programming roadmap

Design application

Write & test program (includes compiling)

Define program & transaction in CICS resources

Define other resources (files, queues, etc…) in CICS resources (via RDO – CEDA)

Make resources known to CICS

© Copyright IBM Corp., 2008. All rights reserved.

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

OS Code

ApplicationCode

Temp Work Areas

SystemCode

MetaData

User runtime container: Address Space

© Copyright IBM Corp., 2008. All rights reserved.

LPAR ALPAR B

LPAR C

CICS

CICSCICS

CICS

CICS

OtherSubsyst

OtherSubsyst

OtherSubsyst

OtherSubsyst

OtherSubsyst

OtherSubsyst

CICS

* A CICS subsystem may be composed of one or more address spaces to isolate functionality, administration and throughput. As an example: - TOR = Terminal Owning Region - AOR = Application Owning Region - FOR = File Owning Region - WOR = Web Owning Region - ROR = Routing Owning Region

* This is a configuration known as: Multi Region Operation (MRO)

TORAOR

AOR

FOR

WORAOR

TerminalsPrograms

Files} one address space

containing all functions

SYS 1

SYS 2

CICS

CICS

CICS

ROR

Inter-System Communication (ISC)

PPT

PCT

FCT

TCT

* CICS has strong flexibility for business configuration needs thru table definitions

CICS in one or multiple LPARS

© Copyright IBM Corp., 2008. All rights reserved.

Transaction Program Control Table (PCT)Application Program Program Processing Table (PPT)Files File Control Table (FCT)Terminals Terminal Control Table (TCT)

Table Definitions are usually performed by the CICS SystemsProgrammer through a CICS facility called Resource DefinitionOn-Line (RDO). It is invoke through a CICS Transaction byentering CEDA (CEDB,CEDC).

****

PPT

PCT

FCT

TCT

Tables are kepton DASD

either in VSAMor Loadlibs

CICS Programs, Transactions, Tasks and Tables

CICSA (AADD, ADC1)

CICS Terminal Commands

© Copyright IBM Corp., 2008. All rights reserved.

BatchRDO

If onlines are downyou can still perform

maintenance via a batch job

Batch RDO

© Copyright IBM Corp., 2008. All rights reserved.

•Transaction Driven

•Multitasking

•Multithreading

•Quasi-reentrant

CICS

CICS

CICS

CICS Features as an official transaction manager

© Copyright IBM Corp., 2008. All rights reserved.

You can program PF, PA, CLEAR Keys to perform any transaction functionalityi.e. EXEC CICS HANDLE AID PF3(EXIT-PGM) . . . .END-EXEC.

A transaction ID

End User enters a Dept #

Dept# “input” browses a VSAM file and pgm. comes up with avg. salary

Note: Programmable PF Keys

Example of CICS application user screen

ABCD Average salary by department

Type a department number and press enter.

Department number: A02

Average salary($): 58211.58

F3: Exit

© Copyright IBM Corp., 2008. All rights reserved.

SEND API = displaying a screen to the terminalRECEIVE API = reading data from a screen from the terminalExample:* EXEC CICS* SEND MAP (‘ORCHM01’)* MAPSET (‘ORCHM01’)* ERASE* END-EXEC. MOVE ‘ORCHM01’ TO DFHEIV1 MOVE ‘ORCHS01’ TO DFHEIV2 CALL ‘DFHEI1’ USING DFHEIV0 DFHEIV1 DFHEIV99 . . . .

During CICS program compile the API Commands arechecked for syntax and commented out. They arethen transformed into a starndard “CALL” to theCICS Stub-routines.

* EXEC CICS* RECEIVE MAP (‘ORCHM01’)* MAPSET(‘ORCHM01’)* INTO (workstorage area)* END-EXEC. MOVE ‘ORCHM01’ TO DFHEIV1 MOVE ‘ORCHM01’ CALL ‘DFHEI1’ USING DFHEIV0 DFHEIV1 …..

The DFHEIVxx variables are copied in automatically by the CICS translator into WORKING STORAGE i.e. DFHEIVAR COPYBOOK

Turns APIinto nativepgm syntax

Terminal Control uses Basic Mapping Support (BMS)

© Copyright IBM Corp., 2008. All rights reserved.

PRINT NOGENORCHM01 DFHMSD TYPE=MAP,MODE=INOUT,CNRL=FREEKB,LANG=COBOL,TIOAPFX=YESORCHM01 DFHMDI SIZE=(24,80) DFHMDF POS=(01,01),LENGTH=01,ATTRB=(ASKIP,DRK,FSET), x INITIAL=‘1’ DFHMDF POS=(01,25),LENGTH=3,ATTRB=(ASKIP,BRT), x INITIAL=‘PURCHASE ORDER - - - FILE INQUIRY’ DFHMDF POS(03,30),LENGTH=13,ATTRB=ASKIP, x INITIAL=‘ORDER NUMBER ’ORDER# DFHMDF POS=(03,44),LENGTH=10,ATTRB=(NUM,BRT,IC) DFHMDF POS=(04,32),LENGTH=11,ATTRB=ASKIP,INITIAL=‘DEPARTMENT’ * * * * * DFHMSD TYPE=FINAL

The MAPS are composed of three simple macros:DFHMSD – name of mapsetDFHMDI – name of map identificationDFHMDF – field screen definitions and location

Note: You can have several maps within a mapset definition

An example of BMS map definition

© Copyright IBM Corp., 2008. All rights reserved.

Conversational:

UserTypesInputs

PROGV000

W AIT

Menu

Enter account ______Function code______

Menu

Enter account 1234_Function code M____

Record Update

Enter account 1234Name: SmithAmount: $10.00Date: 05/28/04

Menu

Enter account ______Function code______"Update confirmed"

UserTypesChanges

SEND MAP

RECEIVE MAPREAD FILE UPDATE

SEND MAP

RECEIVE MAPREW RITE FILE

SEND MAPRETURN

W AIT

Note: CEMT, CECI, CEDA are conversational

Conversational Pseudo-Conversational

© Copyright IBM Corp., 2008. All rights reserved.

Pseudo-Conversational:

UserTypesInputs

PROGV000

Menu

Enter account ______Function code______

Menu

Enter account 1234_Function code M____

Record Update

Enter account 1234Name: SmithAmount: $10.00Date: 05/28/04

Menu

UserTypesChanges

SEND MAP...RETURN TRANSID(V001)....

Enter account 1234Name: SmithAmount: $99.50Date: 05/28/04"Update Confirmed"

PROGV001

RECEIVE MAP.......READ FILE....... SEND MAP......RETURN TRANSID (V002)....

PROGV002

RECEIVE MAP.......READ FILE UPDATE....REW RITE FILE........ SEND MAP......RETURN TRANSID (V000)...

Conversational Pseudo-Conversational

© Copyright IBM Corp., 2008. All rights reserved.

CICS Programming commands

General format: EXECUTE CICS (or EXEC CICS) + command

e.g. in COBOL: EXEC CICS function option option ... END-EXEC.

CICS command example : EXEC CICS READ FILE(‘ACCTFIL’)

RIDFLD(ACCTC) UPDATE ...

END-EXEC.

© Copyright IBM Corp., 2008. All rights reserved.

CICS transaction flow

Operating System

ABCDABCD TerminalControl

StorageMgmt.

ProgramProgramLibraryLibrary

File or DBFile or DB

SystemServices

11

22

33

ADE1/2 CEDF

© Copyright IBM Corp., 2008. All rights reserved.

CICS transaction flow (Cont…)

Operating System

ProgramProgramLibraryLibrary

File or DBFile or DB

(menu screen)

ProgramProgramABCD01ABCD01

44

FileControl

BMS

55

Loaded intoMemory

Cedf ADMA

© Copyright IBM Corp., 2008. All rights reserved.

CICS transaction flow (Cont…)

Operating System

ProgramProgramLibraryLibrary

File or DBFile or DB

User'sNextInput

ProgramProgramABCD01ABCD01

66

88

FileControl

77

BMS

- Looks up FCT entry for requested file- Reads file and obtains requested record- Populates BMS Screen with data- Sends screen via TC to user device

TC = Terminal Control

CEDF – ADC5 (Chg TEXT Msg) AADD – filecntl 111111

© Copyright IBM Corp., 2008. All rights reserved.

CICS services for Application Programs

Application program interface: use CICS commands

Terminal control services: use Basic Mapping Support (BMS)

File & database control services:•CICS file control (mainly VSAM)•Database control (DL/I & DB2)

Other CICS Services: Task Control - Program Control - Temporary Storage (TS) & Transient Data Control (TD) - Interval Control - Storage Control - Dump & Trace Control

We will build a TS Queue with one of the Labs – its very easy

© Copyright IBM Corp., 2008. All rights reserved.

Defining the screens

BMS macros: a form of assembler language

Result of an assembles : Physical Map

Physical map contains info to :• build the screen• merge variable data between program & screen• send variables back to program

© Copyright IBM Corp., 2008. All rights reserved.

Program Control

CICSLevel 0CICS

Program1LINK ...RETURN

Program 2XCTL

Program 3LINK ...RETURN

Program 4

.....RETURN

Level 1

Level 2

Level 3

RETURNXCTLLINKLOADRELEASE

EXEC CICS LINK PROGRAM(PROGRAM-2)END_EXEC.

EXEC CICS XCTL PROGRAM(PROGRAM-3)END_EXEC.

© Copyright IBM Corp., 2008. All rights reserved.

This area of a program is used to pass information betweenother programs and transactions.• It is automatically provided to you via the Translator phase• In COBOL it is part of the DATA DIVISION / LINKAGE SECTION• It initially provides you one byte to be used as a programming SW although it can range up to 32K bytes in size (there are techniques to get around this)

O1 DFHCOMMAREA. 05 PROCESS-SW PIC X. 88 INITIAL-ENTRY VALUE ‘0’. 88 VERIFICATION VALUE ‘1’. 05 ACCOUNT-NUMBER PIC X(10).

EXEC LINK PROGRAM(ACCTPGM) COMMAREA(DFHCOMMAREA) LENGTH(11)END-EXEC.

***

CICS COMMUNICATION AREA (COMMAREA)

© Copyright IBM Corp., 2008. All rights reserved.

CICS JCL Startup

© Copyright IBM Corp., 2008. All rights reserved.

RDOGrouplist

being loaded

GoodMorningMsg

StorageSize

acquired

JavaEnabled

*

TempStg.Init

TypeOf

Startup

WebListenerenabled

MVS Console: CICS Startup

© Copyright IBM Corp., 2008. All rights reserved.

ClosingNetwork

No OutstandingTasks

Logswho is

shuttingdownCICS

MVS Console: CICS Shutdown

© Copyright IBM Corp., 2008. All rights reserved.

CICS Statistics Collected (DFHSTUP)

© Copyright IBM Corp., 2008. All rights reserved.

CICS and Web-enabling

4 major elements of web-enabled applications:

Presentation logic

Integration logic

Business logic

Data logic

© Copyright IBM Corp., 2008. All rights reserved.

CICS Web support

IBM HTTPServer for OS/390

CICSCICSWebServerWebServer

PluginPlugin

CICSCICSTCP/IPTCP/IPlistenerlistener CC

WW

SS

32703270WebWeb

bridgebridge

3270presentation

logic

W eb-awarepresentation

logic

CICSapplication

CICS region

COMMAREA

W ebBrowser

Directconnection

EXCI

© Copyright IBM Corp., 2008. All rights reserved.

CICS Transaction Gateway

Java clientJava clientapplicationapplication

ECI EPI ESI

Clientdaemon

Transportdrivers

Gatewaydaemon CTG.INI ctgcfgctgcfg

Configurationtool

CICSserver

Network

JNI

CICS Transaction

Gateway

© Copyright IBM Corp., 2008. All rights reserved.

CICS Transaction Gateway and WAS

© Copyright IBM Corp., 2008. All rights reserved.

CEMT – Master Terminal Commands * INQUIRE (set file)

* SET (disable a program) * PERFORM (Statistics)CECS – Command Syntax CheckCECI – Command InitiationCEDF – EXECUTE DIAGNOSTIC FACILITYCEDA/B/C – Resource updating via RDO (See utility DFHCSDUP*)CEBR – Temporary Storage BrowserCETR – TraceCSMG - MessagesCSFE PRINTJCL SDSF

* See next slide

CICS COMMANDS /DEMOS

© Copyright IBM Corp., 2008. All rights reserved.

Use this transaction to learn CICS

i.e. Write out a Temporary Storage Queue

CECI

© Copyright IBM Corp., 2008. All rights reserved.

CEBR Transaction – Added Value

CEBR TSQ CEBR0099 SYSID C22A REC 1 OF 0 COL 1 OF 0 ENTER COMMAND ===> ************************** TOP OF QUEUE ******************************* ************************* BOTTOM OF QUEUE ***************************** TS QUEUE CEBR0099 DOES NOT EXIST PF1 : HELP PF2 : SWITCH HEX/CHAR PF3 : TERMINATE BROWSE

PF4 : VIEW TOP PF5 : VIEW BOTTOM PF6 : REPEAT LAST FIND PF7 : SCROLL BACK HALF PF8 : SCROLL FORWARD HALF PF9 : UNDEFINED

PF10: SCROLL BACK FULL PF11: SCROLL FORWARD FULL PF12: UNDEFINED

Question: What is the differencebetween CECI READQ

and CEBR ?

Place your queue name here

© Copyright IBM Corp., 2008. All rights reserved.

CEDA

© Copyright IBM Corp., 2008. All rights reserved.

CEDA EXPAND LIST(DFHLIST)

© Copyright IBM Corp., 2008. All rights reserved.

Summary: CEDA/CEDB/CEDC

© Copyright IBM Corp., 2008. All rights reserved.

DFHCSDUP utility provides:

© Copyright IBM Corp., 2008. All rights reserved.

Example of Terminal Interactions

© Copyright IBM Corp., 2008. All rights reserved.

IMS Transactional Systems

Information Management System

3 components:

• The Transaction Manager (TM)

• the Database Manager (DB)

• Set of system services, providing common services to the other 2

© Copyright IBM Corp., 2008. All rights reserved.

Summary

• Interaction with the computer happens online through the help of a transaction manager.

• Many transaction managers and database managers exist, but their principles are similar.

• Data can be stored in a flat file, but this can result in duplication or inconsistent data. It is better to create central databases, which can be accessed (reading and changing) from different places.

• The handling of consistency, security, etc. is done by the database management system.