OS ISAM Logic
Total Page:16
File Type:pdf, Size:1020Kb
File Number S360-30 Order Number GY28-6618-5 Program Logic OS ISAM Logic Release 21 Program Number 3605-10-526 This publication describes the program logic of the two indexed sequential access methods: the queued indexed sequential access method (QISAM) and the basic indexed sequential access method (BISAM). It also discusses the relationship of indexed sequential access method routines to other parts of the control program. Sixth Edition (February 1972) This is a major revision of, and makes obsolete, the edition of this manual identified as GY28-6618-4. This edition applies to OS Release 21 and to all subsequent releases until otherwise indicated in new editions or technical newsletters. Changes to the information in this book may be made at any time; before using this publication in connection with the operation of IBM systems, consult the latest SRL Newsletter, GN20-0360, for the editions that are applicable and current. Requests for copies of IBM publications should be made to your IBM representative or to the IBM Branch Office serving your locality. Forms for readers' comments are provided at the back of this publication. If the forms have been removed, comments may be addressed to IBM Corporation, Programming Publications, Department D78, Monterey and Cottle Roads, San Jose, California 95114. Comments become property of IBM. © Copyright International Business Machines Corporation 1966, 1968, 1969, 1971, 1972 PREFACE This publication describes the program structure of the two indexed sequential access methods: queued indexed sequential access method (QISAM) and basic indexed sequential access method (BISAM). The manual is divided into seven sections: "Section 1: Introduction" is an overview of indexed sequential access method organization and an overall description of ISAM operations. "Section 2: Method of Operation" comprises four parts: 1. ISAM common open, common close, and validation modules - a discussion of the common processing operations for QISAM scan, QISAM load, and BISAM. 2. Queued Indexed Sequential Access Method, Load Mode - a discussion of the operations and routines unique to creating data sets with QISAM. 3. Queued Indexed Sequential Access Method, Scan Mode - a discussion of the operations and routines involved in retrieving and updating records sequentially using QISAM. 4. Basic Indexed Sequential Access Method - a discussion of the techniques and operations used in the direct storage and retrieval of records in an indexed sequential data set. "Section 3: Program Organization" contains flowcharts of individual ISAM routines. "Section 4: Director" contains a table of ISAM modules, by type, and module selection tables for QISAM load mode, open executors, and close executors. "Section 5: Data Areas" contains descriptions of data management control blocks and work areas used by ISAM. "Section 6: Diagnostic Aids" summarizes appendage, asynchronous, and exception codes set and used by ISAM routines. "Section 7: Appendixes" supplements this manual and program listings with a description of ISAM data set organization (Appendix A) and the ISAM channel programs (Appendix B). Prerequisite Knowledge Before reading this book, you should understand the material presented under "Processing an Indexed Sequential Data Set" in OS Data Management Services Guide, GC26-3746. Recommended Reading The following publications contain information that you may need in conjunction with reading this book: OS DADSM Logie, GY28-6607 OS Data Management Macro Instructions, GC26-3794 iii OS Data Management for System Programmers, GC28-6550 OS I/O Supervisor Logic, GY28-6616 OS MFT Guide, GC27-6939 OS MVT Guide, GC28-6720 OS Open/Close/EO V Logic, GY28-6609 OS Supervisor Services and Macro Instructions, GC28-6646 OS Sytem Control Blocks, GC28-6628 iv CONTENTS iii Preface xiii Summary of Changes for Release 21 1 Section 1: Introduction 1 Open Phase 2 Processing Phase 5 Close Phase 7 Section 2: Method of Operation 9 ISAM Common Open, Common Close, and Validation Modules 9 The ISAM Common Open Executors 12 The Validation Modules 13 Common Close Phase Executors 14 Queued Indexed Sequential Access Method, Load Mode 15 Load Mode Open Phase Operations 15 Initial Load or Reload Open Operations 15 Resume Load Open Operations 16 Full-Track-Index-Write Open Operations 16 The Final Load Mode Open Phase Operations 16 Load Mode Open Phase Organization 17 Initial Load Organization 20 Resume Load Open Organization 22 Full-Track-Index-Write Phase Organization 22 The Final Executors in Load Mode Open Phase Organization 23 Load Mode Processing Phase Operations 24 Put Routine 27 Beginning-of-Buffer Routine 27 End-of-Buffer Routine 28 Full Track-Index-Write 29 Appendages 30 Load Mode Processing Phase Organization 31 Channel Programs 33 Control Blocks and Work Areas 33 Load Mode Close Phase Operations 33 Load Mode Close Phase Organization 35 Queued Indexed Sequential Access Method, Scan Mode 36 Scan Mode Open Phase Operations 37 Scan Mode Open Phase Organization 38 Scan Mode Processing Phase Operations 39 Buffer Control Techniques 42 SETL Routine 43 Get Routine 45 EOB Routine 45 Scheduling Routine 47 PUTX Routine 48 ESETL Routine 49 RELSE Routine 49 Appendages v 51 Scan Mode Processing Phase Organization 51 Processing Routines 51 Scan Mode Channel Programs 52 Scan Mode Control Blocks and Work Areas 52 Scan Mode Close Phase 55 Basic Indexed Sequential Access Method 55 BISAM Open Phase Operations 56 BISAM Open Phase Organization 60 BISAM Processing Phase Operations 61 An Example of BISAM Processing Flow 62 Privileged Macro-time Routines 64 Nonprivileged Macro-time Routines 65 Appendage and Asynchronous Routines 67 Dynamic Buffering Routines 68 Check Routine 71 BISAM Processing Phase Organization 71 BISAM Channel Programs 89 BISAM Control Blocks and Work Areas 91 BISAM Close Phase 93 Section 3: Program Organization 139 Section 4: Directory 141 ISAM Module Identified in Alphameric Sequence 147 Section 5: Data Areas 149 ISAM Control Blocks and Data Areas 149 Data Control Block (DCB) 159 Data Event Control Block (DECB) 160 Data Set Control Block (DSCB) 167 Data Extent Block (DEB) 170 Input/Output Block (lOB) 172 Buffer Control Block (BCB)-BISAM 174 Buffer Control Block (BCB)-QISAM 175 Buffer Control Table (IOBBCT) 179 QISAM Load Mode DCB Work Area 187 QISAM Scan Mode DCB Work Area 193 BISAM DCB Work Area 196 QISAM Track-Index Save Area 198 ISAM DCB Field Area 199 Section 6: Diagnostic Aids 201 Appendage Codes 201 QISAM Scan Mode Appendage Codes 201 BISAM READ and WRITE K Appendage Codes 201 BISAM WRITE KN Appendage Codes 202 Asynchronous Codes 202 BISAM READ and WRITE K Asynchronous Codes 203 BISAM WRITE KN Asynchronous Codes 204 Exception Codes 204 QISAM Exception Codes 205 BISAM Exception Codes vi 207 Section 7: Appendixes 209 Appendix A: ISAM Data Set Organization 209 Introduction 209 Data Set Structure 211 Prime Data Area 211 Index Areas 213 Adding Records to a Data Set 215 Detailed Index Description 222 Appendix B: ISAM Channel Programs 285 Index vii ILLUSTRATIONS Figures 3 Figure 1. SIO Appendage for ISAM RPS 10 Figure 2. ISAM Open Flow of Control 11 Figure 3. RPS Identification Field in the Data Event Block 14 Figure 4. Flow of control through the Close Executors 17 Figure 5. Flow of Control through Load Mode Open Executors 25 Figure 6. Load Mode Put Routine 26 Figure 7. Load Mode BOB Routine 27 Figure 8. Load Mode EOB Routine 28 Figure 9. Load Mode Channel-end Appendage Routine 29 Figure 10. Load Mode Abnormal-end Appendage Routine 30 Figure 11. Load Mode Processing Modules 31 Figure 12. QISAM-Load Mode Channel Program Flow (Fixed-Length Records) 32 Figure 13. QISAM-Load Mode Channel Program Flow (Variable-Length Records) 34 Figure 14. Load Mode Control Blocks and Work Areas 36 Figure 15. The Flow of Control through QISAM Load Mode Close Executors 38 Figure 16. Flow of Control through Scan Mode Open Executors 40 Figure 17. Scan Mode Channel Program/Buffer Queues 40 Figure 18. Buffer Queuing and Movement in Scan Mode 43 Figure 19. Scan Mode SETL Routine 44 Figure 20. Scan Mode GET Routine 46 Figure 21. Scan Mode EOB Routine 47 Figure 22. Scan Mode Scheduling Routine 48 Figure 23. Scan Mode ESETL Routine 51 Figure 24. QISAM Scan Mode Processing Modules 53 Figure 25. Scan Mode Channel Program 54 Figure 26. Scan Mode Control Blocks and Work Areas 56 Figure 27. BISAM Open Executors 59 Figure 28. Flow of Control through BISAM Open Executors 62 Figure 29. Privileged Macro-time Routines 64 Figure 30. Nonprivileged Macro-time Routines 66 Figure 31. BISAM Appendage and Asynchronous Routines 67 Figure 32. Dynamic Buffering Routines 68 Figure 33. BISAM Check Routine 69 Figure 34. BISAM Processing Flow (Not WRITE KN) 70 Figure 35. BISAM Privileged Macro-time Modules 71 Figure 36. BISAM Nonprivileged Macro-time Modules 71 Figure 37. BISAM Asynchronous Modules 72 Figure 38. BISAM Appendage Modules 73 Figure 39. BISAM Channel Program Modules 76 Figure 40. READ K, WRITE K, READ KU Channel Program Flow 77 Figure 41. WRITE KN Channel Program Flow-Index Searching 78 Figure 42. WRITE KN Channel Program Flow-Add to Prime (Fixed-Length Unblocked Records, System Work Area) ix 79 Figure 43. WRITE KN Channel Program Flow-Add to Prime (Fixed-Length Unblocked Records, User Work Area) 80 Figure 44. WRITE KN Channel Program Flow-Add to Prime (Fixed-Length Blocked Records, System Work Area) 81 Figure 45. WRITE KN Channel Program Flow-Add to Prime (Fixed-Length Blocked Records, User Work Area) 82 Figure 46. WRITE KN Channel Program Flow-Add to Prime (Variable- Length Records, System Work Area) 83 Figure 47. WRITE KN Channel Program Flow-Add to End (Fixed-Length Records, System Work Area) 84 Figure 48. WRITE KN Channel Program Flow-Add to End (Fixed-Length Records, User Work Area) 85 Figure 49. WRITE KN Channel Program Flow-Add to End (Variable- Length Records) 86 Figure 50.