Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

IMS Fundamentals - Transaction Manager

6,189 views

Published on

IMS Customer Internship held in San Jose, CA in April 2016.
Breakout session delivered by Deepak Kohli.

Published in: Technology
  • Login to see the comments

IMS Fundamentals - Transaction Manager

  1. 1. Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 IMS Transaction Manager Unit 5
  2. 2. © Copyright IBM Corporation 2008 Objectives • Understand the goals and architecture of IMS/TM (Transaction Management) • Learn the LTERM concept and how it relates to messages, message types and queues • Learn how IMSGEN control blocks required for TM are coded and maintained • Know the how IMSGEN control blocks, PSB and MFS control blocks are used in TM • Understand the Master Terminal Operator and IMS terminal commands • Understand IMS system security, integrity and maintenance functions
  3. 3. © Copyright IBM Corporation 2008 z/OS IMS/BATCH Address Space Application DL/I Modules Data Buffers IMS/BATCH Address Space IMS/BATCH Address Space Application DL/I Modules Data Buffers Application DL/I Modules Data Buffers Database (C) Database (A) System Log Database (B) System Log System Log Multiple IMS Batch Address Spaces
  4. 4. © Copyright IBM Corporation 2008 Goals of IMS/TM • Provide high-volume, rapid response transaction management processing for application programs accessing – IMS/DB database (full function and Fast Path) – DB2 tables • Define a logical/physical terminal structure that supports – Growth – Change independence – Usage of common resources – Productivity • Support database management integration – Data integrity through two phase commit of unit of work – Reliability/availability/serviceability (RAS) through transaction/database logging
  5. 5. © Copyright IBM Corporation 2008 ONLINE LOG DATA SET CORPORATE DATABASES RECONMSG QUEUE z/OS IMSCTL Control Region MESSAGE SCHEDULING LOGGING/ RESTART DBRC Recovery Control DLISAS DL/I Subordinate Address Space MPR Message Processing Region BMP Batch Message Processing IFP Fast Path Region TELECOMMUN- ICATIONS LOG CTL DL/I ACTION MODULES APPL PGM APPL PGM APPL PGM USER TERMINA LS IMS/TM makes data available to the end-user... MASTER TERMINA L IMS/TM Architecture
  6. 6. © Copyright IBM Corporation 2008 IMS/TM Dependent Regions • Maximum of 4095 dependent regions – Message Processing Regions (MPRs): • Selective start-up at IMS initialization • Processes "online" transactions from terminals • IMSCTL automatically "schedules" application programs for execution to process IMS/DB databases, or DB2 tables • Many different application programs can process in a given MPR throughout processing period – Batch Message Processing (BMP) regions: • Started when JOB submitted by operations • Runs one application-program to process queued transactions, IMS/DB databases, and/or z/OS files • Allows batch-type programs to process IMS queues and databases while IMS/TM system is available – Interactive Fast Path (IFP) regions: • Bypass IMS/TM scheduling via Expedited Message Handler (EMH) • For large transaction volumes that require fast response
  7. 7. © Copyright IBM Corporation 2008 IMSCTL (Control Region) DATA COMMUNICATIONS: MPR (Msg. Processing Region) LOGICAL TERMINAL ABC MESSAGES APPLICATION PROGRAM 'ANYPGM' LOGICAL TERMINAL XYZ PHYSICAL TERMINAL 1 PHYSICAL TERMINAL 2 PHYSICAL TERMINAL 3 Logical Terminal (LTERM) Concept
  8. 8. © Copyright IBM Corporation 2008 • Transactions – Originate from terminal (most IMS/TM activity) – Can originate from another application-program via "program-switch" • Message-switches – Allows terminals to communicate with each other • Commands – Mostly entered by MTO – Some commands may be entered from user terminals / COMMAND-VERB (PASSWORD) text 1 2 n LTERMnme (PASSWORD) text 1 8 9 18 19 n TRANcode (PASSWORD) text 1 8 9 18 19 n Message Types
  9. 9. © Copyright IBM Corporation 2008 Message Type Examples • Transactions: – SALARY(XPSWD) 123456 'Salary for John Doe (123456) is $xxx.xx' – ADDINV PART 9876 QTY=50 'Inventory on 9876: 10-Speed Bicycle = 9950 units' • Message-Switches – ACTGTERM ACCOUNTING DEPARTMENT MEETING AT 2:00PM • Commands /checkpoint freeze /start line 5 pterm 2 /change(zzzyyx) password 999888 to password 888999
  10. 10. © Copyright IBM Corporation 2008 z/OS  All INPUT and OUTPUT messages are queued... MESSAGE QUEUE DATA SET(S) IMS/TM IMS/MPR1 IMS/MPR2 QUEUE BUFFERS QUEUE MANAGER GET FROM QUEUE INSERT TO QUEUE A P P L GET FROM QUEUE INSERT TO QUEUE A P P L . . . . . .. . . . . . Message Queue (1 of 2) LOGICAL TERMINAL (LTERM)
  11. 11. © Copyright IBM Corporation 2008 TRAN X TRAN Y 1. INPUT TRANSACTIONS are QUEUEd by: MSG1 (LTERMA) X MSG3 (LTERMX) X MSG4 (LTERMQ) X MSG7 (LTERMX) X MSG2 (LTERMB) Y MSG5 (LTERMZ) Y MSG6 (LTERMA) Y 2. OUTPUT MESSAGES are QUEUEd by: LTERMA LTERMB RPL1 (X) RPL3 (X) RPL2 (Y) MESSAGE-QUEUE BUFFERS (Control Region) MSG1 RPL3 RPL2 MSG5 MSG7 RPL1 MSG6 MSG2 MSG4 MSG3 MESSAGE QUEUE DATA SET(S) Message Queue (2 of 2)
  12. 12. © Copyright IBM Corporation 2008 PSBs for IMS Transaction Manager PCB TYPE=TP PCB TYPE=DB PSBGEN... • TP – Alternate response IOPCB. • Used to send a message. • DB – Used to read or update a database - same as IMS db.
  13. 13. © Copyright IBM Corporation 2008 APPLICATION PROGRAM: MASK MASK MASK (TP-) IO- PCB ALT IO- PCB DATA BASE PCB LOGICAL TERMINA L ALTERNATE LOGICAL TERMINAL CUSTOMER ADDRESS PAYROLL LOGICAL DATABASE STRUCTURE LOGICAL TERMINA L LOGICAL TERMINA L Logical Structures
  14. 14. © Copyright IBM Corporation 2008 INVENTORY MENU 100 10 PART-NO: 200 INVPGM INVENTORY ON-HAND : 100 99 200 789 10 1000 A. DEVICE INPUT FORMAT (DIF) D. DEVICE OUTPUT FORMAT (DOF) INVPGM 00100 00200 00010 B. MESSAGE INPUT DESCRIPTOR (MID) (EDITED MESSAGE) C. MESSAGE OUTPUT DESCRIPTOR (MOD) (EDITED MESSAGE) 100 0099 200 0789 10 1000 APPL PGM ISRT NXT= MODNAME MESSAGEFORMATSERVICES(MFS) Message Format Service (MFS)
  15. 15. © Copyright IBM Corporation 2008 PAYROLL MENU: NAME:____________ SERIAL:___________ ADDRESS:_________ DEPT:_____________ PF1=UPDTPF3=EXIT /FORMAT PAYMENU MFS – Formatting a Screen • FORMATTING A SCREEN: – Using /FORMAT command: • No program is involved – Using Program-control: • Format screen using output message from a program • CALL 'CBLTDLI' USING ISRT IO-PCB IO-AREA PAYMENU – Message that is written to queue contains MOD name to be used to map a DOF (screen-format) name
  16. 16. © Copyright IBM Corporation 2008 SF00 MSG TYPE=OUTPUT, SOR=(SFIL00, IGNORE), OPT=2,NXT=SFIN00,FILL=PT MFLD REPLY, LTH=50,JUST=L MFLD SKILL, LTH=8, JUST=L MFLD NAME,LTH=6, JUST=L MSGEND Creates MOD... SFIN00 MSG TYPE=INPUT,SOR=SFIL00,OPT=2, NXT=SF00 MFLD TRANCD,LTH=6,FILL=NULL MFLD TYPESEG,LTH=1,JUST=L, FILL=C' ' MFLD SNE, LTH=18,JUST=L, FILL=C' ' MFLD DEGREE, LTH=1, JUST=L, FILL=C' ' MFLD SUBJECT, LTH=15, JUST=L,FILL=C' ' MFLD CDATE,LTH=4, JUST=L,FILL=C' ' MSGEND Creates MID... MFS – Creating Control Blocks • Creating MFS control blocks: //TEST EXEC @MFS //SYSIN DD * PRINT NOGEN
  17. 17. © Copyright IBM Corporation 2008 Creates DIF/DOF... MFS - Source SFIL00 FMT SFIL00 DEV TYPE=(3270,2) ,FEAT=IGNORE, PFK=(TRANCD,'CONVA '), DSCA=X'00A0' DIV TYPE=INOUT DPAGE CURSOR=((5,7)) DFLD 'SKILL INVENTORY UPDATE',POS=(2,30),ATTR=(NUM,PROT,HI) DFLD 'TYPE',POS=(5,2), ATTR=(NUM,PROT,HI) TYPESEG DFLD POS=(5,7), LTH=1 DFLD 'SKILL/EMPLOYEE/COURSE',POS=(7,2),ATTR=(NUM,PROT,HI) SNE DFLD POS=(7,24),LTH=18 DFLD 'DEGREE',POS=(9,2),ATTR=(NUM,PROT,HI) DEGREE DFLD POS=(9,9),LTH=1 DFLD 'SUBJECT',POS=(11,2),ATTR=(NUM,PROT,HI) SUBJECT DFLD POS=(9,9),LTH=1 DFLD 'COMPLETION DATE',POS=(13,2),ATTR=( NUM,PROT,HI) CDATE DFLD POS=(13,18),LTH=4 DFLD 'CURRENT SKILL',POS=(15,2),ATTR=(NUM,PROT,HI) SKILL DFLD POS=(15,16),LTH=8 DFLD 'CURRENT NAME',POS=(15,25),ATTR=(NUM,PROT,HI) NAME DFLD POS=(15,39),LTH=6 DFLD 'RESULT',POS=(17,2),ATTR=(NUM,PROT,HI) REPLY DFLD POS=(17,9),LTH=50 DFLD 'USE PF KEY 1 TO BEGIN THE CONVERSATION',POS=(23,2) FMTEND END /*
  18. 18. © Copyright IBM Corporation 2008 A system resources controller LTERM that is the operational "hub" of IMS/TM... COMMUNICATIONS COMMUNICATION LINES/NODES PHYSICAL TERMINALS LOGICAL TERMINALS TRANSACTION S AND PROGRAMS MESSAGE REGIONS SYSTEM STATUS CHECKPOIN T/ RESTART DATABASE DUMP and RECOVERY z/OS system console is "back-up" to MTO console... SCHEDULING INTEGRITY LOGICAL TERMIN A L MASTER TERMINAL DATABASE(S) Master Terminal Operator (MTO)
  19. 19. © Copyright IBM Corporation 2008 Terminal Commands MASTER Terminal: REMOTE Terminal: /NRESTART "Normal" /ERESTART "Emergency" /CHECKPOINT /DISPLAY /SIGN ON USERID PAYROLL /ASSIGN /SIGNOFF /CHANGE /IAM LTERM PAYROLL /STOP and /START NODE /LOCK LTERM PAYROLL DATABASE PROGRAM TRANSACTION REGION /BROADCAST NODE ALL /HOLD PAYROLL DATABASE UNAVAILABLE /RELEASE CONV 004 UNTIL 2:00PM /EXIT /RMLIST DBRC='DB DBD(DIVNTZ04) DBDS' /FORMAT PAYMENU /TEST /DBDUMP /EXCLUSIVE /DBRECOVERY /RDISPLAY MASTER /OPNDST /RCLSDST /CLSDST /MODIFY PREPARE /MODIFY COMMIT
  20. 20. © Copyright IBM Corporation 2008 System Integrity Functions • Common Logging Facility: – Database changes, transactions, system status changes • Automatic system checkpoints – Based on system activity – System Recovery and Emergency Restart • Database Recovery Control – Similar to batch recovery operations • Program Isolation – Automatic backout for program ABENDs – Data Sharing by multiple programs • Normal Restart – Start with unprocessed input/output from previous execution
  21. 21. © Copyright IBM Corporation 2008 OLDS5 OLDS4 OLDS3 OLDS2 RECON 3 RECON 2 z/OS IMS/TM DBRC DLISAS Control Region DB Recovery Control DL/I Subordinate Address Space SLDS2 SLDS1 RLDS2 RLDS1 SYSTEM LOG DATA SETS RECOVERY LOG DATA SETS LOG ARCHIVE UTILITY WADS WRITE AHEAD DATA SETS RECON 1 Buffers Buffers OLDS1 Common Logging Facility
  22. 22. © Copyright IBM Corporation 2008 Common Logging Facility (Cont) • Recording of IMS/DB and IMS/TM system activity: – "Before" and "After" images of changed DL/I segments – System status via periodic checkpoints – Input and Output messages are logged • Provides integrity and recoverability of DB/TM systems: – Used for Dynamic Backout of failing transactions – Used for system "warm" and "emergency" restarts – Used for database recovery – Used for performance and accounting statistics • Log Write-Ahead (LWA): – To guarantee database integrity, log records are physically written before database physically written – Only selected "events" qualify for this technique
  23. 23. © Copyright IBM Corporation 2008 OLDS and WADS • Online Log Data Set (OLDS) – Contains log records needed for: • Restart • Recovery • Backout: Batch and Dynamic – Consists of multiple data sets – Allows IMS/TM to continue logging when an "OLDS switch" occurs because of the following: • OLDS is full • I/O error while writing to an OLDS • Operator commands /DBR or /DBD – Written in a "wrap-around" manner – Can be archived automatically to the System Log Data Set (SLDS) • Write Ahead Data Set (WADS): – Contains committed log records not yet written to OLDS • Normally, only full blocks are written – May be used to "close" the OLDS in an emergency
  24. 24. © Copyright IBM Corporation 2008 Database Recovery Control (DBRC) • TWO LEVELS OF CONTROL: – LOG-CONTROL, controller of IMS log data sets: • Maintains information about OLDS status – e.g. ARCHIVE-NEEDED, AVAILABLE, ARCHIVE-IN-PROGRESS, NEXT-OLDS – 2a. SHARE-CONTROL since IMS 6.1 includes RECOVERY- CONTROL functions of earlier releases • can assist in database integrity and recovery • Database "registration" by database data set • Monitors Database Image Copies (ICs), Change Accumulations (CAs), Recoveries (DBRs) • Automatic JCL generation of needed job-streams – 2b. SHARE-CONTROL enables database sharing: • Access-intent must be registered with a "share-level“ – Database-level sharing – Intra- or inter-processor block-level sharing • There is no DBRC or IMS "parm" that determines Log-Control vs. Share Control – Share Control is in effect for individual databases once they are "registered"
  25. 25. © Copyright IBM Corporation 2008 "The RECON" for Log-Control (1 of 2) • Recovery Control Data Sets (RECON): • Automatic recording of information about: – Online Log Data Set (OLDS) – System Log Data Set (SLDS) – Recovery Log Data Set (RLDS) • Generation of utility JCL via DBRC command for: – Log Archive – Log Recovery
  26. 26. © Copyright IBM Corporation 2008 //DFSOLP00 //DFSOLP01 //DFSOLP02 OLDS 1 OLDS 3 STATUS: ARCHIVE SCHEDULED STATUS: IN USE STATUS: AVAILABLE RECON PRIOLD SECOLD PRISLD SECSLD PRILOG SECLOG . . . ARCHIVE JOB: ARC001 SLDS1 RLDS1 OLDS 2 "The RECON" for Log-Control (2 of 2)
  27. 27. © Copyright IBM Corporation 2008 DBRC Database "Registration" for Share Control • Advantages: – Records recovery-related information in RECON • Example: which OLDS has log data for each database data set (DBDS) registered with DBRC – Controls recovery of databases – Generates JCL for recovery-related utilities • Used to select correct data sets to be used by Recovery and Image-Copy • Consolidates changes of log records • Saves time • Eliminates errors • Register databases with DBRC commands – once a database is registered, Share Control is in effect
  28. 28. © Copyright IBM Corporation 2008 Restart Checkpoint Type: Selected: COLD CHKPT 0 WARM CHKPT Generated At Previous Shutdown EMERGENCY Last CHKPT Written to Log Checkpoint and Restart (1 of 2) • IMS uses its own CHECKPOINT processing • System-wide checkpoint is taken periodically based on – volume of log-records generated • Restart is based on use of a CHECKPOINT which contains – a "snapshot" of system control-blocks to log data set (OLDS)
  29. 29. © Copyright IBM Corporation 2008 z/OS IMS/TM DBRC DLISAS MESSAGE QUEUE(S) RECON DATABASE(S) Checkpoint and Restart (2 of 2) 1. z/OS System Failure 2. Stand-alone dump 3. Restart z/OS operating system 4. Emergency Restart IMS: – Database backout of "in-flight" transactions 1. “In-flight" transactions re-scheduled 2. Message queue reconstruction 3. Message transmission repositioning 5. Continue processing
  30. 30. © Copyright IBM Corporation 2008 System Application Terminal Network IMS Generation (IMSGEN) • IMSGEN MACROS Macro Function IMSCTRL System-wide parameters IMSCTF z/OS parameters MSGQUEUE Message Queue definitions BUFPOOLS Control-block buffer-pools DATABASE Databases APPLCTN Applications/Programs (PSBs) TRANSACT Transactions COMM Communications defaults TERMINAL Physical Terminals NAME Logical Terminals (LTERMs) • Online Macro changes through Online Change facility – DATABASE – APPLCTN – TRANSACT – MFS format Block
  31. 31. © Copyright IBM Corporation 2008 Extended Terminal Option (ETO) • Optional (additional cost) Feature of IMS/TM • Terminals may optionally be defined outside of the IMSGEN Process. • Fewer IMSGENs • Smaller and faster IMSGENs • Dynamic control block management • Requires user sign on
  32. 32. © Copyright IBM Corporation 2008 Unit Summary • IMS/TM supports the RAS (Reliability, Availability & Serviceability) characteristics for application transaction processing programs • LTERMs isolate messages, message types, queues and program processes from physical terminal characteristics • IMSGEN, PSB and MFS control blocks are used in different aspects of TM • Master Terminal Operation capabilities and IMS terminal commands are available to control and maintain transaction systems • IMS system security, integrity and maintenance functions exist • ETO and DRF are additional cost options/tools that extend the capability of IMS

×