Text preview for : GY28-6609-6_OPEN_CLOSE_EOV_Program_Logic_Rel_21_Mar72.pdf part of IBM GY28-6609-6 OPEN CLOSE EOV Program Logic Rel 21 Mar72 IBM 360 os R21.0_Mar72 plm GY28-6609-6_OPEN_CLOSE_EOV_Program_Logic_Rel_21_Mar72.pdf



Back to : GY28-6609-6_OPEN_CLOSE_EO | Home

File Number S360-30
Order Number GY28-6609-6




Program Logic




OS OPEN/CLOSE/EOV Logic

Release 21

Program Number 360S-DM-50B

This publication, intended for system programmers and people who want
to understand the Open/Close/End-of-Volume (EOY) portion of the
operating system, describes the units of processing (functions) and units
of code (modules) of Open/Close/EOV.

Open opens a data set by linking system control blocks so that the access
methods can perform the input/output operations requested by the user.
EOV applies these linkages when the end of a volume of a multivolume
data set is reached and performs end-of-data processing. Close closes a
data set by restoring the system control blocks to the contents they had
before the data set was opened.

The book is divided into the following sections: Introduction, Method of
Operation, Program Organization, Directory, Data Areas, and Diagnostic
Aids. The latter section discusses how to use a set of routines called
Problem Determination to find the causes of errors that occur during
Open/Close/EOV processing.

The reader is expected to be familiar with OS data management, as
described in OS Data Management Services Guide, GC26-3746.
Seventh Edition (March 1972)

This is a major revision of, and makes obsolete, GY28-6609-5. The manual has been completely
rewritten to correspond to the redesign of Open/Close/End-of-Volume.

This edition applies to Release 21 of the operating system and to all subsequent releases unless
otherwise indicated by new editions or technical newsletters. Changes to the information in
this book may be made at any time, so 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.

@ Copyright International Business Machines Corporation 1968, 1969, 1970, 1971, 1972
PREFACE

This publication describes the functions (units of processing) and modules (units of code) of the
Open/Close/End-of-Volume portion of the operating system. It also describes the relationship
of Open/Close/EOV to the portions of the operating system that give control to and receive con-
trol from it. Open/Close/EOV modifies system control blocks, and mounts and verifies volumes
so that I/O operations can be performed.

This publication is divided into seven sections:

"Section 1: Introduction." The introduction briefly describes Open/Close/EOV processing.

"Section 2: Method of Operation." Diagrams and supplementary text show the input, process-
ing, and output of each function of Open/Close/EOV. The resident routine, which is used pri-
marily to transfer control between modules, is discussed at length. The emphasis of the chapter
is on the functional organization, not the modular organization, of the Open/Close/EOV portion
of the operating system. The diagrams indicate the relationship between Open/Close/EOV and
the other portions of the operating system that give control to and receive control from it, (the
scheduler, the direct access device space management (DADSM) routines, the access method ex-
ecutors, and user-written routines).

"Section 3: Program Organization." Module flow diagrams describe module processing in Open/
Close/EOV, message numbers of messages issued by each module, register usage within each
module, and major input and output of each module.

"Section 4: Directory." Tables of cross-references between the functions in the "Method of
Operation" section and the modules in the "Program Organization" section provide a link be-
tween the chapters when a particular module or function is being inspected.

"Section 5: Data Areas." Illustrations describe the work areas used by Open/Close/EOV. The
work areas described are the O/C/EOV work area, the JFCBMASK field of the job file control
block (JFCB), the DCBOFLGS field of the data control block (DCB), the XCTL table, and the
where-to-go table, which is also used by the access method executors.

"Section 6: Diagnostic Aids." A cross-reference table of the ABEND messages issued by Open/
Close/EOV and the functions and modules that issue them provides debugging information.
Information is provided on how to use the Problem Determination routines and the diagnostic
facilities of the Open/Close/EOV resident routine to provide additional debugging information
for Open/Close/EOV.


