Transaction system slides

Download Report

Transcript Transaction system slides

Introduction to z/OS Basics
Chapter 11: Transaction managers on z/OS
CICS and IMS
Click to add text
© 2006 IBM Corporation
Chapter 11 Transactional Systems
Chapter objectives
 Be able to:
 Describe the role of large






2
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
Discuss the IMS components
© 2006 IBM Corporation
Chapter 11 Transactional Systems
Key terms in this chapter
 BMP
task/thread
 BMS
region
 conversational
PSB
 CICS TS
IMS TM
 CICS command
transaction
 IRLM
unit of work
 multithreading
 multitasking
3
two-phase commit
wireless access point (WAP)
© 2006 IBM Corporation
Chapter 11 Transactional Systems
CSMG
4
© 2006 IBM Corporation
Chapter 11 Transactional Systems
Example of online processing: a travel agency
 Mainframe applications designed for:
– employee and customer information
– contacts with car rental companies
– hotels
– airline schedules
– theaters
 Changes must be immediately reflected to endusers
 Contrast with batch processing
5
© 2006 IBM Corporation
Chapter 11 Transactional Systems
Example of online processing (continued)
Car Rental Agency
Airline
Hotel
WAP
HTTP
Travel Agency
6
© 2006 IBM Corporation
Chapter 11 Transactional Systems
A practical example
Car
Rental
Agency
Hotel
Airline
Travel
Agency
HTTP
WAP
7
© 2006 IBM Corporation
Chapter 11 Transactional Systems
Transactional systems
 Requirements: ACID Properties
Atomicity
Consistency
Isolation
Durability
8
© 2006 IBM Corporation
Chapter 11 Transactional Systems
Transactional systems: terminology
Commit and roll back
Multitasking
Multithreading
Thread
Reentrancy
9
© 2006 IBM Corporation
Chapter 11 Transactional Systems
Characteristics of a transactional systems
Many users
Repetitive
Short interactions
Shared data
Data integrity
Low cost / transaction
10
© 2006 IBM Corporation
Chapter 11 Transactional Systems
Two-phase commit - First commit then 2 phase
commit
Phase1
A
B
C
IN
ITIATO
R
Agent of A
Agent of B
U
pdatelocal resources
U
pdatelocal resources
U
pdatelocal resources
Prepare
R
eceive
Prepare
R
eceive
SYN
C
PO
IN
T
C
om
m
it
SYN
C
PO
IN
T
C
om
m
it
Phase2
SYN
C
PO
IN
T
11
© 2006 IBM Corporation
Chapter 11 Transactional Systems
What is CICS?
 Customer Information Control System
 Transactional subsystem of z/OS which:
– runs online applications
– At the same time, many users, same application(s)
– manages the sharing of resources
– integrity of data
– prioritization of execution, with fast response.
12
© 2006 IBM Corporation
Chapter 11 Transactional Systems
CICS in a z/OS system
z
/O
S
T
ra
n
s
a
c
tio
n
a
l
s
y
s
te
m
D
A
T
A
A
p
p
lic
a
tio
n
P
ro
g
ra
m
U
s
e
r
13
© 2006 IBM Corporation
Chapter 11 Transactional Systems
Languages & Platforms
 Languages:
- COBOL
- OO COBOL
- C
- zSeries (z/OS,
OS/390, VSE)
- C++
- Intel servers
- JAVA (JCICS)
- TXSeries (AIX, HP-
- PL/I
- Assembler
14
 Platforms:
UX, Solaris and
Windows)
© 2006 IBM Corporation
Chapter 11 Transactional Systems
Generating a CICS Application Program
Example: COBOL
1)
Translated
Program
2)
Object
Module
Link
Edit
3)
Load
Module
Program
Library
15
//DFHRPL DD DSN=CICSV3.SDFHLOAD1,DISP=SHR
//
DD DSN=CICSV3.SDFHLOAD2,DISP=SHR
//
DD DSN=CICSV3.ULOADLIB,DISP=SHR
© 2006 IBM Corporation
Chapter 11 Transactional Systems
CICS Programming road-map
 Design application
 Write & test program (includes compiling)
 Define program & transaction in CICS resources
 Define other resources (files, queues, etc…) in