How to Use This Book
Before using this publication, read the introduction to establish perspective. After that, use of
the publication depends on the nature of the information you need.

If you want a general understanding of Open/Close/EOV, read the center block of each figure in
the "Method of Operation" section. This center block describes the processing performed.

If you want a more comprehensive understanding, read the center block of each figure and study
the right and left sides as the arrows direct you. The left side describes the input or conditions


iii
for performing processing steps. The right side describes the output produced by processing
steps. Remember that you begin reading each figure by reading the center, or processing block,
not by reading the left side where the input is shown. Do not assume that the left and right
sides show every field used as input or output; they show only the setting of fields that signifi-
cantly affect continued processing.

If you look in the "Diagnostic Aids" section for the message number of a message you have re-
ceived, you will find the names of the function and module that issued the message. Then turn
to the index or the "Directory" to find where that function and module are discussed in the
"Method of Operation" and "Program Organization" sections.

If you need further debugging help, consult "How to Use Problem Determination for Debugging"
in the "Diagnostic Aids" section to see if a trace will help. If the traces provided are not ade-
quate, consult "Resident Routine Trace" in the "Diagnostic Aids" section for information
on how to create your own trace.



Prerequisite Reading
Before reading this publication, you should consult the following sections of as Data Manage-
ment Services Guide, GC26-3746:

"Opening and Closing a Data Set" for a summary of Open/Close/EOV processing.

"Magnetic Tape Labels and Direct-Access Labels" to familiarize yourself with the information
contained in volume labels.

"Exits to Special Processing Routines" to familiarize yourself with the kinds of and purposes of
these routines.

You should be generally familiar with how the operating system works, as discussed in as MVT
Guide, GC28-6720, and as MFT Guide, GC27-6939.

You should also be familiar with the options of the OPEN, CLOSE, and FEOV macro instruc-
tions as described in as Data Management Macro Instructions, GC26-3794.



Related Reading
Information on the portions of the operating system that transfer control to and receive control
from Open/Close/EOV appears in the following pUblications:

as BDAM Logic, GY28-6617
as BTAM Logic, GY30-2001
as DADSM Logic, GY28-6607
as GAM Logic, GY27-7113
as I/O Supervisor Logic, GY28-6616
as ISAM Logic, GY28-6618
as QTAM Logic, GY30-2002
as SAM Logic, GY28-6604
as TeAM Logic, GY30-2029
iv
Other publications that may be of interest in conjunction with this manual are:


as Data Management for System Programmers, GC28-6550, which discusses how to use OPENJ
and RDJFCB.


as Job Control Language Reference, GC28-6704, which describes JCL options that affect
Open/Close/EOV processing.


as System Control Blocks, GC28-6628, which describes fields used in Open/Close/EOV proc-
essing.




v
CONTENTS

iii Preface
iii How to Use This Book
iv Prerequisite Reading
iv Related Reading
xi Summary of Changes for Release 21
xi Reorganization
xi Module Names
xi Problem Determination
1 Section 1: Introduction
The Resident Routine
1 Open/Close/EOV Data Areas
1 Opening a Data Set
2 Closing a Data Set
2 End-Of-Volume Processing
5 Section 2: Method of Operation
5 Introduction to This Section
5 The Resident Routine
5 WAIT Condition
6 XCTL Condition
6 Synchronize Condition
6 Parallel Processing
8 Open Contents (Figure 1)
9 Open-Overview of Processing (Figure 2)
10 Open Initialization Processing and RDJFCB (Figure 3)
12 Open Direct-Access-Begin Direct-Access Processing (Figure 4)
14 Open Direct-Access-Continue Direct-Access Processing (Figure 5)
16 Open Tape-Mount Correct Volume and Determine Label Type (Figure 6)
18 Open Tape-Volume Label Processing (Figure 7)
20 Open Tape-Standard Input Label Processing (Figure 8)
22 Open Tape-No Label/Bypass Label Processing and Nonstandard Label Input and
Output Interfaces (Figure 9)
24 Open SL Output Processing (Figure 10)
26 Open Security (Figure 11)
28 Open Merge (Figure 12)
30 Open-Access Method Executor Processing (Figure 13)
32 Open-Final Termination (Figure 14)
35 Close Contents (Figure 15)
37 Close-Overview of Processing (Figure 16)
38 Close Initialization (Figure 17)
40 Close Tape-Label Handling (Figure 18)
42 Close Tape-Volume Disposition Processing (Figure 19)
44 Close Direct Access Processing (Figure 20)
46 Close-SMF Record Building (Figure 21)
48 Close Final Processing (Figure 22)
51 TCLOSE-Overview of Processing (Figure 23)
52 TCLOSE Initialization (Figure 24)
54 TCLOSE Tape-Label Processing and Volume Positioning (Figure 25)
56 TCLOSE Direct Access-Input and Output Processing (Figure 26)
58 TCLOSE Final Processing (Figure 27)



vii
61 EOV Contents (Figure 28)
63 EOV-Overview of Processing (Figure 29)
64 EOV Initialization (Figure 30)
66 EOV Tape Input-Process Current Volume (Figure 31)
68 EOV Tape Input-Process New Volume (Figure 32)
70 EOV Tape Output-Process Current Volume (Figure 33)
72 EOV Tape Output-Verify New Volume (Figure 34)
74 EOV Tape Output-New Volume Processing (Figure 35)
76 EOV Direct-Access Input-Mount New Volume(s) (Figure 36)
78 EOV Direct-Access Input-New Volume Processing (Figure 37)
80 EOV Direct-Access Output-Get More Space (Figure 38)
82 EOV Direct-Access Output-Processing With New Space (Figure 39)
85 Problem Determination Contents (Figure 40)
87 Problem Determination-Overview of Processing (Figure 41)
88 ABEND Interpretation and Recovery (Figure 42)
90 Optional Module Trace (Figure 43)
93 Legend
95 Section 3: Program Organization
95 Introduction to This Section
96 Open Processing
96 Open and OPENJ Initialization Processing (Chart 1 of 1) (Figure 44)
97 Open Tape Processing (Chart 1 of 6) (Figure 45)
98 Open Tape Processing (Chart 2 of 6) (Figure 46)
99 Open Tape Processing (Chart 3 of 6) (Figure 47)
100 Open Tape Processing (Chart 4 of 6) (Figure 48)
101 Open Tape Processing (Chart 5 of 6) (Figure 49)
102 Open Tape Processing (Chart 6 of 6) (Figure 50)
103 Open Direct-Access Processing (Chart 1 of 3) (Figure 51)
104 Open Direct-Access Processing (Chart 2 of 3) (Figure 52)
105 Open Direct-Access Processing (Chart 3 of 3) (Figure 53)
106 Open Security Processing (Chart 1 of 2) (Figure 54)
107 Open Security Processing (Chart 2 of 2) (Figure 55)
108 Open Merge Processing (Chart 1 of 2)(Figure 56)
109 Open Merge Processing (Chart 2 of 2) (Figure 57)
110 Open Access Method Executor Processing (Figure 58)
111 Open Final Processing (Figure 59)
112 Close Processing
112 Close Initialization Processing (Figure 60)
113 Close Tape Processing (Chart 1 of 2)(Figure 61)
114 Close Tape Processing (Chart 2 of 2) (Figure 62)
115 Close Direct-Access Processing (Chart 1 of 2) (Figure 63)
116 Close Direct-Access Processing (Chart 2 of 2) (Figure 64)
117 Close Final Processing (Figure 65)
118 SMF Data Set Processing (Figure 66)
119 TCLOSE Initialization Processing (Figure 67)
119 TCLOSE Tape Processing (Chart 1 of 1) (Figure 68)
120 TCLOSE Direct-Access Processing (Chart 1 of 1) (Figure 69)
121 TCLOSE Final Processing (Chart 1 of 1) (Figure 70)
122 EOV Processing
122 EOV Initialization Processing (Chart 1 of 3) (Figure 71)
123 EOV Initialization Processing (Chart 2 of 3) (Figure 72)
124 EOV Initialization Processing (Chart 3 of 3) (Figure 73)