CICS resources
 Make resources known to CICS
16
© 2006 IBM Corporation
Chapter 11 Transactional Systems
CICS in one or multiple LPARS
SYS 1
LPAR
AB
LPAR
LPAR C
Other
Subsyst
Other
Subsyst
CIC
S
CIC
Other
S
TOR
CIC
S
Other
CIC Subsyst
S
CIC
Other S
Subsyst
17
FOR
AOR
WOR
AOR
Subsyst
CIC
S
AOR
Terminals
Programs } one address space
containing all functions
Files
* 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)
SYS 2
PPT
TCT
FCT
PCT
CICS
ROR
CICS
Inter-System Communication (ISC)
CICS
* CICS has strong flexibility
for business configuration
needs thru table definitions
Other
Subsyst
© 2006 IBM Corporation
Chapter 11 Transactional Systems
CICS Features
•Transaction (Message) Driven
•Multitasking
CICS
•Multithreading
CICS
CICS
•Quasi-reentrant
18
© 2006 IBM Corporation
Chapter 11 Transactional Systems
CICS Programs, Transactions, Tasks and Tables
Transaction
> Program Control Table (PCT)- Maps input transaction
to Application
>Program Processing Table (PPT) – Contains
TCT
names of application programs Files
PPT
FCT
>File Control Table (FCT) – User Files
PCT
names e.g. where to save user state
>Terminal Control Table (TCT) - terminals,
sequential devices, logical units, and other systems to CICS
****
Table Definitions are usually done by the CICS Systems
Programmer through a CICS facility called Resource Definition
On-Line (RDO).
19
© 2006 IBM Corporation
Chapter 11 Transactional Systems
A CICS Transaction
A transaction is given a 4-character name in the program control table (PCT)
A transaction is one or more application programs that do the processing needed.
You describe each transaction type to CICS with a transaction resource definition.
It gives the type a name (TRANSID) and tells CICS about the work to
be done, such as what program to invoke first
A unit of Work is a complete operation that is recoverable; can be committed
or backed out entirely In many cases, a CICS transaction is unit of work.
When CICS receives a request, it starts a new task associated with this instance
of the transaction, with a particular set of data, on behalf of a user at a terminal.
It is analogous to a thread. When the transaction completes, the task is terminated.
20
© 2006 IBM Corporation
Chapter 11 Transactional Systems
A CICS Transaction
You can see how these two sets of definitions, transaction and program, work in
concert:
>The user types in a transaction identifier at the terminal (or the previous
transaction determined it).
>
>
>
>
21
CICS looks up this identifier in the list of installed transaction definitions.
This tells CICS which program to invoke first.
CICS looks up this program in the list of installed transaction definitions, finds
where it is, and loads it (if not already loaded).
CICS builds the control blocks necessary for this combination of transaction
and terminal, using both sets of definitions.
CICS passes control to the program, which begins running. This program may
pass control to any other program in the installed program definitions,
in the course of completing the transaction.
© 2006 IBM Corporation
Chapter 11 Transactional Systems
Conversational and Pseudo Conversational Transaction
A conversational transaction is when the programs being executed exists while
a user interacts with it.
A non-conversational transaction processes one input, responds, and ends.
It never pauses to read a second input from the terminal.
In CICS pseudo-conversational processing, in which a series of non-conversational
transactions gives the appearance (to the user) of a single conversational transaction.
-No transaction exists while the user inputs information to the screen;
-CICS reads the input when the user gets around to sending it. (next slide)
Note: TPF runs in this mode
22
© 2006 IBM Corporation
Chapter 11 Transactional Systems
A Task executing in Multi-Tasking
• 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
23
© 2006 IBM Corporation
Chapter 11 Transactional Systems
Conversational

Pseudo-Conversational
Pseudo-Conversational:
PROGV000
User
Types
Inputs
Menu
Enter account ______
Function code______
SEND MAP...
RETURN TRANSID(V001)....
PROGV001
Menu
Enter account 1234_
Function code M____
Record Update
User
Types
Changes
Enter account 1234
Nam e: Sm ith
Am ount: $10.00
Date: 05/28/04
Menu
Enter account 1234
Nam e: Sm ith
Am ount: $99.50
Date: 05/28/04
"Update Confirm ed"
24
RECEIVE MAP...
....
READ FILE...
....
SEND MAP...
...
RETURN TRANSID
(V002)....
PROGV002
RECEIVE MAP...
....
READ FILE UPDATE....
REW RITE FILE....
....
SEND MAP...
...
RETURN TRANSID (V000)...
© 2006 IBM Corporation
Chapter 11 Transactional Systems
Program Control
There are two CICS commands for passing control from one program to another.
>One is the LINK command, which is similar to a CALL statement.
> The other is the XCTL (transfer control) command.
When one program LINKs another, the first program stays in main storage. When
the second (linked-to) program returns, the first program resumes after the LINK.
In contrast, when one program XCTLs to another,
>the first program is considered terminated, and
>the second operates at the same level as the first.
When the second program returns, control is returned not to the first program,
but to the last program that issued a LINK.
25
© 2006 IBM Corporation
Chapter 11 Transactional Systems
RETURN
XCTL
LINK
LOAD
RELEASE
Program Control
Level
0
CICS
CICS
Level
1
Program1
LINK
...RETURN
Level
2
Program 2
XCTL
EXEC CICS LINK
PROGRAM(PROGRAM-2)
END_EXEC.
Program 3
LINK
...RETURN
Level
3
EXEC CICS XCTL
PROGRAM(PROGRAM-3)
END_EXEC.
Program 4
.....RETURN
26
© 2006 IBM Corporation
Chapter 11 Transactional Systems
CICS COMMUNICATION AREA (COMMAREA)
This area of a program is used to pass information between
other programs and transactions.
• It is automatically provided to you via the Translator phase
•
It initially provides you one byte to be used as a programming SW
although it can range up to 32K bytes in size
.
27
© 2006 IBM Corporation
Chapter 11 Transactional Systems
CICS and Web-enabling
 4 major elements of web-enabled applications:
 Presentation logic
 Integration logic
 Business logic
 Data logic
28
© 2006 IBM Corporation
Chapter 11 Transactional Systems
CICS Transaction Gateway and WebSphere Application Server
29
© 2006 IBM Corporation
Chapter 11 Transactional Systems
What is IMS?
 Information Management System
 3 components:
– The Transaction Manager (TM)
– the Database Manager (DB)
– Set of system services, providing common services to the
TM and DB
30
© 2006 IBM Corporation
Chapter 11 Transactional Systems
IMS overview
IM S
Logs
z /O S
C o n s o le
IM S S y s te m
T ra n s a c tio n
M anager
IM S
M essage
Q ueues
31
D a ta b a s e
M anager
IM S
D a ta b a s e s
© 2006 IBM Corporation
Chapter 11 Transactional Systems
IMS Transaction Manager (TM) messages
 Four types of messages:
– Transactions
– To go to another logical destination
– Commands for IMS
– For the IMS APPC feature to process
32
© 2006 IBM Corporation
Chapter 11 Transactional Systems
Summary : Transaction based systems
 Interaction with the computer happens online through the help of a
transaction manager.
 The continued growth of the Internet has caused many corporations to
consider the best ways to make their legacy systems available to
users on the Internet.
 CICS is a transactional processing subsystem. CICS applications are
traditionally run by submitting a transaction request.
 Information Management System (IMS) consists of three
components:
– Transaction Manager (TM)
– Database Manager (DB)
– A set of system services common to both TM and DB
33
© 2006 IBM Corporation