viii
125 EOV Tape Input Processing (Chart 1 of 3) (Figure 74)
126 EOV Tape Input Processing (Chart 2 of 3) (Figure 75)
127 EOV Tape Input Processing (Chart 3 of 3) (Figure 76)
128 EOV Tape Output Processing (Chart 1 of 4) (Figure 77)
129 EOV Tape Output Processing (Chart 2 of 4) (Figure 78)
130 EOV Tape Output Processing (Chart 3 of 4) (Figure 79)
131 EOV Tape Output Processing (Chart 4 of 4) (Figure 80)
132 EOV Direct-Access Input Processing (Chart 1 of 3) (Figure 81)
133 EOV Direct-Access Input Processing (Chart 2 of 3) (Figure 82)
134 EOV Direct-Access Input Processing (Chart 3 of 3) (Figure 83)
135 EOV Direct-Access Output Processing (Chart 1 of 4) (Figure 84)
136 EOV Direct-Access Output Processing (Chart 2 of 4) (Figure 85)
137 EOV Direct-Access Output Processing (Chart 3 of 4) (Figure 86)
138 EOV Direct-Access Output Processing (Chart 4 of 4) (Figure 87)
139 Shared Modules
139 Open, Close, and EOV Resident Routine (Figure 88)
140 Write-to-Operator Module (Figure 89)
141 Problem Determination Processing
141 Problem Determination (Chart 1 of 2) (Figure 90)
142 Problem Determination (Chart 2 of 2) (Figure 91)
143 Section 4: Directory
143 Function-to-Module Directory
143 Open (Including Open TYPE=J) Operation
146 Close (Including Close TYPE=T) Operation
148 EOV Operation
151 Common Functions
153 Section 5: Data Areas
153 O/C/EOV Work Area
154 Open, Close, and EOV Obtain an O/C/EOV Work Area for each DCB to be
Processed (Figure 92)
157 Fields of the O/C/EOV Work Area Associated with the JFCB, ECB, lOB, DEB, and
CCWs (Figure 93)
160 Fields in the O/C/EOV Work Area Used to Manipulate Other Fields (Figure 94)
161 JFCBMASK Field
164 DEBDCBMK Field
166 DCBOFLGS Field
166 Transfer Control (XCTL) Table
166 Format of the XCTL Table (Figure 95)
167 Where-To-Go (WTG) Table
167 Each Open or Close Operation Sets Up Its Own WTG Table (Figure 96)
168 WTGPATH Field
169 Section 6: Diagnostic Aids
169 ABEND Function-to-Module Cross-Reference
177 DCB Error Handling
177 Control Given to First Module of the Operation
177 Control Given to Executors
177 Control Returned from Executors
178 Control Given to Module Whose ID is in the Last Entry of WTG Table
178 Internal ABEND Codes
178 Open Operation
181 Close Operation


ix
182 Close (TYPE=T) Operation
183 EOV Operation
185 Message-to-Function Cross Reference
195 Register Usage
196 How to Use Problem Determination for Debugging
196 ABEND Trace
196 Optional Work Area Trace
196 Formatting Traced Output
196 Resident Routine Module Trace
199 Section 7: Appendix
199 Abbreviations
203 Glossary

207 Index




x
SUMMARY OF CHANGES FOR RELEASE 21

Reorganization

Most of the changes to Open/Close/EOY for this release consist of repackaging the existing code
to eliminate redundancy and needless transfers of control.

The Open/Close/EOY resident routine is a new module, resident in the nucleus. It waits for I/O
operations to be completed, transfers control between Open/Close/EOY modules, and brings all
DCBs to the same stage of processing before transferring control to a user-written routine or to
another portion of the operating system. Most Open/Close/EOY modules branch to the resident
routine when anyone of these operations is to be performed.

Open/Close/EOY operations have been divided into functions, which are units of processing,
not units of code. In some cases, a function has been put into a separate module, rather than
made part of several modules, to reduce the number of load operations and to simplify the mod-
ule flow logic.

Where similar processing is performed for different devices, the modules have been organized so
that each module contains code applicable to only one device.


Module Names
All Open/Close/EOY module names have been changed and begin with IFG. Alias names begin-
ning with IGG are retained where Open/Close/EOY transfers control to or receives control from
other portions of the operating system.


Problem Determination

The new problem determination routines provide ABEND information, such as a trace of impor-
tant control blocks, to help you diagnose errors that occur during Open/Close/EOY processing.
Instructions for how to use problem determination are in the "Diagnostic Aids" section. The
internal logic of problem determination is treated in the "Method of Operation" and "Program
Organization" sections.




xi
SECTION 1: INTRODUCTION

The Open, Close, and End-of-Volume operations are supervisor call (SVC) routines that reside
in the SVC library (SYS1.SVCLIB) and operate out of the SVC transient areas. A program
generally uses these routines by issuing a macro instruction (such as OPEN, CLOSE, FEOV, or
RDJFCB) whose expansion includes an SVC instruction. Execution of this SVC instruction
causes control to be passed to the SVC interruption handler, which determines the appropriate
SVC routine to receive control.


The Resident Routine
The Open/Close/EOV resident routine, resident in the nucleus, waits for I/O operations to be
completed, transfers control between Open/Close/EOV modules, and brings all DCBs to the
same stage of processing before transferring control to a user-written routine or to another por-
tion of the operating system. Most Open/Close/EOV modules branch to the resident routine
when anyone of these operations is to be performed. The resident routine is discussed in detail
at the beginning of the "Method of Operation" section.

The resident routine can also be used for diagnostic purposes, as discussed in the "Diagnostic
Aids" section.


Open/Close/EOV Data Areas
In addition to system control blocks, Open/Close/EOV obtains and uses three data areas.

An O/C/EOV work area is obtained for each DCB to be processed. This work area contains
portions of system control blocks that apply to each DCB.

A where-to-go table is obtained for each OPEN or CLOSE macro instruction. This table identi-
fies the next module needed to process each DCB being opened or closed. The access method
executors obtain this work area for EOV processing.

A resident routine work area is obtained for each OPEN, CLOSE, or FEOV macro instruction.
This work area is mainly a list of addresses of event control blocks (ECBs) that is used by the
resident routine when it waits for I/O operations to be completed.


Opening a Data Set
A data set is opened by the execution of an OPEN macro instruction, with or without a specifi-
cation of TYPE=J. Execution of an OPEN macro instruction that does not specify TYPE=J
includes an SVC interruption (SVC 19) that causes the interruption handler to pass control to
the Open routines. Execution of an OPEN macro instruction that specifies TYPE=J includes an
SVC interruption (SVC 22) that causes the interruption handler to pass control to the OPENJ
routine.

Open processing (performed by the Open and OPENJ routines) creates linkages between system
control blocks so that the access method executors can perform the I/O operations requested by
the processing program.


Section 1: Introduction 1
Much of Open processing is device-dependent, that is, it depends upon whether the data set is
on magnetic tape or a direct-access device. Open processing mounts and verifies the volume
supplied by the user, fills in the fields of the UCB that apply to the volume mounted on the
unit it represents, and merges information from the tape label or DSCB and the JFCB into the
DeB.

Both Open and OPENJ are type 4 SVC routines. The major difference between them is that
Open reads the JFCB from the SYS1.SYSJOBQE data set into the O/C/EOV work area, while
OPENJ moves the JFCB into the O/C/EOV work area from the user's region or partition after
the user has gotten it there by issuing a RDJFCB macro instruction. This allows the user to
modify the JFCB before the data set is opened. Execution of the RDJFCB macro instruction
includes an SVC interruption (SVC 64) that causes the interruption handler to pass control to
the Read JFCB routine in Open/Close/EOV. The OPEN TYPE=J and RDJFCB macro instruc-
tions are discussed in OS Data Management for System Programmers.


Closing a Data Set
The user closes a data set when he is finished reading or writing records from or to it. Execution
of the CLOSE macro instruction includes an SVC interruption (SVC 20) that causes the interrup-
tion handler to pass control to the Close routines.

The Close routines restore the fields of the DeB associated with the data set to the contents they
had before the DCB was opened (Open modifies several DCB fields); process labels and DSCBs;
reposition the volume; and release the DEB and access method executors.

A data set can be temporarily closed if BSAM is used. Temporary closing requires the execution
of a CLOSE macro instruction that specifies TYPE=T. Execution of this macro instruction in-
cludes an SVC interruption (SVC 23) that causes the interruption handler to pass control to the
TCLOSE routine.

TCLOSE differs from Close in that TCLOSE does not restore the DCB fields, or release the DEB
or access method executors. TCLOSE performs only label processing and volume repositioning.
Therefore, when TCLOSE closes a data set, the user may resume input and output operations on
that data set without reopening it.



End-Of-Volume Processing
Open processing creates linkages between system control blocks so that the access method exec-
utors can perform the I/O operations requested by the processing program. Close processing
undoes these linkages when the processing program is finished with I/O operations. EOV process-
ing applies the linkages created by Open processing when the end of a volume of a multivolume
data set is reached.

EOV performs the final processing on a data set and mounts and verifies additional volumes,
checking or building a data set label for each one. EOV processes only one DCB at a time.

The user can force an end-of-volume condition by issuing an FEOV macro instruction. The ex-
pansion of the FEOV macro instruction includes an SVC interruption (SVC 31) that causes the
interruption handler to pass control to EOV. The operating system issues an SVC 55 instruction
(for EOy) when either the Check routine of BSAM or a synchronizing routine of QSAM deter-
mines that the volume has ended but the data set has not, or that the data set has ended.

2 Open/Close/EOV Logic
The first module loaded for an SVC 31 instruction is the FEOV executor. The first module
loaded for an SVC 55 instruction is the SYNADjEOV executor. Both of these executors are
discussed in as SAM Logic. The next module loaded for either SVC is the first module of EOV.




Section 1: Introduction 3
SECTION 2: METHOD OF OPERATION

Introduction to This Section
In this section, Open/Close/EOV is divided into functions. A function is a unit of processing,
while a module is a unit of code. The emphasis in this chapter is on the flow of control between
functions.

The size of a function varies. It might be lK, which is the size of modules that execute in the
SVC transient area under OS MVT, or it may be less or greater than lK.

The functions of Open/Close/EOV are illustrated by diagrams. Input to the functions and out-
put from the functions provide information for a detailed understanding of Open/Close/EOV.
How to use these diagrams and how these diagrams relate to the rest of the book is discussed in
"How to Use This Book," which is included in the Preface. A legend that shows the meaning of
symbols used in this section's diagrams appears on a foldout page following the last diagram.

This chapter is intended for people who want an understanding of how all or portions of Open/
Close/EOV work and how Open/Close/EOV relates to the rest of the operating system.



The Resident Routine
The resident routine of Open/Close/EOV is a 504-byte module located in the nucleus. It is includ-
ed in the nucleus by the system generation inner macro SGIEA31C and is called by Open/Closet
EOV under three conditions: