Scanned GY28 2016 5_Time_Sharing_System_Access_Methods_PLM_Sep71 5 Time Sharing System Access Methods PLM Sep71

GY28-2016-5_Time_Sharing_System_Access_Methods_PLM_Sep71 GY28-2016-5_Time_Sharing_System_Access_Methods_PLM_Sep71

User Manual: GY28-2016-5_Time_Sharing_System_Access_Methods_PLM_Sep71

Open the PDF directly: View PDF PDF.
Page Count: 235

DownloadScanned  GY28-2016-5_Time_Sharing_System_Access_Methods_PLM_Sep71 GY28-2016-5 Time Sharing System Access Methods PLM Sep71
Open PDF In BrowserView PDF
File No S360~30
GY2k2i)jo -.:

--...- ----------., --

-- -

Program Logic

Version 8.1

IBM System/3S0 Time Sharing System
Access Methods
This publ.lcation describes thtc intevnal logic of the
nonres.ldent access metnods used in TSS/3bO.
(The
facil.lty which controls most conversational input/output
.In TSS/360, tne resident terminal access method (RThM) is
t>d rt. of t.he resident supervisor and is descr ibed in IBM
systeml360 Time Sharing Syst"m:
Resident supervisor-~rogram Lo~ic Manual, GY28-2012.)
The nonresident access metnods are:
• The virtual access methods (VAM), used to storE' and
retrieve page-organized data located on direct access
devlces, and including thf virtual sequential (VSAM),
virtual index sequential (VIShM), and virtual
partitioned (VPhM) access methods.
• The sequential access methods (SAM), used to access
OS/360-oriented data sets on t.ape or direct access
deVices, and inclUding the basic sequential (BSAM)
and queued sequential CQSAM) access methods.
• The multiple sequential access method (~~AM), used
for efficient input/olltput with unit record
pquiFment.
• A facility, 10~F~. whic~ allows a user to provide his
own access methoi with, pr:vate device.
• The terminal access method (ThM). which allows
input/output with specific terminals.
• A Terminal Task Control module which provides task
control for multiterminal task (MTT) application:>.
For each access method, an overview, routine
descriptions, and flowcharts are provided.
This material is intended for persons involved in
program maintenance, and system programmers who are
altering the program desiyn.
It can be used t,o locatf~
specific areas of the program, and it enables the reader
to relate these areas to the corresponding program
listings.
Program logic information is not necessary for
the use and operation of the program.

Ttas publlCdt ion j1'5ccil:ies the access
m(>thoos in TS,,;FH'.O (except tel' the rp~ldent
tprmlnal aeee:;;, ;DPLhod*).
It Cdn fl<' read

,->plpctlv€ly for d general understanding of
.1 part.leular access method,
or It Cdn he
u!jec1 dS a guide to more oet.dih'l
l.nformation in iHl Object proqrdffi 1 isting of
d pa![ticular access mpt.hoJ object olOOIJlp.

d["f'

T,;:~/

GENERAL

BOu~:S

TO REFER TO:

groupf'J in thi:;
BO:JKS RELATED TO A.CCESS METHODS:

• Basic Se'luent ia1 Accpss I"etho,j (BSAM).
Multiple Sequpntial Access ~ethod
(MSAM). Tenr.inal Access Method (T.a.M),
and lORE,,.) •
.. Virttlal AcceSS M('thod,; (VAI~). includ.ing
Virtual :~equential IVSAM), Virtual
Index Sequential (VISA,M), and Virtual
PartItioned (VPI\M) Access Methods.

• Clueu(->d Sequential Access Method I QS,i\Ml •
• Terminal Task Control Ca facility which
controls tasks that have ~ulti-Terminal
Task (MTT) applica tions).

Access methoas are usually invoked as
tht> result of USE:or- or system-initiCitt:d
Illdcro ino;t.ructions describ<>d in:

IBM Syst em/ 360 TiJTIf' ~har in'L Sys tem:
Ass.;::mbler Us f'r Mac,ro Inst ruct Ions.
GC28- 2004.
A complete explanation of data
in TSS/360 from the user
of view is provided in:
manaqemen~

[~int

~~l'12ystem/360

Ti~,-~hi'lring System:
Cata Management Facilities,
GC28-2056.

For each accf.'SS method, an overview dnd

lndividual routine descriptions are
TO FIND AN ACCESS METHOD:

f,rovided.
Fl~chdrts for all access
are grouped in one section.

n~thods

See the Table of contents.
TO USE ThIS BOOK,

YOU NECD:
TO F!ND A PARTICULAR ROUTINE

This is a minor revis.ion of GY28·20164
incorpt·-e-~:f-'nt:.ativ~

(~ODULE):

See Appendix C, Access Methods
Directory.

*See Resident Supervisor Program Logic
~anual. GY28-2012.

ot

,-,t

lbu.

ISM Syst('ml360 Principles of Opf'ration,
(;A22-6821.
I_B.!LSystem/360 Tune Sharlnq Syst.>m:
<.,:oncepts and f'acilitie", GC28-2001,

hOW THIS BOOr I,; ORGANIZED

The aeees:; methods
book into tour Pi>rts:

General funl idrity with 'l"SS/3t10
a,,;semblf'r lanquaqp and the main eoncE>pts

A for. is provided dt thf> back of this ~Iut;licdtion for reddpr's
I f t.hlt' form has bt?€n removed, cotM.ents fT\ay teo addre:;spd t.o
1 BM Corporat lon, Oepoactment. b43" Nt:' ighborhood Road f hi ng::.t.on. N. Y.

cOfflDent.s..
J2~O\

"Copyright Int.t::'rnational Business Mdchin~s Corporation 1961,
1969, 1910, 1911

1968,

~odule

PART I:

I\CCE!~:,

Mi:TilO[) F'Ok

8:;,\1'\,

~~:;AM.

TA~"

lINU lO}lE(J

:;t,(l'lUN 1: INT,{OllllCTION •
Ll nkchj€' t u t i " Acct':'~; r-;.'t

hocJ~j Rout inl'c;
M, t lloei PhdSt'c,
~:dcro In:,truct ion:-,
Cunt rol l\lock~;
BSAM OVERVIEW .
M.C;AM Ovprview .
Datd :-;et~;, rl1lftt'r,;, dnu Blocking Fdctors
Scherratlc Df'~'cri,ltioll
MSAM (; 1 0 ~;:~d r '(
RTAI'l OVUiVIEW .
TAl" Overviplol
lORE\) Overv 1 <>101
ACCIc'~j~

SECTION 2: OPEN PROCESSING
Common Processlnq . .
Open Corrunon Routlne (ClCLA)
SAM Open Processing .
SAM Open Mdinllne Routine (CZCWO)
Tape Open Routine (CZCWT) •
DA Open Routine (CZCWD> .
DEB PROCESSING
Build Common DEB Routine (CZCWB)
Build DA DEB Routine (CZCWL)
DSCB Processing .
Read Format-] DSCBs Routine (CZCWR)
Set DSCB Routine (CZCXS)
MSAM Processing . • • • .
MSAM Open Routine (CZCMC)
SETUR Routine (CZCMD)
TAM Processing
TAM Open Routine (CZCYA)
lOR Processing
lOR Open Routine (CZCSC)
SECTION 3: READ/WRIT~ •
Read/Write Processing • •
BSAM Read/Write Routine (CZCRA) •
DOMSAM Routine (CZCME)
MSAM Read/Write Routine (CZCMF)
TAM Read/Write Routine (CZCYM)
IOREQ Routine (CZCSB)
SECTION 4: POSTING AND CHECK
Posting and Check Processing
SAM Posting and Error Retry Rout.ine (CZCRP)
DA Error Retry Routine (CZCRH)
MSAM pO~jting and Error Retry Routine (CZCMG)
Central Installation Devices
Remote Job Entry Devices
TAM Posting Routine (CZCZAl
IOREQ Posting Routine (CZC~E)
Check Routine (CZCRC) •
SECTION 5: CLOSE
Close Processing
Close Common Routine (CZCLB)
SAM Close ~outine (CZCWC) •
MSAM Finish Routine (CZCMlD
MSAM Close Routine (CZCMI)

4

7
E
J

1 (}
1 ()

1
1L
14

14
14
1')

·
•

1 ')
16

•

17
17
17
\8
1q

•

• 19

19
19
19

21
24
24
•

26

26
28

28
28
.30
34

•

3',
41

•

I~ 6

•
•

46
46
c) 0

•

c)

•

'~4
Cj

4

9

60
6 c)
66

6B

08
68
6R

69
71

.i i

1

'lAM clu:;,' ;,out
lOR (' iu:;" ""I.)\'
~:c.CTION

6:

ifl!'

~n,-'

(ClCYG)
{('ZCSD)

fW:ITINl-;.:; SPECIFICALLY

12

73
DJ:::CjIGNEU F'OH

74
74

E:lSAM

Proce:":;or:;
....
'I'If'" \/olum" Ldlx'l Rout irll' (CZCWX)
Td~e [)dtd ,;et wbel l<.·l

fiA 1npll1: L.lbel Routin" (CZCXN)
fll'. i)ut!,llt Lah'l Routine (CZeX!)

tOV Proce:;:;oL,
Fore., End of VOlllffif> kout,lnt'
~alnlln~

74
74
78
78
79
• 79
79
80
• 81
82
82
83
83
83
84
85
86
• 86

•

(CZCLiJ)

hOV RoutIne

(CZCXE)
Tapf ["put Fe;; Rout ine (CZCXT)
Ta!A' (jut,put EOV Routine (CZCXO)
DA Input, £oV Routine (CZeXI)
LA Outt,ut rDV Routl ne (CZCXO)
Concat~~dtion Routin~ (CZCXX)
RSAM User Rautinp~
Note Routine (CZCRN)
Point RoutIne (CZCH~)
8ackspace Routine (CZCRGJ
Control Routine (CZCkS)
ASCII 'Iransldtion and ConverSl0n Rout~ne (CZCWA)
Bufferiny ~ervicps
GETPOOL Rout ine (CZCMB)
(,E"TI:lUF Rout,in" (CZCMJI)
FREEBUF Routine (eZeNA)
FREEPOUL Routine (CZeNS)
BSi,J'l Int{>rnal Control Routines
Tape Posit1oning Routine (CZCWP)
Volume 3E'quecflce convert Routine (CZCWV)
Mes~age Writer Routine (CZCWM)
Find Records per Track Routine (eZCHQ)
RELFUL Routine (CZeRR)
FULREL Routine (CZCRS)

• 87
87
89
90
90
90
91
• 92
93
• • 94

95
• 95

PART II: VIRTUAL ACCESS METHOD (VAM)

97

99
99
99
.102
.102
.103

SECTION 1: INTRODUCTION
Virtual Data Set Organization
Movepage Routine (C2COC)
The Access Methods

Faci lit ies Provided by VN<1
VAM ERROR RfCOVERY TECHNIQUES
VMlER Routine (CZCEI)
VOMEP Routine (CZCQK)

.103

• .105
.101
· .107
• .107

VAM Interfdces
AttriDutes
Linkage convent ions
CONTROL BLOCKS
Interruption Storage Area (ISA) -- (CHAISAJ
Task. Data Definition Table (TOT) - - (CHATDT)
Relative External Storage Corres~ondence Table (RESTBL)
Shared Oatrl Set Table (50ST)

~odule

• .108
.108
.108

.110

.112
.112
.112

5DST MaintE:nance

Search SDST Routine (CZCQE)
SECTION 2: V~ VOLUME FDRMAT AND DATA SET MAINTENANCE •
The Data Set Control Block. (DSCS)
Building and Maintaining a Data Set •
Insert/Delete Page RoutinE: (C'lCOO)
Insert Routlne (CZCOFJ
Expand REST3L Routine (CZCQI)
~equest Page Routine (CZCOE)
Reclaim koutine (CZCOG)
DELVAfr, Rout,ine (CZCFT)
SECTION 3:

iv

DATA SET ::;HARING

.118
·
•

.118
.119

.119
· .120
• .121

· .122
.

• .123
. . 124

· .127

Control Table Interlocks
• . • •
Interlock Routine (CZCOH) • • • •
Release Interlock Routine (CZCOI) •

• .128
.129
• • .130

SECTION 4: OPEN AND CLOSE PROCESSING
OPEN PROCESSING • • . • • • •
OPENVAM RoutinE, tCZCGA) .
DUPOPEN Routin€' (CZCEY) .
VSAM Open Routine (CZCOP) •
VISAM Open Routine (CZCPZ)
Close Processing • • • • • •
CLOSEVAM Routine (CZCOB)
• • • •
DUPCLOSE Routine (CZCEZ)
••••••••
VSAM Close Routine (CZCOQ)
VISAM Close Routine (CZCQA) • • • • • • • • •
VAM ABEND Inte~lock Release Routine (CZCQQ) •

• .132

SECTION 5: VIRTUAL SBQUENTIAL ACCESS METHOD (VSAM)
Routines in VSAM . • • • • • •
VSAM Get Routine (CZCOR)
VSAt-I PUT Routine (CZCOS)
SETL Routine (CZCOT)
PUTX Routine (CZCOU)
••.•
FLUSHBUF Routine (CZCOV)

.144
.144
.144
• .147
.148
• .150
.150

.132

.132
.136
• .131
• .138

• .139
•

.139

.141
• .142
• .142
.142

SBCTION 6: VIRTUAL INDEXED SEQUENTIAL ACCESS METHOD (VISAM) •
.152
VISfuV, Overview • • • • • •
• .152
VISAM Page Formats
• .153
VISAM Routines
• • • •
• • • .154
VISAM Put Routine (CZCPA) •
• .155
VISAM Get Routine (CZCPB) • • • •
• .157
SETL Routine (CZCPC)
• • • • • • • •
• .157
Read/Write, DELREC Routine (CZCPE)
••••
.159
GETPAGE Routine (CZCPI) • • • • • • •
.160
Add Directory Entry Routine (CZCPL) •
• .162
SECTION 7: VIRTUAL PARTITIONED ACCESS METHOD (VPAM)
VPAM Overview • • . • • • • • • • . • • • • •
VPAM Control Blocks • • • • . • • • • • • • .
Partitioned Organizat.ion Directory (POD)
Use of Member Headers in RESTBL •
VPAM Routines • • . • • •
• • • • • • • •
Find Routine (CZCOJ)
••••
••••••
Stow Routine (CZCOK)
Search Routine (CZCOL)
Extend POD Routine (CZCOM)
Relocate Members Routine (CZCON)
GETNUMBR Routine (CZCOO)
••••
PART III: QUEUED SEQUENTIAL ACCESS METHOD (QSAM)
SECTION 1: GENERAL DESCRIPTION
QSAM Macro Instructions
Work Area and Buffers •
Control Blocks . • • • • •

• .164
• • • • 164
• • • 164
•

.161.&

• • • 165
•

.165

.165
• .168
• .171

.172

• .112
.173

.175
.177

• .177
.178
.178

• • • •
• .179
SECTION 2: INTERFACE RULES AND MODULE DESCRIPTION
• • • • • • • • • .179
QSAM Routine (CZCSA)
••••

SECTION 3: INTERNAL LOGIC.
Common processing • • . • •
SYNAD Subroutine
Read/Write Subroutine •
Control Subroutine
Backspace Subroutine
Point Subroutine
Check Subroutine
Flush Subroutine

.186
.186
• • • 186
• .186
• .186
• .186
· .186
• • • 186
• • • • .186

v

GETIO Subroutine
PUTIC Subroutine
PUTXIO Subroutine
u)qic of Macro Services
G1:.T Macro Processing
POT Macro Processing
P!ITX Macro Processing
TKUNe ~~cro Processing
RELSE Macro Processing
. . . . .
SETL Macro Processing .
C1'£)S1:. and FEOV Functions Pelcformed by QSAM

• .187
• • • • 187

• .187
•

.187

• • • . 187
·

.188
. 189
• .189
.169
• • .190
.191

PART IV: RTAM/MT'I ACCESS METHODS SUPPORT

•

SECTION 1: MTT TERMINAL TASK CONTROL
Terminal Task control Routine (CZCTC)
.
I"TT Enable
FIND\., Macro .
R.E.AI:IV Macro .
WRITEQ Macro
CLEARQ Macro
FREEQ Macro

.195
• .195
. • •
• • • •

•

• •

•

•

•

.193

.19 '}
.196

• • • • • • • • • .196
• .197

• .197
• .197

.199

FLOWCHARTS
APPENDIX A:

CO~TROL

BLOCKS USED BY ACCESS METHODS MODULES

APPENDIX B: MODULES CALLED BY ACCESS METHODS MODULES

•

.440

• .444

APPENDIX C: ACCESS METHODS MODULE DIRECTORY
APPENDIX D: QWY-AR [)SECT AND DESCRIPTION • •

.453

APPENDIX E: DESCRIPTION OF' FIELDS IN QSAM PORTION OF DeB

•

INDEX •

• .456

vi

•

•

.454

E~I'!JSTRATIONS

Figure
Figure
Figure
Figure
Figure
DEB
Figure
Figure
Paths
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure

. .

.

1-

2.
3.
4.
S.

6.
7.
8.
9.
10.
11.

12.
13.

14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.

Access Method Phases fOl: BSAM, MSAM, TAM, and IOREQ ·
DEB Page Layout
·
DEB Work Page Layout
· · ·
TAM Open: DEB and TOS Storage Allocation and Pointers
lOR OPEt>' :
Basic Pointers and Data Moved from JFCB to

· · · · · · · · · · · ·
· · ·· · · · · · ·

II

·
·
· · 25
. . . · · "ation · · · · · · · .. · · · · · · 27
TAM Read/Write: · CPG
L
Sequence ·
· Analysis
· · · · · · 37
TAM Posting: Normal Cu..:,.Jletion and Exception
. . . .
61
· 78
Obtain ]{eys and Label I/O Areas
·
·
·
·
·
·
79
Retain Keys and Label I/O Areas
· · · ·
How TSS/360 Handles ASCII Record Input
88
·
How TSS/360 Handles ASCII Record Output
89
·
Tape Positions
· 91
91
Data Positioning
·
·
·
·
·
·
·
·
·
Skipping Files
Tape
· · · · · · ·
· 92
94
Entry for Single/Multiple Phase· Message
· ·.110
DCB Format for VAM
·
RESTBL Format .
· .111
· · · · ·
.111
RESTBL External Page Entry - CHAEPE
20
20

·

0'1

·

.114
Shared Data Set Table (SDST) Format
Linkage Relationships Among Control Blocks Used with VAM.l1S
.124
Deleting Pages from the "In Use" List in RESTBL
Module Interaction in VAM Open Processing
• 133
.133
Module Interaction in VAM Close Processing
.143
DCBHEADER Interlock Summary
.145
VSAM Data Record and Page Formats
·
.155
VISAM Record Relationship ·
· · ·
.16 II
Partitioned Organization Directory (POD}

·

····
·

·

·
·

·

·

·

vli

TABLES

Table 1.
BSAM, ~1SAM, TAM and I')REQ READ/WRITE and GET/PUT Level
l',acro Instructions . • . .
• •••••••. "
5
Table 2.
BSAM, MSAM, TAM, and rOREQ I/O Macro Instructions
Required for I/O operations
• • . • •
6
Table 3.
BSAM, M.SAM, TAM, and rOREQ Macro Instructions
6
Table 4.
DeB Table Fields and Flags (MSAM Section)
• • 11
Table 5.
Some DSP Table Fields
• • • •
• 11
Table 6.
Some DECB Table Fields (CHADEC)
11
Table 7.
Some DEB Table Fields . • • • •
• 11
Table 8.
TAM Read/Write: Terminal Information from SDAT •
• • 38
Table 9.
TAM Read/Write: Type Option (Hex and Mnemonic) Codes and
Description • • • • • • • • • • • . • • . • • • • • • • .
• 39
Table 10. TAM ReadIWrite: Unit Type Table Format • • • •
40
Table 11. TAM Read/Write: Terminal Library Table Format (for 2702 TLT)
. . . • • • • • . . • • • • • • • • • • • • • • • •
40
Table 12. TAM ReadIWrite: Terminal Control program Format
• • 41
Table 13. TAM Read/Write: Selected Terminal Control Information
Table Entries . . • . • • • • . • • • • • • • • • • • • • • • • • • • 41
Table 14. TAM Read/Write: Channel command Word Generator Section • • 42
Table 15. TAM Read/Write: Channel Command Word Generator Format • • 42
Table 16. TAM Read/Write: Buffer Allocation Flag Bits of CCWG • • • 43
Table 17. TAM Posting: Terminal Length Statistics
• • 61
Table 18. TAM Posting: Specification of User Buffer
• • ••
62
Table 19. TAM Posting: Expected EOL Sequence. •
• • ••
62
Table 20. TAM Posting: CSW Status and Sense Data Typical Maximum Exception Retry Counts (Extracted from CHASDT)
• • • • • • • • 65
Table 21.
Labell Fill Table. • • . • •
77
Table 22. Label 2 Fill Table. • • • • • • • • •
. • 77
Table 23.
Decisions for Setting Block • • • •
• 84
Table 24. Abbrevlations Used in Control Block Descriptions.
• • • 108
Table 25.
Selected helds of the Interrupt Storage Area
.109
Table 26. Selected Fields of a JFCB • • • • •
• • .109
Table 27.
Selected Fields of the DCB Common
• • • 110
Table 28.
Description of the Fields Comprising the VAM Organization Independent Worki ng Star age •
• . • • •
• • • . • • • 111
Table 29.
Field Descriptions for the RESTBL Header -- (CHARHD).
.113
Table 30.
Field Descriptions for the OCB Header -- (CHADHD)
.114
Table 31.
Field Description of the SDST Header -- (CHASOS) .
.115
Table 32.
Field Description of a Member Entry -- (CBASDM)
.115
Table 33.
Field Description of a Data Set Entry -- (CHASDE)
.116
Table 34.
Effect of OPEN Option on Member Interlocks in Member
Header • • • • . . . • • . • . . . • • • • • • • • • • .'. • .
.128
Table 35. Effect of OPEN Options on Data Set Interlocks in SDST
.128
Table 36. Effect of OPEN Option of VISAM Page Level Interlock _
.128
Table 37. Description of DCB Working Storage Used by VSAM Rout.ines .144
Table 38.
FLUSHBlJF Decisions to Control Buffer Allocations . . • • • 151
Table 39. Descri1)tion of DeB Working Storage Used by VISAM Routines 152
Table 40.
Fields and Codes of the DECB Referenced by VISAM Routines
(CHADEB)

Table
Table
Table
Table
Table
Table
Table
Table
Table
Table
Table
Table

viii

41.

42.
43.
44.
45.

46.
47.
48.
49.
50.
51.
52.

•••••••••••••••••••••••

_ •

•

•

•

•

.153

of a VISAM Data Set • • • • • • • • • • • • • 153
VISAM :'age Formats
Super Indexed Sequential Directory .154
VISAM page Formats -- Data or Overflow.
• • • • 154
VISAM Page Formats -- Directory
• .154
POD Fo::-mat . • • • • • • _
• • • •
• .165
POD Member Descriptor . • • •
• .166
POD Allas Descriptor. . • • •
• .161
RESTBL Member Headers (CHAMHD) •
• • • •
.167
Usage of BSAM Modul es • • • • • • • • • .
.....171
Subsection Interface • • • • • • • • • • • • •
• .180
Parameters and Return Codes of BSAM Modules
• • 181
Subroutine Functions • • • • • • • • • • • • ,
• • • • • 182
Organi~ation

CHARTS

Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart

M.

AB.

AC.
AD.
AE.
AF.

AG.
AH.
AI.
AJ.
AK.

AL.
BA.
BB.
BC.
BD.
BE.
CA.
CB.
CC.
CD.
CEo
CF.
DA.
DB.
DC.
Du.
DE.
DF.
EA.
ED.
EG.
ER.
FA.
FB.
FC.
FD.
FE.
FF.
FG.
GA.
GB.
GC.
GD.
GE.
BA.

HB.
HC.
HD.
IA.
lB.
IC.
ID.
IE.
IF.
JA.
JB.
JC.
JD.
KA.
KB.
KC.

Open Comnon - CZ,CLA
BSM Open - CZCWO
OPENTAPE - CZCWT
DAOPEN - CZCWD
Build Common DEB
CZCWB
Build DA DEB - CZCWL
Read Format-3 DSCB - CZCWP
SETDSB - CZCXS
·
MSAM Open - CZCMC
SETUR - CZCMD
TAM Open - CZCYA
lOR Open - CZCSC
BSAM Read/Write - CZCRA
DONSAM - CZCME
MSAM Read/Write
CZCMF
TAl-I Read/Write
CZCYM
IOREQ - CZCSB
SAl-1 Posting f- Error Retry - CZCRP
DA Error Retry
CZCRH
MSAM Posting - CZCMG
TAl-i Posting - CZCZA
lOREQ Posting - CZCSE
BSAM Check
CZCRC
Close Common
CZCLB
SM'i Close - CZCWC
MSAM Finish
CZCMH
MSAM Close
CZCMI
TAt-, Close - CZCYG
lOR Close
CZCSD
Tape Volume Label Processor
CZCWX
Tape Data Set Label Processing - CZCWy
Direct Access Input Label Processor - CZCXN
Direct Access Output Label Processor
CZCXU
Force EOV - CZCLD
·
Mainline EOV- CZCXE
Tape Input EOV Processor
CZCXT
Tape Output IDV
CZCXO
DA Input EOV Processor
CZCXI
DA Output EOV Processor - CZCXD
Concatenation Processor
CZCXX
Note - CZCRN
Point - CZCRM
Backspace - CZCRG
Tape Control
CZCRB
ASCII Translation (, Conversion - CZCWA
GETPOOL
CZCMB
GETBUF
CZCMA
CZCNA
FREEBUF
FREEPOOL - CZCNB
Tape Positioning
CZCWF
Volume Sequence Convert
CZCWV
Message Writer - CZCWM
·
FINDR - CZCRQ
RELFULL
CZCRR
FULREL - CZCRS
MOVEPAGE - CZCOC
VMIER - CZCEI
VDMEP
CZCQK
Search SDST
CZCQE
Insert/Delete Page - CZCOD
INSERT
CZCOF
Expand RI:;STBL - CZCQl

· · · · · · ·· ·· · ·
·

·

·- · · ·

· · ·

. ·
-

· · ··

· · · · · · ··
·
· · · ··
· · ·
··· ·· ·
·
·

-

· · ···

-

·····
····

· ·

-

-

-

-

··

· · ··

· · · ·· ·
·
· · · ·
· ·
-

-

-

-

-

·
·

· · · ·

· · · ·
· · · ·

·
·

·
· · ·· ·· ··

· · · · ·

-

- · · · ·

· ·· ·

· · · · ·

- · · · ··
· · · ·· · · · · · ·

·
· ·

· · ·

· · · ·
····
· · · ·

-

·
· · · ·
·

····
·········
· · ·· · ·· ·
·
· · ··
·
·
··· · ·
· ··
· · · ·
· · · ·· · ·· ·· ·
···
·
-·
·
·
·
·
·
·
·
-· · · · ·
·
-

-

·

· · ··· ·

.····

-

· · ··
· · · · ·

·
·

·
·

·
·

·
· ··· · · · · ·

.200
.202
.206
.208
.210
.211
.212
.213
.214
.216
.221
.222
.223
.227
.237
.2113
.244
.245
.257
.264
.275
.277
.278
.281
.282
.284
.289
.291
.293
.294
.298
.301
.308
.309
.310
.311
.312
.313
.314
.316
.317
.318
.319
.320
.321
.324
.325
.326
.327
.328
.331
.332
.333
.334
.335
.336
.340
.343
.348
.351
.352
.353

ix

Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart

Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart
Chart

x

KD. Request Page - CZCOE
I, see the System Logic Summary PIJ.!j, GC28-2009 and the Resident
supervisor FLM, GY28-2012. This publication describes Terminal Task Control,
the virtual storage routine, analogous
to other access methods routines, Which
initiates multi-terminal tasks (MTT)
and sets up read, write, and polling

I NTROD UC'rI ON

•

Tru~

routines restrict nonprivileged
user programs to accessing data using
the GATE macro instructions, and allow
privil eged programs to access data at
the RI,AD/WRITE macro instruction level.
TAt'1 plocesses sequential data sets that
reside on specif ied communication
terminals.

• 10REQ routines permit the user to
access data, from any device, at the
channel command word (CCW) level. The
user must, however, be pr'ivilegEd to
have access to these IOREQ routines for
unit record equipment.
This section provides an introduction to
the access met hods, t.he us er • sIl'O macro
instructions, the common control blocks,
and contains an overview of BSAM, MSAM,
'rAM, ana IOREQ. Sections 2, 3, 4, eclnd 5
discuss details of the access methoG routines' Open, ~ead/Write, Posting and Close
phases. Section 6 discusses routinE's primarily designed for use with BSAM.
LinKage to the Access Methods rioutines
Problem programs, as well as IBM-writtem
:3yst.em program~~. may. directly or indirectly, use the four access methods (BSAM,
.'1SAM, TAM, and IOREQ), therefore pri vi leged
.l.na nonprivileged programs may link t_o
these access methods. The access routines
are called upon by I/O macro instructions
tnat. are in source programs.
During language processing, the I/O macro inst.ructions are expanded into code that links to
dna passes ~ararr,eters to appropriate access
method routiDe~5. The DCB, DFTRMEi:U, and
JCBD macro instructions do not link to
access methods routines but. compl ete their
function during assembly.
Expansion of the
DCB ana DFTRMENT macro instructions only
build control block tables.
The DcnD macro
instruction inserts a dummy control section
at the place the macro instruction is
encountered.
c'rivileged programs use Type-l linkages
to the privileged access method routines;
nonprivileged programs use tne ENTEh
mechanism.
See IBM System/360 Time Sharinq
System:
Task Mom tor Program LOQic Manual,
GY-28-2041, for an explanation of ENTER.
Section 1:

Introduction

3

8

U,er', I/O
/-J,Qcro

Instruction~

o

Doto
N'tonag ement

I

Read/Write

O""n

o

o~" ]

and/or G .. ,/Put

Reod'Write

Routin ..

o

Task
N\onogel"!'ient

Dote

Routines

t--

]

Cia...
Rout;".

+

1

Task

IY'on~tor

+

and S;Jpe-fvi~or

I--

POlting

Manage",,,,,!

Routine!.

t

(0

0

I/O Slot'"

I

I

!
I
l"terTv!>!

Signel

10RCS

+
Dolo f.en!
Control Block

I

Ch>nn .. 1

I

Not", Numbered bo.... refer to the accorr.ponying d,,
Close Phase:
tion 5.

Details are presented in Sec-

(10) When the user has completed processing his data set he issues a CLOSE macro
instruction.

JFCB
DEB
IORCB

OCB

*DECB

*In MSAM the DEeB is generated at open
time.
Control blocks are generated either in
the user's program area or in the access
method area.
USER'S PROGRAM AREA:
The following control
blocks are generated in the user's program
area.
Data Control Block (OCB):
The OCB is
generated during assembly by a OCB macro
instrUction and serves as a basic communications area for I/O operations.
It is
u.sed to maintain information such as data
set organization, attributes of data set
bUf f er ing information (used in data set
processing>, and addresses of special exit
routines.

Note: When the MSAM user has completed
proceSSing his data group he may issue a
FINISH macro instruction prior to the CLOSE
macro instruction to empty or truncate the
last buffet' and test the result of all outstanding I/O.
This is preferable to simply
issuing CLOSE since the task is permitted
to continue as the I/O operation queue.

Data EVent ContI·ol Block (DECB):
The DECB
is generated during assembly by a HEAD/
WRITE macro instruction (except for ~S~~)
and serves as an I/O status-reference block
for I/O operations.
It is used to s't.ore
information such as:
state of completion
of an I/O operation, type of operation previously issued, csw information, and c~jes
that indicate, to the user program, conditions on ending the I/O operation.

(11) CLOSE calls the close routines
which will reset/release control blocks and
complete data set processing.

ACCESS METHOD AREA:
The following tables
and control blocks are generated in the
access methods area.
Section 1:

Introduction

5

Table

2.

,-

BSAM, MEAl'" TAM, and lORE!,) I/O
Macro Instructions Required for
I/O Operations

Table

."'""T'T---

I Used in I
I Common I

I I/O Macro I

BSAM, MSAM, TAM, and rOREQ

3.

MdCI"t'

Instructions

--------,
I
I

r-------r--------"T ..

-----,--------T---~-l

I
I
I MSAM I

I

,

I

I!

r-------f--------------·-----t

BSAM
TAM
IIOREQi
I---------f-------+------t-----+-----~
I DeB
I READ
I GET
I READ·
I IOREQ I

iOCB

I

I

I
I
I OPEN
I
I CLOSE
I
i
I
I
I
I
I
I
I

I CHECK
I
I GET POOL
I
I GETBUF

!Instruction!

Explanation

jOPF.N

I
I
i
I
I
I
I
I
jRequired to start open phase. I

I
I

llinks to open routines to
lopen the DeB.

I
I
i
I

I
I

IRequired prior to open phase;
Ireserves space in user's
I prog'ram for L'le data control
Iblock (DeB). which is r~sic
icommunication area. for I/O
I operations.

I
I

!
I
1GET/PUT
IRequired to initiate
I
ltransmission of data.
I
! Applicable only to MSAM.
!
!
i READ/WRITE* I Hequired to i fii tiat.E'
I
[transmission of data;
!
I resel·VE,S space fOl the data
I
! event. control block (DECB).

Iwhich contains status of I/O

! op~,rat.ions; 1 inl,s t.o

I read/wri t:e rout.ine::; that.

lCBECK

I
I CLOSE
!

j build CL"WS in the lORCB. and
I causes the commands to be
I
I executed by issuing the lOCAL!
I~)VC.
I
i
I
I Require<.' .mder PSAM. TAM, and I
! lORE/;;! to test I/O opel·ation I
!associated with the DEeD;
I
! waits fOl and checks
I
jcompletion of I/O operations I
Ithat al.e iX:Jsted in the DEeB; I
! for I/O normal completion
I
I returns to problem pro<]ram, I
ifor exception I/O completion I
iexits to the routines
I
I specified in the DCB.
I

!

\Required
iset from
Ilinks to
Icomplete

to disconnect data
user's program;
close routines that
control blocks.

I

I
I
I
I
I
I

IRequi.red if user accesses thel
IOCB fields; it provides the
I
Idummy control section (DSECT)I
i
lwhich contains all symbolic I
I names used to reference
I
in a DCB.
I
r _"...... _______..Ljinformation
____.________________________
jDCBD

I

~

I-Refer to Table 1 for listing of specificl
I HEADrwRI'TE ,Mero instructions.
I
I READ/WRITE macro instructions at
I
I assembly time either generate space for I
I a DECB (5 and L form) or refer to an
I
I existing DECB (E form). MSAM has no
I
IL _________________________________________
READ/WRITE macro.
JI

6

Part I:

Access Method for BSAM

I neBD

I WRITi:

I PUT

I SETUR
I

I

I T,o/R ITE*
i CHEC](
I

I vee.. I

I CHECK I
I
I
IF INISH I DFTRMENT I
I
I
I
I
I
I
!
I
IFREEBUF
I
i
I
I FREEPOOL I
!
I
I NO?£.
I
I
I
I POINT
!
I
I
IBSP
I i i
IFEOV!
I
I
ICNTRL
I
I
I
jCLOSE
I
I
I (TYPE=T) I
I
I
I DQDECB
I
I
I'
t---------..L---------.L----..I.-·- _____ .L ______·~
\*In TAM, only privileged programs may
i
! issue the READ/wRITE macro instructions. I
I Nonprivileged programs issue GATRD/GATWRi
Il-------________
macro instructions.
.____________________ J!

Allocation Table (SDATl.:
The SDAT which is initialized by device
management resides in public virtual
storage and provides information on the
status and characteristics of each allocatable I/O device in the system. The SDAT
contains intormation on the symbolic device
address, model code, device code, device
class and unit type.

~bolic_Device

Job File Control Block (JFCB): The JFCB i;;;
constructed for a data set by the DDEF routine from information in a DDEF command or
macro instruction. The information in the
JFCB is used to complete the DeB during
execution of the OPEN macro instruction.
The JFCB contains information defining the
data set attrihutes, information on where
the data set is located. and pointers to
other JFCBs in the task.
Note: The data set organization must be
specified in the DDEF command for IOREQ.
Data Extent Block (DEB): The DEB is constructed at OPEN time for a given datei set
and serves as a data set reference block
for I/O operations. The DEB is used to
store information such as volume locations,
device and data set attributes. pOinters to
other control blOCKS associated with the
data set. and pointers to DECBs that have
not been checked.

MSAM, TAM and IOREQ

I/O Request Control Block (IORCB):
The
IORCB is constructed at READ/WRITE time and
serves as a control reference block for I/O
operations.
It contains the CCws that control the I/O operation and may contain
either thf' I/O date! buffer, or a pointer tu
the I/O data buffer.
I/O 3tat_istlcal Data Table semhly time.
• Ew>uring that only privileged
use privileged data sets.

~.r<.XJ'£ams

• Checking for conflicts between user
indicated options and control block
dat_a.
BSAM OVERVIEW
bSAM comprises those instructions, control blocks dnd data areas which allow for
limited data set interchange between TSS/
360 and OS/360.
CTSS/360 BSAM will not
support the OS/360 direct access split
cylinder format and will not deblock records provided by OS/360 QSAM.)
Wito tape input. and output, BSAM supports either EBCDIC symbols and the standard IBM label and record formats or the
print symbols and label and record formats
of the American National Standard Institute.
The latter print symbols standard is
officially the American National Standard
Code for Information Interchange X3.4-1968,
and is referred to herein as ASCII.
The
latter label and record formats standard is
officially the American National Standard
l'Jagnetic Tape Labels for Information Interchange, X3.27-1969. and the format is
referred to herein as American National
Standard.
TSS/360 processing is in EBCDIC
and standard IBM format; when the user specifies the ASCII option as a parameter of
the DDEF command, BSAM provides a conversion interface between ASCII and EBCDIC
symbols and American National Standard and
standard IBM formats.
The access methods descriptions presented in this manual do not include the
DDEF command, which performs some preliminary open functions for BSAM.
The Open
Common and Open BSAM routines oversee thE'
completion of the necessary open fUnctions.
The DDEF commana contains such information about the data set as its name, volume
residence, organization, and type of device
Clsed.
The DDEF command causes the building
of the job file control block (JFCB). oversees initial device allocation and mounting
and allocates space for data sets on direct
access storage devices.
By macro instruction, the user will be
linked to the Open Common routine.
This
routine performs those open functions which
are common to all the TSS/360 access
methods.
These functions basically are:

.. \;pt.tinq a page of storage to be used
later for input/o1ltput request control
blocks (IORCBs).
For BSAM, Open Common links to BSAM
Open.
At this point, the JFCB and DCB hdve
been constructed, a data extent block
(DEB), the primary control block used by
the Read/Write routines for such information as the device type, error statistics,
outstanding IORCBs, and the queue of
unchecked I/O requests, is still required.
BSAM open's main function is the building
of this DEB in protected storage so that it
cannot be destroyed or' changed by the user
program.
To build the DEB, linkage is made
to the Build Common DEB routine or to the
Build OA DEB routine; the choice depends on
device type.
DA Open is used to complete open procesSing for direct access devices while Tape
Open is used to complete the open process
for tape.
80th DA Open and Tape Open call
the appropriate label processing routines
to process user and data set labels.
Label
inforrnat.ion such as record length can be
used t.o modify the DCB.
The labeling routines available in BSAM
are 'I'ape Label Processor, which has separate entry points for input header, output
header, input trailer, and output trailer
labels, DA Input User Label Processor, and
D1\ Out. put User Label Processor.
Where ASCII-encoded tapes have been spe··
cified, the &SCII Translation and Conversion routine provides ASCII-ta-EBCDIC translation on tape input and EBCDIC-to-ASCII
translation on tape output.
Four macro instructions are provided to
obtain buffer sF~ce:
GETPOOL, GETBUFF,
FREEPOOL, and FREEBUFF.
Aft.er his data sets have been openec.,
the user will normally access data by me·ins
of a READ or WRITE macro instruction, fOl.lowed (not necessarily immediately) by a
CHECK instruction to ensure compleLe and
correct I/O termination.
The actu?.l ter·Section 1:

of the I/O operatlon ~ill cause an
lnterruptlon, at which point the Supervisor
'011.11 link to the SAM Posting and Error
/-if'try (;;Pl:~R) rout.inE' whien runs wil:h all
lnterruptions dlsabled.
Here the I/O completion code is ~X)st~d into the DECB.
Thi:.;
rout lnE' also performs various l:X)::;t-I/O
functions, such as adjusting magnetic tape
block counts.
In addition, the error retry
routines are incorporat.ed into t.h(~ SPER
rout.ine.
The CHECK macro instruct,ion,
issued by the user at somp point. after his
READ or WRITE., will test the imHeators spt
by SPERo
nund~ion

rOlltlrlt'

the

Anothf'[ tHsic BSAM modul .. ).s the Message
Writpr, whiCh is called by the Open, Closp
,lnti EOV r()ut~inp~; to handle most messages
and con:;olp communication, and do most
ABEND rroc:essing.
See ,-~pct ion 6 of thi,' PLM for routines
';peclfically de:C:lqned fot RSAM_
:,A}l
Communication
Block:
-_.---------,~at lOll block ie' d tdble
---,-,-------~-

For DA output devices at EOV but not end
of data set, the Extend rout).ne is called
to try to get UIDre space on the current
volume.
If and ""hen anot hex' DA output
volume is necess.:u: 'I, Bump is Cd lled to
rroount/clismount 'the next volume and, in
turn, Ext.end is tl...~ed aq'(). in to obtain spac(~
on t,hat volume.
The concatenation routine is used to
link concatenated data sets.

EOV processing is transparent to the
user; when end of volume but: not end of
data set- occur:.::; on input-" outst.anding reads
will be aut:omaticdlly reissued by the Check
routine upell) ret.urn from EOV.

The end of data seL indicator is recoc;nized in the Check routine. dnd linkage is
made to the user' s end of da ta set couti ne.
i f specified.
In addition to Check, several a the:!:' control routines are available and used in
BSAM:
Note, Point, Backspace, Control, and
Force End of Volume.

-~----.~.-.---.-

---~~-

The SAM cOffiIl1uni-

used heavl.ly
Close dOO LOV rOlltine~; for
[' ~Y'2..t_~m Cor:. t rclJ:
l~J.2.S,-kS2-~~ tor a detailed dericription Gt
t;tlis table.
[''i

If the DECB .lnctlcated U!ut eXCE pt.ion,
the Check routine invokes Nainlin.:-, EOV,
which in turn uses Tape Input EOV, Tape
Output EOV. DA InfJUt EOV. or DA Our_put EO\'
to complete EOV processi.ng .for tape or DA
devices.
When End of volume is in fact dn
",nd of data set. condition, processing ..,ill
involve set.ting an end at data set indication in the DCB.
At this point ChecK. is
used to set up linkage to the user's end ot
data set routines if specified.

relpds., unuc;ed st(lrag(' unIes"
dirpcts otherwise.

"'111

u~pr

~:i'1l'1

,~red

Op~n,

1'15/1..."1 OV ERV I E\chanism for simultaneously driving S'2veral card readers. card punches, and prtnt.ers
under t.he control of a single user's task.
Several dat.a sets may be grouped together
on anyone device, allowing the user to
process all of t.hem under the same Dat.a
Cont.rol Block wi thout openinq and clo..sing
t.he LeR each time i! data set ..,jt.h different
characteristics is to be processed.
Each
at the ~eparate data sets ~s referred to as
a dz.t...a group.
Input dat.a groups may he
sepClrat:ed by control cards which consist cf
invalid EBCDIC characters in the first four
columnc~ and as many valid EBCDIC chat·actey.',,;
as required tor cont.rol purposes.
l",s}V.j
will recogniz~ these control cards and
notify the user that a control card has
be'''n read, allowinq him to takE' whatever
d(>Lion is necessary.
Output_ dat.a group::~ "'Jt1
the card punch may be separated with special cards from the reader by specifyinq
the COMBIN opt ion in the DC8 macrOlnst_T'U;tion, or t:hey may be removed from the rcader by the operator, who IDay be instructed
to do so when a FINISH macro instruction is
(~BAM)

i,~sued,

MSAM differs from other sequential
access methods in that each MSAM I/O requ--

To close his files, the user employs the
CLOSE macro instruction which will link to

Close COlIUDOn.
This routine resets fields
~n the DCB filled in by the access methods.
For nonshared data sets, i t does the necessary recataloging for volume extents.
Close Common ..,il1 link to SAM Close.
EOV is called to complete closing output
tape or DA data sets.
The Tape Output EOV
routine will in turn utilize the label
handling routines after it waits for outstanding I/O to quiesce.
The SAM Close
8

Part I:

est of the system process~s a buffer group
of logical records, while each request
issued by the other sequential access
methods pror:esses only a singl., physical
record.
Physical rpcords are buffered ~y
pages of virtual !'".toraqe.
MSAM p::ocesses a
number of buffer pages based on an
installation-provided parameter which i~
set in the symbolic device allocation table
(SDAT), and ..,hich may vary for each device.
Its value may be adjusted to provide optimum device utilization when the number of
records ..,hich can be contained on N pages

Access Method for BSAM, MSAM, TAM and IOREQ

will drive the device full speed for the
maximum length of time bet ...'een the two consecutive time sl~ces.
The first 32 byter; of each buffer page
are reserved for control information used
by MSAM.
The remaining portl.on of the page
is packed with format-F or format-V logical
records.
Format-F logical records are
packed in the buffer starting with the 33rd
byte in the bufter.
Format-V logical records are packed in the buffer starting with
the 37th byte in the buffer, since four
bytes must be reserved as control bytes
(LLBB) , as is the case with blocked,
variable-length records.
Tbe nu!Ilber of rf'coras pE,r buffer page is
restricted to a maximum of 100 on input and
200 on output.
Depending on the size of
the records, there may be fewer.
The size of an input buffer will be computed by adding to the 32 control bytes the
smaller product of (a) 100 times the logical record length, or (b) multiplying by t.he
logical record length the integral part of
the result of dividing 4064 by the logical
record l~ngth.
The size of an output buffer will be
regUlated by the following rules.
1.

For fixed-length records, the number
of bytes used for data will be the
lower of (a) 200 times the logical
record length, or (b) the product of
multiplying by the logical record
length the integral part of the resul t
of dividing 4064 by ~he logical recora
length.

2.

For variable-length records, the last
record will have been placed in the
buffer when (a) the record count
reaches 200, or (b) the sum of the
user-provided control bytes (LL) of
each record in the buffer plus the
next expected logical record length
plus four is greater than 4064.

3.

The buffer will be ended when form
type-F is mounted on a printer, and a
FORTRAN!. control character is found
indicating a skip to channell.

Schematic Description
The user's problem program initializes
for an MSAM I/O operation by defining a
data control block with the DCB macro
1.Control characters defined by American
National Standard FORTR~, ANSI X3.9 1966, hereinafter referred to as FORTRAN
control characters (previously known as
ASA or USASI control characters).

instruction, which generates a COllUl1on fX)"·t.ion and an MSAM portion of the DCB. The
user then issues an OPEN macro instruction
which links to the Open Common routine.
Open Common completes thp common port Lon
of the DCB f rom the TDT JFCI3, and then
invokes MSAM Open to build a DEB and provide N buffer pages (where N is a constant
in the SDAT set at system generation time).
MSAM Open also provides N half-pages for
IORCBs and a DBP page, which is used 3S a
work area by MSAM Read/Write and DOM.SAM.
A
DEB work page is also obtained to use as d
save area for DOMSAM and to hold the N+l
DECBs.
MSAM Open formats N IORCBs dnd N
DECBs, and it checks the SDA'f and tne DCB
for agreement and for valid options.
To set up online output devices, the
user may issue a SETUP macro instruction.
In t_he case of a print file, the SETUR routine may read the two system VIP data sets,
SYSURS and SYSUCS, to obtain the parameters
m?cessary for setting Ill' the printer.
SETUR \oIill issue WTO macro instructions and
pOSsibly IOCAL SVCs to the I/O supervisor
to achieve the desired setup of the device.
The User issues a GET macro instruction
to obtain each card read from the card
reader.
Each GET macro i nst.ructi on invoke,.;
the DOMSAM rout.ine via type-l linkage.
If
there are any records already in the buffer, DOMSAM passes the next sequential record to the user.
If the buffer is empty. or
if all the records in the buffer have
already been processed, DOMSAM invokes MSAM
Read/Write.
The user issues a PUT macro instruction
to print each line on the on-line printer
or punch each card on the on-line punch.
Each PUT will cause a record to be placeci
in a succeedinG location of a buffer page.
DOMSAM kee[£ account of these records to
determl.ne when the last record has been
placed in the buffer.
At that time, it
invokes MSAM Read/Write.
The t-ISAM Read/Writf" routine build~~ an
lORCS and invokes the I/O Supervl.sor {lOS)
via an lOCAL SVC.
Each IORCB contains a
list of CCWs for each record to be read or
Each record read has a read cei,
writt.en.
and a distinct feed, stacker select ccw
associated with it.
Each record written
has essentially one CCW associated with it,
for example, a punch, feed, select stacker
ccw, or a print and space cew. Additional
control CCWs may be generated by MSAM at
the beginning of t_he CCW list, such as sKip
to channel 1 on the printer.
The IORCBs
specify command and .lORCB chaining and provide the address of the MSAM Posting
routine.
Sect.ion 1:

Introduction

9

When the CCWs in an IORCB complete their
execution, the currently running task program is interrupted, and MSAM Posting is
given control from task monitor so that the
necessary information may be stored in the
DEB and in the DECR to inform DOMS~ of the
I/O progress.
If an I/O error has
occurred, Posting will attempt the error
retry procedures.
It intervention is required by the
operator, Posting will record, in the DEB
page, information about the IORCB returned
by lOS in the ISA, and specify to the task
monitor an asynchronous interruption routine to be given control when the device is
transf~'rred from the not-ready state to the
r~ady state.
A WTO macro instruction is
is,:ued indi.cating the required action, and
control is returned to the task monitor,
which returns contxol to t.he routine which
was ~nterrupted for the posting operation.
The asynchronous routine is part of the
MSAM Post.lng routine, but it has a separate
entry point. When given control, it will
reissue. from the point of failure, the
CCWs in the IORCE which was posted by MSAM
Posting.
By testing the return code from his GET
or PDT macro instruction, the user can
determine whether or nol'.: his operation has
been complet.ed.
Before reissuing his
incomplet.e GET or PUT, he is free to do
ot.her processing.
Prior to reissuing a GET
which returned an i.ncomplete,the user
should test the DECB pointed to by OCBCDE
for completion; prior to reissuing a PUT
which provides an incomplete return the
user should test the DECB pointed to by
DCBTDE for completion.
If these DECBs are
not_ complete and no further processing can
be performed, the user mdy' execute t_he
AWAIT SVC in the DECB pointed t.o by DCBCDE
or DCBTDE.

When the processing for the current data
qroup is completed, the user may issue the
l"INISH macro instruction, which will invoke
thE' MSAM Finish routine.
On output, this
routine will initiate type-l linkage to
OOMSAM, which may in turn invoke MShM Readl
Write for writing the last l:mffelC on an
output data group, and it will test the
results of the write.
It will \,Mit for
completion of all outstanding I/O requests
for an input_ data group.
Then i t wi 11
r,ot_i fy the op€'rator to r€'movE' the input or
out:pllt da ta group from the device by a WTO.
unless the user has indicated that such
messages are to be suppressed.
If the operator has been requested to
respond to the message by readying the
deVice, the Finish routine notifies the
task monitor to recognize an interruption
whpn the affected device is changed from
the not-ready to ready state. This inter10

Part I:

ruption will give control to the Finish
routine at its second entry point.
The
next time the Finish macro instruction is
issued after this interruption i.s received,
a return code other than incompletE' 1S
returned by the Finish routine to the user.
When no more data groups are to be processed by the task. on the device at the
present time, the CL<~3E macro instruct ion
is issued. The Close Common routine is
invoked and clears all fields of the DCB
completed by Open Common.
It the0 inVOKes
MSAM Close, which issues a FINISH macro
instruction, waits for completion, dnd
releases the storage areas obtained by MSAM
Open.

Tables 4, 5. 6. and 7 contain fields
and/or flags used by MSAM which are frequently mentioned in the sections of this
publication devoted to MS1IJ.1.

RTAM OVERVIEW
ActiVation of a terminal will cause an
asynchronous interrupt.ion to be generated.
The interruption will be fielded by the I/O
Int.erruption Stacker routine in the resident supervisor and placed on the channel
interruption processor queue.
The Channel
Interruption Processor determines that this
is a terminal I/O interruption and passcci
it to the Terminal COl1lJT!unications Subprccessor. which is also resident.
This terminal control is all taking
place in the resident. supervisor, as the
RTAM abbreviation suggests.
For details cr
an overview of t_he RTAM access method, S("','
the Resident Supervisor PLM. GY28-2012 or
the System IJQgic Summa~~!,!, GC28-20'H.
The Terminal 'I'ask Control routine, wbS_c!:
describes internals for some of the l<'TT
user commands and macros, is described in
this PLM.

Privileged programs are the only ones
that may issue READ/WRITE rndcro instructions to directly call TAM Read/Write.
Nonprivileged programs may only use the
GATE 1/0 macro instructions that call an
intermediate system's GATE rout.ine that in
turn calls TAM routines.
The COIrliT[iind system also invokes those GATE routines that
link to TAM.
All programs that use TAM
routines either by a direct call or by thD
intermediate system's GATE routine are
restricted in that they may only be userl
with specific communication terminals.

Access Method for BSAM. MSAM, TAM and IOREQ

4.

Table

DCB Table Fields and Flags (MSAM
Section>

r--~-----T------T---------------------------------------,

I rl~ld I flag ( M e a n i n g
I
~--------+------+--------------------------------------~
I[,CRINHMSIOCI'INHllnhiblt mesnaq .. to operator to rell10ve
I
I data 'lx-aup

!

I

I

I

I

I

I
I

[,('\-lCO""]I [l<:BCt-!IlICombin~ d rpader on ''',.,,' 25~O as punch I
I
I
!
I [)cBler
I
I Address of ICB named in SIR «() = none) I

IDCBLRC

I
(Maximum allowable logical record length I
!
I
IAddress of current logical record in
I

J

Ibuffer tor input records, or next
lavailable buffer locatiOn for output
I records

I

I

i

iDCBLXMA:q

I

I

I DCREAP

I
I

I Address nf end of cuterent buffer

I

jDCBPPT

I

I~CB~CX

Ilntprnal return code

I

I

I DCBCNT
i
I:JCSCDE

I

I

I

Some DECB Table Fields (CHADEC)

I

Fleld

I Flag I

Meaning

I

~------------+------+---------------------.-~

IDECECB
IDECECOli«'"d/Write requt"cH
I(compll'tion I
In"!,,
I code)
I
I

I
I

t

I

IDECECIINormdl Completion
I!
IDECEC21Complete with error

I

I
I

I

I

IDECEC31Intercepted

I

I
I
I

I
I
I DECEC4 I 'I'lai t
I
I
I
I

!Data area length

I

IDECCSW
status word JI
l ____________ I ______ LiChannel
_____________________
~

ILogicdl record count
IAddress of current PECR

!DCBFDE

IAddr~ss

of first

I

I
! Address
I

of last PECB in 1 ist

i DCBLDE
I
!DCBTDE

DECS 1n list

Table

I

I

I DCBUDE

IAddress of user' s copy of errinq OECB

I
I
I DCBFRMTP t
I
I
I DCBSTRI¥ I
I
I

I
I SYSURS for", type for printing
I
lues str Ike out code
I

IDCBMSFl

IDCBEOPIEnd-of-buffer processing needed

i

I

\ (MSAM
I flags!

IDCB1OCIRead/Write already invoked

FieldS

i DEBlOC

I
t

IDEBNF

I Flag I

Meaning

i

t
I
I

I Number of outstanding I
IIORCBs
I
I

IDEBNFljUnrecoverable I/O
I
I error

I
I
I
I
I
IDEBNF21Permanent I/O error
I
I
I
I DEBCLS
I
I Storage protection
Il ____________ LI _____ LIclass
of DCB
_____________________
JI

I
I

IDCBENTlbuffe~

Some DEB Table Fields

~------------+------t---------------------~

I

I
!

7.

r-----------T------T---------------------,

IAddress of DECB to be tested for
Icompletion on a PUT

I
I

I

6.

r--·-~------T------T---------------------l

I DECLEN
i

{Address of current buffer page

;

Table

priming to be performed

t
1
t DCBOVF I Format F new print page
I
I

\DCBELPILdst PUT issued was in locate mode

I

I

I

I

IDCBNLPIPrpvious locate mode PUT being
I
lprocessed

I

iDCBMSF2 IDCBPURIPurge all I/O at
i (MSAM
i flags)
i
I

I

I

I

CLOS~

I

IDCBSURISETUR in process

I
I
I
I
I DCBFIN I FINISH lust issued
I
I
IDCBFIPIFINISH In progress

i
I
t
Il ________ LIDCBPT
Gc~ or PUT on a data group
i
______ tFirst
_______________________________________
~

Table

5.

~

Some DBP Table Fields

r----------T-----------------------------I
Field I
Meaning
r---------t----------------------------"-

I DBPPRTRY I Printer retry counter
I
I
I DBPPRDC I Printer data check counter
I
DBPFRMTP I SYSURS form type code
I
DEPFOL0 I SYSURS UCS folding code
I
\l __________
DBPSTRK2 LI ______________________________
SYS~RS ucs strike out code
JI

During execution the OPEN macro instruction provides linkage to the Open Common
routine.
Open Common locates the corresponding JFCB for the dat.a set. Open Common
links to Thll Open to cont.inue special open
functions, and then TAM OpEn returns to
Open Common which sets bits in the DCB and
the JFCB to say that the DCB is open. A
counter in the JFCB is updated to indica1:'"
the number of DeBs that are open.
During TAM Open, one page of storage is
allocated a!".d pointers are set up between
this page and other control blocks. Part
of this page is reserved for t.he DEB, which
is partially completed during TAM open with
t.erminal information thi'lt was stored in the
the symbolic device allocation table


TAM Open.

MSAM Open (CZCH.':::) -- MSAM Open.
Open VAM

The Oppn Common routine, callpd by the
OPEN macro instruction, periornlS those open
functions common to all access methotis:
.. It cheCKS for [X:B error conditions, and
ABENDs if any exist.
"

It: u,,;es the GETM}\IN macro instruction
to iv;quixE' a o!H?~paqe work area, and
pass~,s the address of the work area as
part Gf a parameter list when it links
tottle access-'dependent ope.,n routines.

" It places the open options in the DeB
for reference by the access-dependent
open routines.

(CZCOA)

VAM Open.

lOR Open (CZCSC)

lOR Open.

VMA (CZCGA) -- Get virtual storage.
Addcat (CZCFA) -- Cataloqs all VAM data
sets.

Search SDST (CZCQE) -- Search shared data
set table.
Readrwrite (CZCPE) -- Index sequential
read/write.
Exits:
Normal -- Return to

c~lling

program.

Error -- ABEND macro inst.ruct_ion.

'* If

it. iSSUf]$ a. 0111 to
FINuJFCB to
ind the ,}FCB ds"ociat.ed
with t_he dat:;; definition f1aJne (ddname)
of t~hp DC'E ..
nece:;s

.. It fl.l1s

fit=:lds

in ct-?:rtdin d(:!.taultf',d

t_rclck of the DCB fields so modifIed, so
that at CI.t0SE t itn(-: tbe
z.~f:;s-tored

.i~:~:

t,o

I)c~J

r)~'e-OP£N

can bt:

:[~t.",'itus

..

ons common
to all d<;:cess methods
OF,en Cc,mrnon automattcally cat,)loqs all VAM data sets.
JI

/~c·mr[ic'n

the apprcpr-ia-te
:t(;,ut.~ine f
"( :-1cc·~~ss->d€'f_·~'nden-t r.)pl;~n F'loce<":i~".u~g
(Chdrt_ "A).
Open

links

0

resident ,in virt.:ual
• rea~-only. privileged rou-

Reentran~-:

1

tine, public.
En~E'y~_Poir~-~_~

C:ZCL\O

~~ ~

Eni'eI~,::-.d

t;y

lpe -rl

or type-2 linkage.
,:!:..~et,:
tJ.''''~

v~c~s

01

RE:qist.er 1 contai

the addrp"", of
(the gent:'ral seI-macro table). built by the expansion

CHl''I.(~~~~l''';

t~jblp~

Open Common provides DCB
addressability and checks for valid OCB

identifier and nonzero ddname.
If an error.
condition exists, the task will }'I.BEND •

L~B

int<.:t'mati.on from the corre~N
tie1.d~< 1.;) -the JF'CD..
lL keeps

'<#~ith

~;pon
This routine performs opening funct.ions
common to sequential access methods. It
branches to the Open Tape or Open DA routines to have the open processing completed
tor magnetic tape or direct access devices
respectively (Chart AB).
Attributes: Reentrant, resident in virtual
storage, closed, privileged.
Entry Point: CZCWOl -- Entered only by
type-1 linkage.
Input: When this routine is entered,
register 1 contains the address of the following three word parameter list:
Word 1

Address of DCB being opened.

Word 2

Address of associated JFCB.

Word 3
Address of work area for bui.lding
IORCBS.
The PSECT of CZCWO contains the SAM communication block (CHASCB), three temporary
control blocks - a DCB, a DEB and a DECB
which are used by the label processors for
reading or writing tape labels, and a parameter area for reading and writing format-l
DSCBs.
Data References:
CHATDT, CHADEC.

CHAnCB, CRAnEB, CHASCB,

Operation:
The SM-I Open Mainline routi ne
initializes the SAM communication block
(CHASCB).
If a DCB is currently opened on
the JFCB, the task is abnormally terminated. Open opt ions are checked against
the JFCB disposition parameter to see if a
data set with a disposition of NEW is
opened for input.
If it is, and the task
is nonconversational, the task is abnormally terminated; for conversational mode
tasks. the routine gives the user a warning
and the option to continue.
SAM Open checks to make sure that the
data set has a mounted volume, and that the
proper volume is mounted. The routine also
checks to make sure no reading will be performed on output data sets, or writing on
input data sets.
The main function performed by SAM Open
is the building of the data extent block in
privileged storage so that it cannot be
destroyed or changed by the user program.
If the device assigned to the data set
is a magnetic tape or direct access device,
control is given to Tape Open or DA Open
respectively. These routines. in turn,
call the proper DEB building routine.
If Tape Open or DA Open had been given
control, any storage dynamically obtained
by either routine is released by calling
FREEMAIN. and normal ret.urn is made to the
Uf:er.

Whenever Tape Open or DA open encounters
errors, it posts an abnormal condition code
in t.he SCB and terminates via ABEND.

Tape Open (CZCWT1) -- Open tape.

In case an end-of-volume condition
occurs while Tape Open is writing the header, SAM Mainline will call Mainline EOV to
end the present tape with an EOV trailer
label and write the header on a new tape.

Mainline EOV (CZCXE1) -- Write EOV trailer
and header labels when EOV encountered
during header label processing.

The block size of ASCII format tapes is
checked for minimum (18 bytes) and maximum
(2048 bytes) length.

Modules Called:
DA Open (CZCWDl) -- Open direct access.

Section 2:

OPEN Processing

15

QOPEN is bypassed if neither GET nor PUT
is indicated in the macro field of the DCB.
If the data ~~t being opened is 6 QSAM data
spt, then <,.lOPEN, a tlPC1"_ion of ~AM Oppn
Mainline, is enteled to perform thoet' functions unique to a QSAM data set.
If
blocked records were indicated 1.0 the DCB
and the blocKsize is zero, an ABEND exit is
taken.
Otherwise, the block size is set
equal to the maximum logical record length.
Then, the number of buffers to be obtained
for the data set must be determined.
If
the data set is opened for UPDATE, and
CNTRL is specified in thE DeB, only one
buffer is needed.
If t.he data set is
opened for ROBACK, and if the record format
is variable, three buffers must be
obtained.
Otherwise, tvo buffers must be
obt~ained.
The storage for buffers is
obtained by issuing a GETMAIN macro
instruction which returns the address of
the ar'ea obtained in register 1.
'I'his
address is saved in the DCB.
If two or
three buffers are needed, t.heir addresses
are calculated and stored in the OCB.
The
protection class of the area will be the
same as that of the DeB.
F'or data sets
USing only one buffer, the DCB field indicating the maximum number of reads or
wri t.es which may be done before a check is
set to one, and for all others i t is set to
two.
Then the sa.me procedure described
arove is followed to obtain storage for
QSAM' 5 QWl< 'oini~ing to the DCB and a full word pointing to the TnT JFCB.
MSAM Open ac!cesses
these two addresses, and obtains the
address of the SDA'!' from t.he TDT.
If a DeB
tid:"; been opened previously for this data
set. the task is abnormally terminated
unless i.t is a remote job entry (RJE) task.
If .i t is RJE, the task is abno.rmally terminated if more than one previous DCE has
been opened.
(The JFCB indicates a previously opf'~ed DeB.)
There are two tables (TEDDiE and TBDD2B)
in MSAM Open for each of the device dependent parameter fields in the DCB. These
tables contain the allowable parameters and
the default parameters for the particular
device dependent fields.
If the value of a
device dependent: field does not match any
of the allowable parameters, the default
parameter is stored in the field. Checks
are made on fields of the DCB and SDAT for
valid options and comb.inat_ions of options.
Any invalid condit.ion causes abnormal termination of the task with the appropriate
message displayed on SYSOUT via the ABEND
mac.ro instruction.
The value of N, the maxilnum number of
allowable IORCBS. is obtained from the SDAT
and il check. is made to determine the
s;~orage protection class of the DCB.
If
the DCB is Class A (user read-write), a
GE1'~~IN macro instruction is issued to
obtain (N+3)/2 contiguous pages of Class B
(user read-only) virtual storage. These
pages will be used for the DEB page and the
(N+l)/2 IORCB pages which cannot be of
Class A storage.
(See Figure 2 and Figure
3.) A pointer to the first page obtained
20

Part!:

DEB Page Layout

o r-------------------..-- -------------,
!
Save Area (19 words)
!
76~-------------------------------------i

I

96
Ope!at!.~:

2.

DOMSAM work area (5 words)

I

t-------------------------------·-·---1

I
N+l DECBs
Il _____________________________________
(48 bytes in length. each)
J

Figure

3.

I

DEB Work Page Layout

is st~ored in the DCB.
A second GETMAIN is
then issued to obtain 1'1+1 contiguous pages

of Class A virtual storage for the DEB work
page and t:he N buffer p.:iqes smich must be
of the same protection class as t.he DCB.
If lche DeB is Class B (user read-only)
or Class C (user inaccessibl",,). a single
GETMAIN is issued for (3N+~}/2 contiguous
pages of virtual storage of the same protection class as the DCB. In both cases the
same number of pages are obtained, a1 though
in the first case the two groups of pages
will not. necessarily be contiguous. Except
for the case where the DEB and IORCB pagE's
cannot be Class A, all pages obtained are
of t.he same class as the OCB.

Fields in the DEB may now be init.ialized, and pointers set to the other control t:dDles.
FO.l an RJE task., DEB poi.nters
in the TDT JFCB are enchained if a previous
DEB has been created during the task. A
skeleton ICB is built to specify an
attention-type interruption, with pointers
to the DCB and associated communication
area. The fixed area of an lORCB is built,
and additional fields in the DEB page are
initialized for use by the other MSAM
modules.
If RJE, flags are set in the
IORCB and the DEB.
C

Next, N skeleton DECBs are built in the
DEB work page following the 19 word save
area of DOMSAM, and a ~JOinter to the first
DECB is set into the DCB.
To initialize

Access Method for BSAM, MSAM, TAM and IOREQ

for looping. the DCB pointer to the current
DECB is initialized to the address of the
first DECB.
For fixed record format, the number of
logical records in the buffer is then computed as the buffer size divided by the
logical record length, where the buffer
size is equal to 4096 minus the number of
control bytes (currently 32). If this
count of logical records is greater than
100 on input, it is set to 100, and if i
is greater than 200 on output. i t is set to
200.
For variable record format., th_ nu. L
er of logical records in the b\lffer is
initialized at zero.
If RJE. logical record size is stored in the DEB work page
area.
The following fields are calculated
dnd saved:
the maximum record count for
RJE PUT (4048/ U.RECL+2+1S) }/2.2i the maximum record count. for the RJE first PUT of
the first IORCB with machine control characters (4040/(LRECL+2+1S»/2.2; and the
maximum size of the PUT logical record
(LRECL+l+lS)/S.8.
After calculation of
logical record size and count limit, a loop
is performed to initialize N skeleton
DEeBs.

Now the N IORCBs are initialized in
their half pages. The fixed area of the
first IORCB (at the beginning of the first
full page beyond the DEB page) is built.
Since each of the other N-l IORCBs is to be
built in the same manner as the first, the
fixed area of the first IORCB is moved to
these other N-l IORCBs, which are located
at successive half-page boundaries following the first IORCB.
Next, the fields in the MSAM portion of
the DeB are initialized.
The DeB pointers
to the last, the current, and the user's
DECBs are set, and the fields indicating
the number of logical records and the
return code are both set to zero.
A flag
is set in the DeB to indicate that the next
GET or PUT issued will be the first on this
data group.
The DeB macro field is then tested.
If
it specifies PUT, the OOMSAM PUT VCON and
RCON are set into their respective fields
in the DCB, and unused VCONs in the DCb dr e
set to full words of hexadecimal .Fs. I :
the records are fixed length, the address
of the current logical record is computed
as the beginning-of-buffer address plus the
number of control bytes.
If the records
are variable length, a test is made for an
RJE task.
If RJE, the address ot the current logical record is set to the
beginning-ot-buffer address plus the number
of control bytes plus 9.
If not RJE, it is
set to the beginning-of-buffer address plus
the number of control bytes plus 4, and the
block control bytes (LLBB) are initialized
to X'OOOq'C'bb'.

I i the DeB nBC!"

field

sr.el~ifl.€D (;l:.-i',

the OOMSAM GET \iCDN ilnd RCON are ~"'t

L,t-.o

thel.r respective fields in the DCi],. and
unused VCONs are Si\:'t to full words of hexo-·
decimal Fs.
Control is ·t.he;. retu;::ned t.o
There is no return coot',

O~Jt;n

Common.

The Set. Unit Re::0rd (SE:l'URJ _1:1:>1.:,\: i He spe·cities the unit record configul:·ation h)r a
local or remote printer or a card punch.
It is called as the result of a userinitiated SETUR maero instruction, indicat'"
lng how a device is to be set up tor a job.
If the device is not already co:ccectly set
up, the SETUR routine requests an 0pEl:atol;to set the device as specified by the Olden,
and sends the user return codes indicating
the results.
(See Chart AJ.)
Attributes:
Privileged, reen\:rar.t_, Lead-only. public, system, nonrEccursive,
E:ntry Points:
CZCMDI -- Primary entry point er.tel:ed.dU:.
type-lor type-2 linkage.
CZCMD2 -- Asynchronous entry pOint entered
with type-2 linkage.
CZCMD3 -- Synchronous entry point entered
with type--l linkage.
Input:
For entry at CZCMD1. register 0 contains
the address of the unit record device
setup parameter and register 1 contains
the DCB address.
For entry at CZCMD2, register 1 contains
the ICB address.
For entry at CZCMD3, the ISA contilins the
lORCB.
Odt.. d_References:
CHADCB. CBASDA. CilADEB.
CHAIOR. CHAICB. CHAISA, CHADBP.

Modules Cd lIed:
Woro

SIR

(CZABQ)-::--= W.t:i te message to 0p!2~atoI 0,;
console typewriter.
(CZCJS)

Specify

inter~uption

routine.
DIR

(CZCJD)

-- Delete internlption rO'ltine.

Open (CZCLA)

Open a data control block.

Find (CZCOJ)
data set.

Find a member of a VPAl1

Read (CZCPE)

.-- Read a VIS AM record.

Section 2:

OPEN Processing

21

Close (CZCLB) -- Close a data control
block..
ReSet (CEAAH) -- Reenable a device after
I/O error.
Exits:
Normal --. For ret.urn from CZCMDl reg i ster
15 contains one of the following c::>des:
"00 II

completed successfully.

'04"

Incomplete.

'OS'

Unrecoverable I/O error.

'oc'

Bad parameter for s'tsuru:, k.ey.

'10'

Invalid SYSUCS k.ey specified
by SYSURS.

'14'

Intervention required on RJE
devicE'.

For retnrn fron; CZCMD2 or CZCMD3 register 1S contains • 00' •
Error
Abnormal termination via the ABEND
macro inst.ruction.
The operation at the three
ent.ry points is:

Q2~rati_on:

~~IN~J3L_b.:LSZ~~I?.1:

SETU'i{ abnormally
t.ermindt.~'s it the DEB or DeB is invalid, or
if the DeB has not been opened.

Sirv::e t.he S.ITUR. ;'{I3CrO instruction is
issued repetively
the user until he
receives a ret:urn code other thdn .. (incomplete), the SE'I'UR routine must determine
condit.ions existing each time it is
invoked.
The internal return code in
DCBBCX. in combination with t.he SETUR-inprc;,gress switch (DCBSUR). detennines the
line ot processing to be followed upon
entry. DCBSUR is set on when SETUR is
fir'st called for a device; i t is set off
when SETUR has completed its proceSSing, or
when the invoking routine wishes to notify
SETUR to stDP its proceSSing when it is
next qiven control. Processing for the
various DCBSUR. DCBRCX cow~inations is as
follows:
,DCBS{~R 0:tL~DCBRC)Ll:es?

than lO_Q.: I f the
device is other than a card punch or a
~r.inter (or, if an R.}E task, other than a
> ru;ter).
SETUR exits to the caller with a
:,·'tuxn code of normal completion.
Fer. a car_9__I'...UPch:
(DCBSUR off, OCBRCX
less than 100).
If the setup parameter
card form number is the same as the SDAT
form number, normal ending procedures are
followed.
The return code is set for normal completion, OCBSUR is set off, and control returns to the calling routine.
22

Part I:

If the numbers are not equal, a message
is sent to the operator via WTO requesting
him to mount the desired form, CZCM02 is
specified as the asynchronous entry point.
and SETUR returns to the caller with a
return code for incomplete while opprator
response is awaited.
For a printer (or, if RJE, remot .. printer);
(DCBSUR c,ff, DCBRCX less than 100).
lithe setup parameter key is the same as
the SOAT URS key, the desired confiquration
is already set, so normal ending procedures
are followed as with the card punch.
Otherwise, the DCB for the VPAM'iata set
containing the member $SYSURS is opened,
and the four-line SYSURS record is read
according to tne key given in the setup
parameter.
If an error occurs on a READ,
SETUR saves the error information in the
MSAM DCB, closes the SYSURS file. turns
OCBSUR off, and exits to the caller with a
return code indicating either "invalid SYSURS key· or ·unrecoverable error-. When
the SYSURS record has been read successfully, the SYSURS DCB is closed and checks are
made for appropriate printing specifications and valid SYSURS parameters.
SETUR
abnormally terminates if the conditions
checked for are not met.
SETUR now checks that the required print
form, carriage t.ape, print chain/train and
density are now being used. If any of these
need to be changed, an appropriate message
is sent to the operator via the WTO macro
instruction, or, if an RJE Task. to the remote operator via an lOCAL macro instruction, after buildin9 a special lOReB.
CZCMD2 is specified as the asynchronous entry point by a SIR macro instrllction unlesf;
the task is RJE, in which case t:his entry
point ..,ill have been specified as part of
BULKIO initialization.
SETUR returns an
'incomplete' indication while local or remote operator response is awaited.
If no such changes are necessary. the
SYSURS form type value is saved in the DCB,
and SETUR tests for use of the Universal
Character Set (UCS) feature.
For ues printing, SETUR abnormally t,erI'Itinat.es if the folding code is invalid. If
the SDAT and SYSURS values for the IJCS Key
do not match, the DCB for the VPAM data set
containing the VIP member $SYSUCS is
opened, and the 5-1ine SYSOCS record 1s
READ according to the key given in SYSURS.
If no error occurred on the read operations, the SYSUCS DCB is closed, an IORCB
is built to load the UCS buffer and is
executed with CZCMD3 specified as its posting entry point. SETUR then exits to the
caller with a return code for incomplete.
If an error occurred when reading the SYSues record. the sysues file is closed,

Access Method for BSAM, MSAM, TAM and IOREQ

OCBSUR is set off, and SETUR returns to the
caller with d return code for an invalid
SYSUCS key or data set. VAM error return
information may be found in t.he MSAM DeB.
If the SDAT and SYSURS valu"'!', for the
UC:; K"Y Hldtch, the UC, buffer dOf>f; not helve
to be loaded.
If t.he ues s1'rik(out.

character is to be used, it is tested for
validity (ABEND results if 1 t i". lnvalid)
and converted and saved in the DeB. The
SYSURS folding code is saved in the SDAT,
and SETUR proceeds tc; test for printer alignment (see below).
If the ues feature is not in use, loading
the ues buffer is not necessary, so testing
for print alignment occurs immediately.
If print alignment is necessary (unless
an RJE task), an IOReB specifying CZCMD3 as
its posting entry point is built to print
50 lines on the printer for purposes of
alignment.
A message is sent to the operat.or via 'rITO requesting him to align the
printer, and SETUR returns an incomplete
while operator response is awaited.
CZCMD2
is specified as the asynchronous entry
point.
If no alignment is necessary, or if the
task is RJE (in which case alignment is not
possible). processing is completed. The
URS key from the setup parameter is stored
in SDAT, DCBSUR is set off, any active
interruption is deleted, (not necessary if
the task is RJE), and control returns to
the caller with the return code in register
15 set to ·completed successfully· or ·completed with unrecoverable I/O error.DCBSUR on. DCBRCX not in the range 100
through 136: SETUR abnormally terminates
when this invalid condition occurs.
OCBSUR on, DCBRCX = 100: ~he operator has
not yet mounted the requ('sted form on the
card punch.
Until he do('s, control is
returned to the caller with a return code
for incomplete,
OCBSUR on, DCBRCX
104: The operator has
mounted the specified form OIl the card
punch as requested.
The punch form number
from the setup parameter is therefore moved
into the corresponding field in the SDAT,
and normal ending procedures (see above)
are followed.
:0

DCBSUR on, DCBRCX = 108:
The operator has
not yet mounted or set the SYSURS-specified
form, carriage tape, chain/train or density
on the printer as requested.
Control
returns to the user with a return code for
incomplete.
DCBSUR on, DCBRCX = 112: The operator has
mounted or set the requested form, carriage

tape, chain/train, and density for the
printer. The corresponding four SDAT
tlelds are therefore set from the SYSURS~;pecif led va lues, and processing conti nues
.IS if toe four SDAT fipld:; were alredrly
..orr "c"1 y set (set' abovp).
,(...:.=_::=.._(~ __DCPRC~":~:
[;ETUf,: i~;
.'oces~] of loadinq the UC::; buffer.

in ttl"
If the
0ffer loading operation is not yet complete, control returns to the caller with a
return code for incomplete.
If the loading
is complete, but the DEB indicates an
<'rror, DCBSUR is turned off and SETUR exits
t~ its caller with a message to the operator and rE'turn codes for "unrecoverable
Frr01-".
If intervent.ion is required, a
message is sent to the operator with a
return code indicating incomplete.
If
there is no error, an lORCB specifyinq
CZCMD3 as its post ing entry p(.)int is built
and executed, to print the llCS buffer along
with the ues form of the verification message, and control returns to the caller
with a return code for incomplete.
DCBSUR on, DCBRCX :~20:
SETUR is in the
process of printing the UCS buffer and
verification message.
If the printing is
not yet complpte, cont,rol .returns to the
caller with a return code for incomplete.
I f the printing is complete. but the DEB
indicates an error, DCBSUR is turned off
dnd SETUR exits to the caller with a mf'Ssage to the oI,erator and return codes for
"unrecoverablf error",
If intervention is
required. the message is sent to the operator with return code indicating incomplete.
If there is nc error, a WTO is issued to
write the EBCDIC form of the verification
message on the operator's console, and to
request that the operator verify that this
verification message matches t.he one previously printed on the printer.
CZCMD2 is
specified as t.he asynchronous entry pOint,
and SETUR returns to the caller with a
return code for incomplete while operator
response is awaited.
DCBSUR on. DCHRCX '" 124: The operator hac,
t yet verified that the print line
?eared identical on the printer and the
.sole.
Control is returned to t.he caller
"ith at r"'turn code for incomplete.
DCR:':::JR on t , DCIRC~= 128:
The operator has
verified the vcs crintinq. The DCS key is
stored in the SDAT and t,he universalcharacter-set bit is turned on in the DCB.
Processing then continues as if the SDAT
and SYSURS values for the UCS key matched
(see above).
[leBSUR on, DCBRCX = 132: The alignment
lines are being printed and the operator is
checking print:er alignment.
If the DEB
j ndicates an error, any active .:Lnterruption
is deleted; DCBSUR is turned off, and conSection 2:

OPEN Processing

23

th.' callf'c with a message
dnd [pturn cu0 dligrullent were necessary (see above>.

LK'i:\:.:UK
on DCBRCX '" 140:
A start 1/0 error
.........~.-.-~~
10try has failed and DCBRCX is set to 140

Icturnlng from the SE:TUR synchronouE
, . ,terruF'tion routine entered dt CZCloID3.
At
t t'f' f)'c'xt. ~;ETUR rr . acro instruction, the SETUR
rout.ine, entc'red 'it its main entry flOint,
w111 detect thi~ condition, set a return
code of 8 (unrecoverable I/O error) in
f!'qist.er 15, and return.

d

int~ervention

[;;·fo[p

I.J5;E'~l,LF

off, DCBRCX rl2,!...1,~.than 100:
The
cal} er has tl.rrned off t.he DeB SETUR-inprogres", bit in order t.O prematurely t.ermlnate the SETUR processing.
In this case.
the ~3DAT carriage tape, chain/train, folding option, Des key, URS key, and density
fields are zeroed if the device is a
t'rinter.

TAM
PROC£~,SING
- -,,------_.
The follo\oiing routine is used with T<'rlrinal Access Mpthod CTAJlJ) proces~:ing.

In continuing the open proces!;ing from
Open Common, TAM Open is called 1:0 perform
additioT2l opening functions for terminals.
This includes buildim control blocks and
providing buffer areas for initi.lting communications wi th a termina1.
TAN Open then
returns to open Common except wh'~n an
abnormal end is required, in whi<::h case it
goes to ABEND.

list.

Add device to task device

RMDEV (CEAAD)
device list.

Remove device from task

Access Method for SSM. MSAM. TAM and IOREQ

Exits:
Normal -- Normal RETURN to calling routine.

(Q'

Error -- ABEND macro instruction.

~_ _ _ _..J(A)

Operation:
TAM Open initially saves the
general registers, gets the TO~ page and
examines the numoer of DCBs that were
opened for a given terminal.
• If this number is equal to 0, the terminal definition is checked.

DCB

'IORCS

,-----1 • DE B

t -_ _...J B

• If this number is greater than 0 and
less than or equal to 255, TAM Open
continues the processing by updatin9
the count at DeBs in the SDAT.
• If this number is greater than 255 (the
maximum number of opened DeBs allowed
for a terminal>, TAM Open branches to
ABEND.
The terminal is checked for definition
and type when the first DCB is opened for
this terminal.

Terminal
L -_ _~

Informolior

I
I

~~'~_~_JF_C_B____~t-~

• If the terminal is defined, TAM Open
continues the processing by updating
the count of DCBs in the SDAT.
• If the terminal is not defined this
rout.ine branches to ABEND.
• If the terminal is defined and is either a 2741 or a 1050, the system must
determine which of the two terminal
types is involved.
This determination
is made by issuing the LCD macro
instruction.
TAM Open issues a GETtJ'AIN. macro instruction to obtain one page of virtual storage
for the data ext.ent block (DEB), and the
terminal operational status table (TOS)
which includes the I/O request control
block (IOReB).
Pointers are set up between
these blocks and blocks that were created
befon' TAM Open, and are illustrated in
Figun· 4.
The purpose of these pointers
between TAM Open allocated blocks and previously existing blocks is to facilitate
their use by all TAM routines under normal
and abnormal conditions.
DEB virtual storage, after being initially allocated during TAM open, has the
following pointers set and data moved:
(A)

The DEB is pointed to by the DCB.

CB) The DEB points to the DCB and the
fDAT.
(e) The DEB points to the SDAT terminal
information. This SDAT terminal
information pointer is moved from the
J FeB.

(Q)

----...

Blocks creoled before TAM OPEN

Blocks for which TAM OPEN allocotes 'poee
Pointel"S existing before TAM OPEN

Pointe" set up during TAM OPEN
Doto moved during TAM OPEN
Parameter I is! pointel"S

Figure

4.

TAM Open:
DEB and TOS St.orage
Allocation and Point.erc3

(D) The SDAT terminal infonna t ion j s
loaded into the DEB.
This tern·inal
information is loaded into the DEB.
This tenQinal information is u~ed by
t.he TAM Read/Write and TAM routines
and includes t.he b,rminal type, centrol unit type, data adapter and model
code of the terminal.
TOS virtual stora'Je is allocated by Ti\'M
OPEN and is point.ed t.o by the DCB.
TAM
Read/Write uses the TOG area to build the
channel command words.
It is also used by
TAM Read/Write, TAM Post:ing, and TAM Open
for cOllUnunication of common informat ion.
Processing ends with t.he terminal DeB
open count in SOAT incremented by 1 for
this current DCB and a ret. urn to OjJen
Common.
Section 2:

OPEN Processing

25

!,_:.,;i"~

,>

.~H0CESSING

set organization requirements must be
specified at data definition time only.

-~--,.--~---

r~

I

following routine is used with
/Out_put Request (lOR) processing.

continuing the open processing from
lOR Open is called to allocat.e
,"',TO;: To for cont: rol blocks and compl e1:e the
r,.qu);: eli fields in the DEB to allow t.he
I)cessin] of the IOREQ macro instruction.
in

--';;Hrur;on.

t.hen Ltc'turns to Open common
:cp;-_ :';ncn an abnormal end is required, in
\.,. '._Gn~a:;e it goes to ABEND.
(See Chart
~CH

~)p0'n

REentrant, resident in virtual
nonrecursive, read-only,

l()c;<:'d,
.: ':t\llletJt~:d

<-

czeSCI -- Entered with type-l
When this routine is entered,
er 1 contains the address of the fol':' i,,,r

The DEB points to the DCB and JFCB.

(C>

The DEB points to the IORCS.

(D)

The DEB points to the SDAT address
and device address information.
These SDAT information pointers are
contained in the JFCB.

(E)

The JFCB data type code information
is moved to the DEB.

ABEND macro instruction.

~2~~st2rs.

D

• The user-supplied NCP parameter, in the
DCB macro instruction, is not greater
than the maximum (DCBNCP=99).
If the
user did no't set a value, or set a
value of zero, d value of 1 is
inserted.

lOR OPEN sav€s the general
Tests are then made to check

'The lORE'.! facility is allowed on the
device, by check.ing t.hat the SDAIOR
field in SDAT is equal to one.

Some other DEB fields listed below are
also completed:
~

" The DCB ~dentification is valid, by
checking that the DeBID identifier is
eq ual to .%.~.
.. The TD'!' indicates that the IOREQ facility is specified in the DO command
fTDTDSV=RX).
The DCB was previously
checlH,d in Open Common (DCBDSO=R.X)
which called for lOR Open.
The data
26

Part I:

The identification field (DEBID) is set
to • (.

• The size field (DEBSIZ) is set to DEB
area size •
• The IOREQ Posting VCON (DEBPSV) is set
to IOREQ Posting entry point and the
RCON (DEBPSR) is set to IOREQ Posting
PSECT address.

Access Method for BSAM, MSAM, TAM and IOREQ

(B)

(E

)~

~

--r-----l

DCB
DCBDEB

DE8 " . (A)

DElmC8

~

OE8eLl (Data Type Code)

~

(0),---------

~

I
I
I

~
~
~
~

~~

(0)

~

r - - - - - - ..

DE6SYM (Sy""
OEB.'FC

I

I

!
I
I
I

I
I
!

1

I
I

(S)

I

(Cl

l. __

o

w__'''_PO_9''_---'

Dev. Add.)

DE!jWRK

I

.ORCS

L

I _______
L

IL _______-:- _ _ _ _

~

DEBSDT (SOAT Add')

I
I

~

TDTDfB
TOTtO,I Un SOAT)

JFC6

~

~

TOTIOI +2 (To SOAT)

~

TDTDEV

~

'V

.

----

..

Porometer list point"...
OEB point"I'S, ta o!,d from DCB and JFCB, and to IORCB
SOA T poinfers from JFCa moved to OEB
0..10 Type Code informotionmoved from JFCB to DEB

Figure

5.

lOR OPEN:

Basic Pointers and Data Moved from JFCB to DEB

• The number of chilnnel programs (NCP)
field in DEB (DEBNP) is set to the
value in the DCB field (DCBNP).
• The DEBDVC field is set with a hex code
indicating the device (magnetic tape,
direct access, unit record).
• The DEBUNT field is set with a hex code
indicating the unit type (2400, 2311,

.... ) .

• The maximum number of IORCBs allowed
field in the DEB (DEBIO> is set to the
maximum in the SOAT field (SDAMRB).
• The DCB protection class field in the
DEB (DEBCLS) is set to the appropriate
value. It is as obtained as a result
of an SVC. generated by a CKCLS macro
instruction.
A final check on this
value within lOR Open assures that the
user is privileged if the access to the
volume is p~ivileged.

• A pointer to the DECB field in the DEB
(DEBOEL) is not completed during lOR
Open but during IOREQ. However, the
address of DEBDEL is stored in a DeB
field (DCBDEC) durinq lOR Open.
A final check is made of both the DeB
protection class and the type of access to
the device. Then,
.. If the DCB protect.ion class is not privileged (DEBCLS+l) and the type of
access to the device is privileged
(TDTVPY=l). an ABEND exit occurs.
• If no DCB protection class can be
determin,~d, an ABEND exit occur~i.
• If neither of the above criterla are
met, a return to Open Common occ-urs.

Section 2:

OPEN Processing

27

SECTION 3:

READ/WRITE

Kl:.AD/'.-iRITE PROCESSING

~----~.-

ion describes the aSAM Read and
Put, Read and Write, TAM
Wnte, and IOREQ rOll,tines.

se(.~

:'l1i5
Writ~e,

MSJ\M Get,

Read clnd

';'ne Read/Write routine creates an laReS
which contains the appropriate channel commands to perform the I/O operation ",hich is
U!qu;:':c;ted by the BSAM READ or WRITE macro
instruct,l.on. The IOReB is passed to the
I/O supervisor so the channel commands may
be expcuted.
(See Chart B.A.)
Attributes: Reentrant. resident in virtual
~torage. closed, read-only. privileged,
nonrecursive.

CZCR.'\S -- fI.ain entry point to the Read/
Write routine; ent.ered 't:rj t.ype-l or
type-2 linkage.
CZCRDS -- Entry point for building an IORCB
i Bui Id subrout~ ine); entered by type-l
linkage.
CZCRE:S «- Entry point for adding the channel program (Construct subroutine);
entexed by type-l linkage.
lnput: Register 1 contains the address of
a DECB containing all information which was
coded as parameters of a Read or Write
instruction.
Data References: CHASDA, CHAIOR. CHADCS,
CHADEB, CHADEC, CHAVPS.
Modules Called:
AWI\IT (CEAP7)

Await an interruption.

IOCl>.L (CEAAO)

1/0 call.

CKCl,.;"

Check protection class.

(CEAQ4)

ASCII Translation and Conversion (CZCWA)
When an ASCII Write request is
encountered.

During open processinq, a queue (f
zeroed DECB pc-inters is established in the
DEB for the data set. The main routine
stores the address of the input DECIl pointers in the reserved pointer area.
When this routine is entered, 1f the
passed DECB is the same as the first DECE
in the queue, it is the Check rOllt_ill€ that
has ent.ered the Main rout}.ne to havp a read
or write request reissued.
If entry was not by Check, the IH'W DECB
is inserted into the queue i f there is
room. The "in use" and "intercepted'" flags
are set on in the new DECB. Should the
-number of IORCBs allowed 8 count permit
another 10RCS to be given to the I/O supervisor, a search of the queue of DECBs is
initiated to find the first request to be
fulfilled.
If that particular DECB is
associated with an ASCII Write request that
",as intercepted by the I/O supervisor, a
call to the ASCII Translation and Conversion routine (CZCWA) is made to put. the
record back in EBCDIC format. Then the
main rout.ine proceeds to have the lOReB
built by the Build routine and filled in by
the construct routine. Successful c number, and R is the
record number on the track. The first CCws
are two Seek commands to the next I/O
address (bbCCHH) which is found in the DEB.
The first Seek command is software chained
because a seek takes a relatively long time
to execute (arm movement may be necessary).
and hardware chaining of commands makes the
channel unavailable to other tasks. Therefore, software chaining will cause the two
seeks to be executed without locking other
users out of the channel.
The second seek
command is command chained to tbe rest of
the CCws in the channel program, so execution of the second seek gives the task
exclusive control of the channel until the
execution of the channel program is concluded.
The next CCW is a search for the
identifier CCHHR, which will position the
DA device to the key field of the record.
A TIC command follows the search to cause
the channel program to loop until the record is found.
The Read command (read key
and data) is next in the channel program
and it is followed by a NOP command.
When reading format-U or V records, i t
is not known where the next record to be
read is.
This is because the number of
bytes in the current record is not known.
If the end of the current record cannot be
calculated, the beginning of the next record is not known.
So when reading format-U
records, the search command is directed to
the last I/O address. Then three CCWs are
generated:
read-no transmit. read. and
NOP.
The READ-no transmit causes the last

record to be passed by the reading head,
and the read key and data causes the
correct record to be read.
The channel program for a DA write is
generated as follows.
Using the last write
address from the DEB, t_he first four channel command..s are generated:
seek, seek,
search, TIC.
The reason for using the last
I/O address is that it is known where the
last record was written, but if format-U
records are being written, it is not known
where the next record should go.
Then a
read-no transmit, followed by a writecount, key. data is generated. The Read-no
transmi t brings the head past the last
record which was written and then the WRITE
puts the new record on the volu.me sequentially following the previous record.
If
track overflow is specified and the record
to be written is larger than the room
remaining on the current track, the record
is begun on the current track and continues
on the next sequential track.
However, no
record can be split between cylinders on a
DA volume.
As in the channel proqram for a DA read,
the write channel program is ended by a NOP.
The Constl:uct. routine uses closed subroutines to help in the completion of the
IORCB.
They are:
ENTCCW

Enters a COW into the lORCB.

SCHCCW

(;enerates SEEK, SEARCH, and TIC
CCWs, and puts them in the lORCB.

SETPAG

!jets up a page list in the 10RCB.

NXTIO

computes the MBBCCHHR of the nex.t
record t.O be written on a DA
volume.

InterceptiH~ Read or Write Reguest:
The
DECB which is passed to the SAM Read/Write
routine contains an int_ercept flag set by
~;AM Read/Write when the I/O request. is not
actually initiated.
(lOCAL is not given
the lORCE built for the DECB).

There are several reasons why the I/O
request of a particular DECB may not be
initiated.
For example, if a read request
is given and the current volume was used up
on the preceding read, the DECB is set as
iptercepted and the E)V request flag in the
DEeB is set on.
1 f a wr i te reques1: is
given and there is no more room in the cur·rently allocated extents, the same flags
are set.
If. the DECBs request I/O on the
same devices anu the first one encounters a
hardware error condition, the intercept
flags in the remaining DECBs are set on sc
the I/O will not be initiated lIDless the
hardware error is cleared up.
If this were
not done, each DEeB I/O request could run
Section 3:

ReadFwrite

29

into the same hardware problem and a pernldnent ex·rOT would be found. not once, but
IIld ny times_
When a DECB is operated upon by the
Check routine, the intercepted flag is
tested.
Should there be no serious error
condit.ions posted in the DECB, the Check.
routine, in addition to performing other
services, will reinitiate the I/O request
by passing the DECB back to the Read/Write
routine.
This I/O request is given immediate attention by Read/Write because it is
the first entry in the queue.

DOMSAM blocks and deblocks logical records int.o system buffers when GETs or PUTs
are issued. invokes MSAM READ/WRITE to
bnild and execute the IORCB necessary for
I/O, and provides t,he user with a return
code describing the outcome of his GET or
PUT request.
The routine runs in the same
privileqe as its caller.
(See Chart BB.)
Attribut.es:
Read-only. public, reentrant.
nonrecursive, assumes privilege of caller.
Ent!:L!'oints:
CZCMEl ~~ Entered upon issuance of a GET
macro inst.z:u(.'1::ion which generates type-l
linkage.
·':ZCME2 ..., Entered !lpon issuance of a. PUT

macro instruction wnich generates type-l
Li.nxage.
Inout-

~te)'(

0 -- Address of user-specified
area for move mode GET or PUT.

Register 1 -_. Address of the DeB.

pata Ref erences =
CHADBP, CHAISA.

CHADCB. CliADEB. CHADEC,

Modules Calleq: MSAM Read/Write (CZCMF) -To read or write records.
Exits:
Normal -- Followi~ G~r. register 15 contains one of the fallowing return codes:
'00'

Normal completion.
Register 1 points
to record obtained in buffer if locate mode, user area if move mode.

'04'

Request incomplete.

'OS'

Unrecovexable I/O error.
Register 1
points to (failing) record in buffer
if locate mode, in user area if move
mode register 0 points to user DECB.

'oct

30

End of data set reading.
(NO record
obtained).
Register 0 points to user
DECB.
Part I:

'10'

Control card sensed rPdd.l.nq.
Reqister 1 points to cont.rol (',H'd in huffc>r
if locate mode, user dreCl if mov.,
mode.
Register 0 points to user DECB

'14'

Intervention is required in an RJE
task. because the line is disconnected.
(No record is obtained.)

Normal -- Follc,winq a PUT, register 15 contains one of the following return code~,:
• 00'

Normal completion.
Register 1 point.s
to next available location in buffer
if locate mode, to user area if IHWP
mode.

'Ol~'

Request incomplete.

'OS'

Unrecoverable I/O error.
Register 1
points to buffer of record that
failed to be written.
Register 0
points to user DECB.

'OC'

Intervention is required in an RJE
task because the line is disconnected.
(No record is written)

Error -- ABEND macro instruction is used
for abnormal end termination.
Operation: . OOMSAM has no PSECT.
It uses
the first 19 fullwords of the DEB work page
as its standard register save area, obtains
adcons from the DEB page (CHADBP), and
maintains switches and other variable
information in the MSAM portion of the DeB.
Its work areas are the DEB work page, w-hich
contains DECBs, and the buffer pages.
Upon entry to DOMSAM. a transfer point,er
is set to indicate whether a GET or a PUT
has been issued.
CheCKS are then performed
to be certain that the DeB and the DEB are
valid. and that the DeB has been opened. If
anyone of the three conditions is not met.,
execution is terminated by an ABEND macro
instruction.
If all conditions are met,
processing is categorized as GET or PUT.
If the GET macro instrncGET Processing:
tion is the first issued on the data group,
or if the previous GET emptied a buffer,
the end-of-buffer switch in the DeB will be
on.
In this case, MS~ Read/write must be
invoked to either prime all the buffers or
refill the buffer just processed.
If priming is to be done, no IORCBs may be out.standing or the return code will be set tc
indicate incomplete, and a return will be
made to the caller.
For each buffer to be filled, the current DECB is marked in use (read/write
requested) and initialized. and MSAM Read/
Write is invoked.
Upon return from Read!
Write, the current DECB is checked to see
if i t is the last in the list, and if so,

Access Method for BSAM. MSAM, TAM and IOREQ

its pointer is reset to point to the first
DECB.
If not, the DECB pointer is incremented to point to the next DECD.
A check is then made to see if all the
buffers are to be primed, and if so, the
next buffer is filled by setting up the
DECB and invoking MSAM Read/Write as
before, until the last DECB has been processed.
At that paint, the current. DECB
address is reset to point to the ;first
DECB.
The OCB pointer to the current buffer.
page is set to the address of the buffer
associated with t.h.'> current DEeR. Then the
DECB is tested for completion, dnd if the
I/O is not yet complete, control is
returned to the caller with a return code
1ndicating that the GET has not been completed and must be reissued at a later
time.
In an RJE task, if the line to the
remote device is not connected, the return
code will indicate intervention is
required.

If the DECB is posted complete and indicates normal completion with neither a unit
check ach DEes. The current DECB po.!.nter is
set to point to the first. OECB in the list,
the <1ciUlowledgement (ACID switch is initialized for RJE, and the routine proceeds
with buffer priming as described above.
PUT Processing:
Initially, for both local
dnd RJE JObs. if the PUT before th.e current
one was not in locate mode, and if no endof--buffer processing is required, the following processing occurs.
The h)ngth of t,he record to be PU'I' is
obtained either from the DCB, or, if the
Lecord is variable format and the PUT is in
move mode, from t:he length control bytes in
front of the record.
If variahie. the
length is checked for validity -- at least
equal to the number of control bytes (0, 1,
4. or S). but no greater than the maximum
for records of its type.
An invalid length
causes abnormal termination of the task.
For local devices, a record of the
obtained length will not fit in the space
remaining in the buffer, end-oi-buffer proceSSing must be done before the current
record can be processed. and control is
transferred to a section for invoking MSAM
Read/Write.
If the maximum size record
will fit within the buffer, and if the PUT
is in locate mode. the current record
address is set into register 1, the return
code is set to zero to indicate normal completion and control is returned to the
user.
If the PUT is in move mode. the
record in the user-specified area whose
address was supplied in register 0 is moved
to the current buffer location.
For RJE (which operates only in locate
mode), buffering is handled differently
than for local devices.
Logical records
are built into transmission control blocks
(TCBs) aligned on halfword boundaries
within the page buffer. The page buffer
and DECD work page both contain appropriate
pointers and flags (current TCD pointer,
final TeD flag, etc.).
The address pointer
returned to the caller does not point to an
area in the page buffer itself. but rather
to a 144-byte area within the DECB work
page.
DOMSAM then processes the record
from this location, moving it to the current TCB in the page buffer after it has
been processed. On norwal completion, the
address of the record buffer in the DECB
work page is returned to the user in
register 1.
32

Part I:

Additional processing depends on whether
or not the TCB is filled. whether it is the
final TCB in the page buffer, and, if not,
whether therE is sufficient spi'lce in the
buffer for another· TeB ot maximum (404
bytes) or minimum <278 bytes) length.
Appropriate flags are set; if an end-ofbuffer condition is .reached, MSAM Readl
Write is called.
If the R.JE device has the
multiple record feature (MRF). seven records may be placed in a TCB; otherwise, two.
I f necessary, the • Previous Put in Locate
Mode' flag is set on before returning to
the user.
If for both local and RJE. the previous
PUT was in locate mode, the record subsequently built in the buffer requires cheCKing.
If variable format records are being
used, the length is checked for validity as
above and also for being no greater than
predicted.
If the DCB indicates that this
is a form-sensitive file for a local or remote printer. the control character is
tested.
A machine code control character
specifying "skip to Channel 1 after printwill trigger the ending of the current
buffer after this record.
A FORTRAN CASAl
control character specifying ·skip to channell before print e will result in the new
page switch being set in the associated
DECB as this is the first record in the
buf.fer. or will trigger processing to end
the wffer in front of this record if it is
not.
For RJE tasks, RJE transmission control
characters are inserted into each record.
and a dummy record is moved to the TeB
where this is the first PUT after OPEN or
FINISH, or if this is the first record in
the buffer and it has FORTRAN (ASA) control
characters.
Trailing blanks are suppressed: error characters are translated
from the record; if tabbing is required.
tabs are inserted in the record; and the
FORTRAN (ASA) or machine control character
is translated to a 2180 control character.
The processed record is then moved from the
1~4-byte record buffer in the work page to
the current TCE in the page buffer and the
TCB lengtb is adjusted.
If FINISH is in
progress, an end-of-transmission TeB is
added to the buffer.
In all cases, once the logical record is
satisfactorily placed in the buffer, the
current record address is incremented by
the record length to point to the next
available space in the buffer.
If variable
length records are being processed, the
t.otal block length is also incremeented by
the record length. The count of records
within the block is incremented by one, and
if it has reached the output buffer maximum
of 200, the end-of-buffer switcb in the DCB
is set on so that the next PUT processed

Access Method for BSAM, MSAM, TAM and IOREQ

wIll caw.t'
occur.

~'!ld-,)t

llutt('[

[lr()CI':'~iin-mode- PUT
has just been completed. control is
returned to the user with a return code of
zero indicating normal complet_ion.
If,
however. the prf,vious processi ng has corn··
pleted checking of a previous lecate-mode
POT, control is t_ransferred back to the
beginning of the PUT routine. where the
end-of-buffer switch is tested before pro·
cessing the current PUT.
When a buffer must be ended and written
out. before the next record can be processed, the appropriate switches are set,
and control is transferrej to a section for
invoking MSAM Read/Write. This section
will check to see if Read/Write has already
been invoked, and if so, will proceed to
test the appropriate DECB for completion.
If complete, control is returned immediately to the caller (MSAM FINISH).
If Read/Write has not yet been invoked,
and if a FINISH macro instruction was not
issued just prior to this PUT, the current
record count is set into the DECB and then
reinitialized to zero. The DECB is marked
read/write reque~ted, and ~$AM Read/Write
is given control.
Upon return from Read/
Write, the pointer to the current DECB is
updated to point to the next. DECB, unless
the current DECB is the last in t.he list,
in which case the pointer is reset to point
to the first DECB in the list.
The DCB
pointer to the current buffer page is set
to the buffer address associated with the
current DECB, and the pointer to the DECB
to be tested for completion is set.
In an
rtJE task, TeB flags and pointers are
initialized in the buffer and DECB work
pages.

Once MSAM Read/Write has been invoked,
the DECB 1S tested for completion.
If it
is not marked complete, the next record may
not be processed, and cont.rol is returned
to the user with a return code indicating
incomplete. Where incomplete because an
RJE line is disconnected, before returning
to the caller, a return code is set to indicate RJE intervention is required.
If the DECB is marked complete, a check
is made for an unrecoverable I/O error, and
if one is found, a test is made to determine if the error was non-permanent and
already returned to the user.
In that
case. provided no lOR CBs are still outstanding (in which case a code of incomplete will be returned to the caller), MSAM
Read/Write will be called to output the
records suppressed by the error, and the
DECB will be tested again for completion.
If the error was not already returned to
the user, the DECB associated with the

is locdt.pd dnd mov~d to the user's
Th..-. add/'f's~; of thp faili.ng
r"co!'l i~ comr,utpd, dnd contnJl is ret.'.Jn;ed
to the user with a return code indicating
unrecovecc;ble I/O error.
If t.he proper
OECB could not be found, it is assumed that
error recovery is still in progress, and
control if retur·ned to the user with a
return code indicatl.nq incomplete.

PIlOT

Dt;CB

dH'd.

If no I/O error occurred and the finishin-progress flag is on, control returns to
the Finish routine. Otherwise, if no I/O
error occurred, a check is made to determine if the new buffer begins a new fonnsensitive print page.
If so, and if FORTRAN (ASAJ control characters are being
used, the record which should start the new
page is still tlai Ii ng after the la,;t record in the buffer just writ.t.en and must be
moved to the beginning of the current buffer.
If the n<'w buffer does not begin a new
form-sensi ti VE· print page or FORTRAN (ASA)
control charact_ers are not used, the first
available location in the buffer is set
beyond the 32 control byt.'s.
If the records are variable forma t. ·chis address
points to the block control bytes (LL)
which are then initialized to four, and the
f lrst avai lable locat_ion address is incre-·
mented by four.
For RJE, this address
pointer is further incremented by 12 to
allow space for the printer selection
sequence and various bisynchronous characters.
The address of the first available
location is saved in the DeB as the current
record address, and control is transferred
bdck to the beginning of the Put routine to
process thE' current PUT.

If, upon entry to the Put routine, a
FINISH macro instruction has just been
issued and end-of-buffer processing is
indicated, the following edits and initialization, largely of the t.ype performed by
MSAM Open, are required before t.he Put. can
be processed.
If any permanent I/O errors ha ve
occurred, or if any IORCBs remain ou·tstanding, the task is abnormally terminated.
If
none, a switch is set in the DCB to indicate that this is the first PUT on tbis jata
group. and the various processing switches
in the DCB are reset.
All DECBs are reinitialized. the point.er to the current DECB
is set to point to the first DECB in the
list_, and thp current buffer page add.ress
is s'~t. from t.he current DECB.
The record
format is checked to be certain it 1.S either fixed or variable, and if it is neither.
the task is abnormally terminated. The
current record address is computed as
described above.
In an RJE task, TCB
pointers and flags are reinitialized and
maximum and minimum TeB size is set.
Abnormal termination occurs if the device
is nei t.her a card punch nor a pr inter. or
Section 3:

Read/Write

33

i t the logical record length specified in

the DCB is invalid.
Ot.herwise, conrol is
transferred to the beginning of the PUT
routine to process the first record of the
new data group.

?'!SAM Read/Write Routine (CZCMF)
The MSAM Read/Write routine builds an
which contains a channel program
(CC~s) to process an entire buffer page of
records.
It invokes lOS by the lOCAL SVC
to perform the actual input or output commands.
(See Chart BC.)
ICmCB,

.i\ttriJ:!utes:
Privileged, read-only, public.
reentrant, nonrecursive.
E.J1try PoJnt.:
CZG-lFl -- Entry from DOMSAM
(GEl' or PUT) by type-lor type-2 linkage.
~.Q£~.t.:

Register 1 contains the address of
the DECB.

Data References:
CHAIOR, CBAISA.

CHADEC, CHADCR, CHADEB,

Modules Called:

DIR

(CZC.JD)

--

Delet(' interruption routine.

lOCAL (CEAAO) -- Initial supervisor procesSing of an IORCB.
SYSER

(CEAlS)

System error processor.

R(;set:. (CEAAH)
Reset device suppression
flaq- rout.ine.
Exi t.S:
Ncrmal -- No return codes used.

Error -- Link to ABEND with condition code
1 and appropriate error message.
operation:
When Read/Write is entered, the
address, t.he DEB address, and t.he
address of the buffer page are obtained
from the DECB. The location where the
10HCB is to be built is obtained from t.he
first system cont.rol word of the buffer
page.
Since this buffer page may be in
Class A (user read-WY~te) virtual storagl',
d
ser1es of checks are made to verify that
the IORCB address is still valid and has
not been changed by the user.
An incorr.:ct
IOReB address causes an ABEND.

DCE

If the DEeB passed to Read/Write indicates complpt e with error rather than Read/
Write request, d"y outstanding asynChronous
routine is deleted, the IORCB abnormally
terminated is reissued immediately at a
point beyond the command that failed. and
any subsequent lOR CBs whose DBeBs are
marked intercepted are reissued.
Control
then returns to the caller.

:,4

Part I:

If the DECB passed to Read/Write indicates a READ.rwRITE re<]uest. the 10RCS is
built and executed.
The location ot the
buffer page is placed in the s1ngle page
list entry.
All CCWs created w111
reference this page list for the address of
the buffer page.
Pointers, counters, and
the displacemer:.t are initialized.
Each CCW
contains a displacemnt field Which corresponds to the displacement, in its buffer
page, of the data to which this CCW refers.
If the CCW does not reference data (for
example. skip immediate or NOP) , the displacement is the same as for the adjacent
CCW.
The device type 15 tested, and processing diverges for local or remote
devices, and for input or output .
For local card readers, the data mode
(EBCDIC or column binary) the stacker bin,
and the record length are determined from
the OCB.
Two command-chained CCWs are
generated for each record to be read; a
read CCW followed by a feed and select
stacker CCW.
After the CCWs have been constructed for
a buffer full of records (count is given in
the DECB). a NOP wit.hout command chaining
terminates the CCW list. The length of the
CCW list and the total lengt.h of the lORcn
are computed and set in the fixed area of
the lORCB.
If this is the first record of a data
group, or on initial prinung after an
error, the device is reset for I/O and
exceptional condition flags are cleared.
(If not the first record, and an exceptional condition has been detected on the
device, the DECB is marked ·posting reissue" if error recovery is in progress, or,
if not in progress, it is marked Wintercepted-, and control returns to the
caller. )
Task interruptions are inhibited while
the count of IORCBs outst.anding is incremented by 1. Then this lORCB is issued to
lOS by executing its lOCAL SVC. Control is
returned to the calling program.
For remote card readers, an IORCB is
built consisting of alternating read ana
",xite CCWs.
Each read CCW brings in a 168byte tr al ternatinq n·ad and write CCWs built
IO the laRCH.
paq" huffpr iii dn HJE: (;J::T opt·ration
coot.lin up to 24 transmissIons (48 cdrd
records).
When the maximum number of CCWs
have been reached (or there arE no more
records}, a NOP command will terminate the
command chain.
The lengths cf the ccw list
and of the IORCE are computed and entered
in the fixed area of the IORCB.
A

may

If no errors ere outst.andio9. acknowledgement responses for the write CCHs are
synchronized. task interrupt~ons are permi tted if necessary, and the IORCB is
executed via the lOCAL SVC.
Control is
returned to the caller.
For card punches and local or remote
p.r.-inters both FORTRAN (ASA) and M control
characters are supported. The record
length for fixed length records is determined from the DeB.
Variable length records specify their own lengt.h.
The length
field of a variable length record is never
printed or punched nor is any control
character printed or punched. Control
bytes are examined in the buffer.

If the device is a card punch, one
punch, feed, and select stacker CCW will be
generated for each record to be punched.
If M control characters are being used the
control character itself is used as the
command code.
It must be a write command,
ot.herwise ABEND terminates the task.
If
FORTRAN (ASA) control characters are being
used, the command code is determined by
combining the DeB mode specification with
the appropriate extended ASA stacker specification.
If no control characters are in
use, the mode and stacker specifications
are obtained from the DCB and combined to
create the comma.nd code.
If COMBINE is
specified, the stacker must be RP3, otherwise ABEND terminates the task.
If the device is a local printer and if
universal character set CUCS} printing is
to be done a reset block data check command
is the first command of a data group.
Preceding the first print command of a data
group is a skip immediate to channell CCW.
If neither FORTRAN nor M control characters
are in use, each CCW created to print a
line will be a write and space after writing.
The number of lines to space is
determined from the DCB.
If M control
characters are in use each control character will be used as the command code in the
one CCW generated for each record.
It must
be a write command, otherwise ABEND will
terminate the task.
Since FORTRAN control

charact2rs specify skipping or :spacu}(,
before print.ing as opposed to thE' corrlTI,and
codes which spf'cify only skipping and cipacinq alone. or skipp~nq or ~;pacinq aft EeL
printing. the control actIon i~; d:Ci!;or:iaty(}
wit_h t.h'! previous writ_e. or reyue:;ted ,don'
if t hf'Te i,; nu prrvi()I}'; WI itJ·.
Thu:;, 11
FORTRAN conI roi ct." fdrt !·c. dee in US", the
fir<;t record will CdUSt' t',yO CC'..Js to bE' constructed; one control CCW to skip or space
bet are print inq and on e wr it e CCW.
Ea cll
subsequent record will cause the generatior
of one CCW, whose writ-.f' cornrnano code i,i
also determined by the next FORTRAN control
character.
The CCW for the last rec,)rd t { )
be print'ed is a print and no space commanrJ.
When the last punch or print CCW has been
built, the list is terminated with a NOP,
and the line of processing for the card
reader is rejoined.
If the device is a remote printer, the
channel program will consist of alternatin
wri te and read CCHs.
Each write CC, will
tr:ansnlit a transmis'Jion control blo-:k (TCB.
of data containing up to 7 records Lf Ul not.
Each rea j CClrl
will read in bisynchrOlious acknowle-j'1pn'(cnt
byt.es for det.ermining ,;uccessful tr insmi:;sion {alternat.ing l,eKO ar,d ACK1}.
rf this
is the first PUT aft.er an OPEN or FINISH
macro instruction, or if the IORCB is beine
reissued for purposes of error rec(,very,
the initial CCWs will consist of writp,-; an,
reads of bisynchronous bytes t.O ascertain
the state of The device and qet thE acknow
ledgements (ACKO and ACKl> in synchroniza·
tion and a selection record to selfct th~
printer.
In addition, if the device helS
the tabbing feature, CCWs will be <,oded t.c·
writ.e thetabbinq n?cord, which wi) 1 set
the tabs on the printer.
(The 144- byte
tabbing record is built. by Read/WI·.i t.t: in
the IORCB preceding t_be pagC' list roi.ntcr;
it is built only once for each IORrs.)
~h0
'",rite/read CCW pairs will follow ur Lil dL
end-of-transmission (EaT) TeB is II COqnized. Then a write CCW iE; built forLhe
EOT TCB and a NOP is added to term:inatr
cOIT~and chaining.

During the execution of a systec program, where the programmer r.ad oric inally
requested a read or write from or to a ter-

minal, a call is generated that lirks to
TAM Read/Write.
TA.'1 Read/Write functions are accomp-'
lished by using the control blocks and
buffer area allocated during TAM Open, ar,,:
by using the tables internal to TAM Read/
Write.
The terminal-computer communicatic:
is accomplished througtl a buffer area urK,er
control of the channel command words
(CCWs), located in the IOReB.

Sect.ion 3:

Rea:l/Wrlt('·

TAM Read/Write also issues control functions (orders) to the transmission control
unit (2702).
(See Chart BD.)
Attributes:
Reentrant, resident in virtual
storage, ~losed, read-only, privileged.
Entry Points..:
CZCYM1 -- Type-l linkage.
systems routine.
CZCYM2 -- Type-1 linkage.
Posting.
In£ut:
Register
the DECB.

Entered from
Entered from

TA~

contains the address of

Thf?

Data Reference:
CHADEC, eRADeE, CHA·')EB.
CHAIOR, CHATOS, CRASDA.
Modules Called;
ABEND (CZACP)
CKCLS (CEAQ4)
lOCAL {CEAAO}

TSEND (CEAP9)

The tiClt area. tpstPd assures that in
the- SDAT ttl,· number of acti ve IORCBs i~;
zero.
No busy CECB exists for this terminal.
(A busy DEeR occurs after a TAM REAC/
WRITE is issued and ends during tnc ccrre~­
ponding TA~ Posting.)
If the number of
active IOi\U:ls 'S zf'ro, the lCRCH active
count fipld in the TA~ Read/Write PSECT for
thj:; tern inal ',5 ~;.;t to 1 (for this TAl-,
Read/Write I"nt.:y) an'! triP ';<,canci an'a is
tested.
If thfc nurrJ)C'r of ;~ctivf' !\H'\..'Bs i~
not zero, then t.he in-use hit In the fla·~
field of the DECP is set ano a n'tur'l is
made to the user.

Abnormal task tel~ination.
Check protection class.
I/O call.
Time slice end.

Exits:

Normal -- Return to calling routine.

:::~pcond

a:r-(-:.a

tf?'~)t_{-'(!

(j~~'~\.lr~'s

t: hAt

in

the DECB, the type option code suecifieJ ~s
within the range of all defined types for
all terminal types, ani that the type
option code specified is valid for the
actual terminal type.

It these conditions are met.• dat. 1\ ret.urn to t.he user occurs.
The type option code in the DECB is then
decoded to see if it is a control fUnction
(order).
If it is a control fUnction:

DEC8

• The corresponding CCW generator
generates one appropriate CCW in the
TOS nuild area.
The DECB pointer to the DCB is included
as one of the Read/Write macro instruction
operands.
The rest of the pointers are
aescribed in T~ Open.

• The CCW is moved from the TOS build
area into the IORCB CCW list area.
• The IORCR

fixe~

area is

co~pleted.

AI! initial test is made to see if a non-

privileged user has called TAM Read/Write.
An improper linkage will immediately ABEND
the task.
Any time the cotnmand system is used, it
causes TAM Read/Write to be invoked oy way
of the Gate routine.
Nonprivileged programs should only use t.hose GATE macro
instructions which link to the Gate routine.
The system program Gate routine then
links to TAM Read/Write.
A nonprivileged
program attempting to directly call TAM
Read/Write is an abnormal condition that
causes a branch to ABEND.
Two areas of
error testing are then made to assure that
system parameters are properly set.
If
either area is not satisified, a return to
the user occurs.
If both areas are
correct, TAM Read/Write continues.

36

Part I:

• An lOCAL is issued, which l~nks to IDS
for this lORes to be executed.
When
the supervisor ret.urns control, 'rAY,
Read/write restores the registers ana
returns to its user.
p,cceSS.lnq the ctlanm-), Pr03.Ian, (;e.l2~ratcr:
If this is not a centrol f'met ~on. TAt-.
ReadMritp bEgins processing to bUlld a CCvJ
list appropriate to the c~t.lon rpqupstei
for the particular terll'.i nal.
TAM Read/Write begins processinq for
this requested terminal computer I/O operation by fLest finding the proper channel
program generator (CPG).
To accomplish
this a program search of internal tablps
"'it.hin TAM Read/Wri te DAT

r------T------T--------------------T------l

IModel
I Cone

i Line i

I Type i

Terminal
Type

I

SAD

I

IOrder i

~------t------+----------T---------+------i

! High-Orderl Low-order I
I
Byte 3 I Byte 3
IByte 41

IByte l\Byte 2(
~--_---L

___ ---~----------L---------L------~

I
I
I
!
IByte 2 -- represents a line type for
I
I connection (dial line or dedicated line) I
I
!

IByte 1 -- rppresents a model code for
Iterminal units (1050, 2741, 35, 1052)

IHigh-order Byte 3 -- represents a
I
It.erminal control unit t_ype (IBl-l tern,inal I
Icontrol unit; type I, type II. telegraph !
Iterminal control unit; type I, type II,
I
jWorld Trade terminal control unit)
I
i
I
I Low-Order Byte Cj - - represents a terminal I
I chanI1el connection type (2702,
I
i Multiplexu:)
I
i
I
IByte 4 -- represents d SAD order (0, 1.
I

12,
3)
I
l ______________________________ .__________ J

3.

In toe TCP (Table 12), TAM Read/Write
locat.es the proper CPG from the type
option code.
The TCP is divided into
three main fields which are:
" Terminal control informat.ion table
(TeIT)
• Channel program index table (CPIT)

but ft·t: allocrlt ion t i.!q bj t,; :>!lown in Tabl ..
16.
For each flag that is on, TAM Read/
Write branches to the indicated associated
rout.lne to perform the indicated require('i
fUnction.
These functions are used in
generating a CCW or updating information
needed to construct an IORCB.
Overall
these functions include allocating space in
the IORCB buffer area ~nd moving into this
buffer:
• Begin and/or end control characters
• Space for response characters
• Output data
• Data translation of output data
• Space allocation of output data
The last buffer allocation flag is an
end flag.
If it is not set_, the developed
CCW is then moved (see note below) into the
build area of 1~S where the corr®and code
and flag fields are obtained frow the CCWG
area and the count and relative displacement address fields are obtained from registers.
The logical function code is moved
into the logical function area of TOS to be
used later by TAM Postinq.
The next
sequence cycle in this CPG then repeats, by
sequentially testing the next CCWG buffer
allocation flags.
lithe last buffer allocation flag is
set, TAM Read/Write prepares to terminate •

• Channel program generator (CPG)
The terminal control information table
(TCIT) in the TCP contains data on addresSing, polling, EOL sequence characters.
etc., (Table 13).
The channel program index table (CPIT)
(refer to Table 12) determines from the
Type option code (stripped of the repeat
bit if any) where the corresponding CPG
displacement is.
The CPG is obtained from the displacerr,ent in the CPIT.
Thi::.; displacement value
is added to t.he TCP address to generate the
address of the CPG (Figure 6).

Not~:
A developed CCW is not moved int.o
the build area of 'ros and the logical function byte code is not moved into its respecti ve location if t.he following conditions
are present in the CCWG:

• Command code field is zero
• End allocation flag is set
• Inhibit allocation flag is set
TAM Read/Write then prepares t.o t_erminate since all the allocation flags in all
the CCWGS in the ePG have been tested.
To
accomplish this termination:

Makeup and processing of t~he Channel
Program Generator:
A CPG contains channel
command word generators (CCWG) (refer to
Table 11~).

• The message in the buffer drea of the
lORCB is translated to the tprminal
character set code. for all write
operations.

A breakdown of each of the CCWG sections
is shown in Table 15.

• The cew list is moved from the TOS
build area into the IORCB CCW list
area.

To process the CPG. each sequence cycle
begins by sequent.ially testing the CCWG
38

Part I:

• The lORCn fixed area is completed.

Access Method for BSAM, MSAM, TAM and IOREQ

Table

9.

TAM Read/Write: Type Option (Hex and Mnemonic) Codes and Description
(Part 1 of 2)

r------T--------T------------------------------------------------------_________________ ,

I

IOptionj~ncmonicl

I code I Option I

I
DP:;cription
I
~------+--------+------------------------------------------------------------------------~
I 02 I TID
I Read Initial with Dial: This option indicates that an automatic dial I
I
\connection is to be made with the terminal.
The dialing digits are
I
I
i located in the terminal entry list IDFTRI1ENT). If the terminal type
I requires polling, the necessary polling r;equence characters are
I
I
I generated.
!
I

I (HEo'x) I

03

04

Code

I

ITDR

I

ITIN

I

I

07
08

09

OA

DB
OE

I

It assumes that the line connection has been previously II
Imade.
If the terminal type requires polling. the necessary polling
!sequence charact~rs are generated.
I
" Rea d Inltlal:
..

i
I
I
I

Read initial/rep'2!at.

t

,

IRead Continue: This option is specified when polling is not required. I
lIt may be used for terminals previously polled and in a transmit state. I

ITCR

IRead continue/repeat.

ITCN

I

I

IWrite Initial with Dial: This option indicates that an automatic dial
Iconnection is to be made with the terminal. The dialing digits are
Ilocated in the terminal entry list (DFTRMENT). If the te1~inal type
Irequires addressing, the necessary addressing sequence characters are
I generated.

ITOR

!Write initial with dialing/repeat.

I

I

I
I

ITIN

I
I
I

ITNR

I

ITIA

I
!
I

I

ITID
I
I
I

I
I
!
I
I
I

I

I
I
IWrite Initial: It assumes that the line connection has been previously I
lmade.
If the terminal type requires addressing, the necessary
I
laddressing sequence characters are generated.
I
!
I
,Write initial/repeat.
I
I
I
IWrite with Response: It assumes that the line connection has been
I

I previously made.

I

I
I

If the terminal type requires polling and addressing.
Ithe necessary sequence characters are generated. This option provides
Ithe ability to output a message to a terminal and receive the
Iterminal's next input record or line. The maximum output message size
lis 1 to 32,767 characters. The maximum input message is one logical
I record or line as specified by terminal type.

ITAR

IWrite with response/repeat.

I
I
I
I
I
I
I
I

!

I
I
I
I
I
I
I
I

I

I

I

I

I

I

65

I

I

I

64

I

IRead initial with dialing/repeat.

I

I
I

OF

I

I

05

06

I

I

I

IThe above types with the repeat option will automatically retransmit orl
Irequest retransmission of messages in error if the terminal is equipped I
Iwith error correction facilities. A predetermined number of retries asl
Ispecified by terminal type will be attempted for each message
I
Itransmitted in error. The posting of uncorrectable errors will incllldel
lappropriate error informatior.
!

IAUTOWRAP!On accepting this order, the Transmission Control Unit wraps the output I
I
lof the addressed line to the input of 1 ine O. The command within the I
I
I
I channel operates as, a writ_e.
lDISABLE Ian accepting this control order, the Transmission Control Unit resets
I
I the enable latch within the line adapter of the addressed
I
!communications line.
No data transfer occurs.

I

I

I
I
\
the I

I

!ENBLASYNIOn accepting this control order, the Transmission Control Un~t s~ts
I i ienable latch within the line adapter of the addressed communlc;ltl.On
I
I ______ J.I ________ J.\line.
No data transfer
occurs.
1.
_____________________
____________________
,_____________________________ .1I
66

~

Section 3:

Read/Write

39

Table

9.

TAM Read/Write: Type Option (Hex and Mnemonic) Codes and Description
(Part 2 of 2)

r------T--------· T---- ---- -- - -- --------- ----- - - --- - --- -- - --- - - ------ -- -------- - -- --- -- - - --,

I Opt ion I Mnemon ic I
I
Icode
I Option I
I
I (Hex) I Code i
DescrIption
I
f-------f--------+------------------ -------------------------------------------------------~
I 67 IENBLSYN IOn accepting this control order, the Transmission Control Unit sets thel
I
I
lenable latch within t.he line adapter of the addressed commwlication
I
I
I
Iline.
No data transfer occurs.
I
!
I
i
I
I 68 !PREPARE IThis order may be llsed in a contention type communication:.; system to
I
!
I
lindicate to the processor when data is arrlving.
When a valid start
I
!
I
Ibit is detected by a line instructed to prepare, a charact.er is strobed!
I
I
i off. If at st.op time the line is at mark, the prepare command is
i

I
I
I
!
I
I
I
I
I SAOONE

69

I

I

I
I

!

IOn accepting t.his control order t the Transmission control Unit sets the I
jterminal control (TC) field within the addressed LeW t.o one, so t.hat
I
Ithe terminal control with the internal address equal to one is
i
lassociated with the addressed communications line.
No data transfer!
I occurs.
I

I

I

I

I

I

I

I

I

I

I

6A

!SADTWO

!
I
I
I

6B

jterminated wit:h channel end and device end st.atus.
The character
I
!assembled is not transfern~d tc the multiplexor channel.
If the line
I
I is at space, a tiweout is started. If the line returns to mark before I
ithe timeout is complete, the prep.'">re command is tcrminate:::i with channell
! end and device end. The prepare command is terminat.ed when the timeout I
loccurs, indicating an open line condition with channel end, device end. I
!and unit check status and intervention required in the sense byte.
I

IOn accepting this control order, the Transmission Control Unit sets thel
ITC field within the addressed LCW to two, so that the terminal control i
Iwith the internal address equal to two is associated with the addressedl
Icommunications line.
No data transfer occurs.
I

iSADTHREEIOn accepting this control order, the Transmission Control Unit sets thel
I
i TC field within the addressed LeW to three. so that the terminal
I
I
Icontrol w).th the internal address equal to three is associated with thel
I
laddressed communications line.
No data transfer occurs.
I

I

6C

iSADZER

I
I
I
I
I BREAK
I

6A

l
i
L ____

IOn acceptance, the Transmission Control Unit will set the TC field
I
I within the addressed LeW to zero so that the terminal control with the I
linternal address equal to zero is associated with the addressed
I
Icommunication line.
No data transfer occurs.
!

IOn accepting this order. the addressed line t.ransmi ts a continuous
I
Ispace signal.
Bytes transferred from the channel to the addressed unitl
i
Imust be all zeros.
To provide control over the length of space signal, 1
l
a
byte count must be sepecified by ____________________________________
the program.
________
i _________________________________
JI

~

Table 10.

~

TAM Read~~rite:
Format

Unit Type Table

r-------·------------------- ------.-- --,
12702 TERMINAL LIBRARY TABLE (TLT) ADDRI:SS

I

12701 TLT ADDRESS

I
i MULTIPLEXER TLT ADDRESS
I
I SELEC,!'OR TLT ADDRESS
I

12701 OR SELECTOR TLT ADDRESS

I
I
I
I
I

I
I

Table 11.

r-----------------------------------------,
11050 TERMINAL CHANNEL PROGRAM (Tep)
I
I
I

I
I
12741 'rep ADDRESS
I
Il ____________________________________
35 TCP ADDRESS
JI
ADDRESS

I

!

t-----------------------------------------~

\Note:
Unit Type Table (UTT) is specifiedl
lin
READ/WRITE.
L- ________________________________________
JI

40

Part I:

TAM Read/Write:
Terminal
Library Table Format (fox- 2702
TLT)

Access Method for BSAM, MSAM, TAM and IOREQ

Table 12.

Table 1}.

TAM Read/Write: Terminal Control Program Format

r-----------------------------------------,
I
I
I

:!'~RMINAL

I
I
I

CONTROL.INFORMA1'ION TABLE

~-----------------------------------------~

I
I
I
I
I
I
I
I
I
I
I
I
I
i
I
I
I

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

CHANNEL PROGRAM INUEX TABLE (CPIT)
CPG DISPLACEMENT FOR TID.

(R)

CPG DISPLACEMENT FOR TIN.

(R)

CPG DISPLACEMENT FOR TCN·

(R)

CPG DISPLACEMENT FOR TID.

(W)

CPG DISPLACEMENT FOR TIN.

(W)

CPG DISPLACEMENT FOR TCN·

(W)

CPG DISPLACEMENT FOR TIA.

(W)

~-----------------------------------------~

I
I CHANNEL PROGRAM GENERATOR for TID.
!

I

CPG FOR TIN·

(R)

I
I
I

CPG FOR TCN·

(R)

CPG FOR TID.

nn

CPG FOR TIN.

(W)

CPG FOR TCN·

(W)

CPG FOR TIA.

(W)

I
I
I
!
I
I

I
I

(R)

I
I
I
i
t
I
I
I
I
I
I
I
I

t-----------------------------------------~

I.All CPG displacements need not be
I
I required for the terminal type. These I
I displacement fields are zeroed and the I
I _________________________________________
corresponding CPG fields do not exist.
JI
~

• An lOCAL is issued, which links to the
supervisor to initiate the terminal
computer communication, under control
of the IORCB CCW llst and through the
IORCB buffer area.
when the supervisor returns control. TAM
rlead/write restores the registers and
issues a return to the user, if the posting
flag is not on.
If the IORCB buffer data area was not
large enough to complete the TAM Read/Write
operation, it is necessary for continuous
IORCBs to be developed for one DECB.
Although the initial TAM READ/WRITE was
from the user. subsequent IOReB ent.ries
would be from TAM Posting until the oper'ation is complete. These TAM Posting calls

TAM Read/Write: Select.ed Termina I control Information Tabl",
Ent.ries

r-----------------------------------------,

IMaximum Option Amount; Begin Cant rol
I
ICharacter Count; Flf·qin Control Charact.er.1

I

IMaximum Cnaracter ,;pt Amount; Polling
ICharacter Count; Pollinq Character::.

I

I
I

I

I
I
I
I
I
I Read End Of Line Sequence Count; Redd End I
10f Line Sequence Character.
I
I
I
IMaximum ~umber of CCW; Addressinq
I
ICharacter Count; Addressing Charactpr:~.
I
I
I
!TAM READ Data Set Length; Control
I
IPrefix Count; End Control Character
I Count; End Control Charact.ers.

ICharacter Table Address.

I

\Write Error; Read Error; Read Error
IPositive Response.
I
! Control Count.; Posi ti ve Response;
\ Characters.

I

IMaximum Count Of Line Control Characters; I
IRead Error Negative Response; Read Error i
\Negative Response Characters.

I
I TAM WRITE Data Set Length.
I

IPolling Response; Addressing Response
ICount; Addressing Response Characters.

I

IRepeat Option; End Of Line Sequence
ICount; End of Line Sequence Characters
I (20 Characters Maximum).

I
I Maximum Buffer

,

I

I
I
I

E. CCW Si ze; End of Card
iSequence Count; End of Card S~1uence
ICharc.cters.

I

ITerminal Character Set Address; Translatel
land Test Function Table Address.
I
IContinue Count; Text Control Character
\Count; Text control Charact.ers .
I
IFailure Count; End of Message Sequence
I
ICount; End of Message Sequence Characters I
1(20
Characters Maximum}.
l __________________
______________________ Ji
~

to this program cause a return to TAM Posting unde:r· di.rect :wn of the posting entry
flag in TOS.
IOREQ Rout.ine iCZCSB)
During the execution of a user's program, where the programmer had originally
issued an IOREQ macro instruction t.o generate an I/O operation on a device, a call is
Section 3:

Read/Wri~e

41

Table 14.

TAM Read/Write: Channel Command
Word Generator Section

r-------------T---------------------------,

I

Name!

Comments

I

~-------------+---------------------------i

ICorrmdnd Code !coIT.wand code for a part.icu- f
IField
Ilar operation. This byte I
I
I is moved into the command I
Icode field of a CCw list
I
Ilocated in the build area
I
!of TOS.
I

I
I
! lJnu,-,ed !"ield lThis field is reserved for I
I future expansion.
I
I
I
iDisplacement IDisplacement of endinq
I
IField
I point to CCWG When
I
Icomrleting a CCW or a
I
!
ireg 0 neration of a
I
I
I~articular command
i
Iqenerator when mult.iple
I
!Flaq Field
I Log ical Funcl tiO'l Code
iField

I
I
I

IIGRCBs are required.

I

I

I

[Flags requ1red for a parti-I
I cular command generator.
I
IRequirE-"i for TAM Posting
I
Iroutine. The byte is moved I
I into the logica 1 function I
I area of TOS.
I

I

I
IBuffer Allo- lriequired in building the
I
! cat ion Flag I CCrri. Allows additional
I
IField
Iroutines to De called to
I
I
I fill in t;le buffer area of I
I
Ithe IORCB when d CCWG is
I

IL_____________ I ___________________________
proces3ed.
JI
~

generated that links to IOREQ. A system
routine way also directly call IOREQ at a
second entry point,.

Table 15.

TAM Read/Write: Channel Command
Word Generator Format

r-------------T---------------------------,
I Sep Table g.
I

I Command Code
I
I Displacement
I

I
! Com~lc,ted
I

I
i
I

I

IFlags
I

by

10,';.

IData chaining, command
\cha1nlng. sup~ress length
lindication, skip, proaram
Icontrol interruption.

I
I
I
!

ILogical FUnc-IOial end control, data out, I
Ition Code
Idata in, lead error
I
I
Iresponse, write error
I

I
I
I
I
I
I
I
I Buffer

I r.::spons ':, "llores;;inc;,

I
I
I
I
I
I
I
I
~~llo- I See Table 16.
!
I _____________
cation F lag
I ___________________________ JI
L
!f-!ollin:J, dldress r<'SDonse,
Ipollir:':1 rEsr..on~;E. control,
lend control, error TIC,
!negative response, write
lerror message.

~

The second parameter word is used only
for entry at CZCSB2.
Data Reference:
CHAISA, CHAIOR.

CHADEC, CHADCB, CHADEB,

Modules Called:
CKCLS (CEAQ4)

Check protection class.

lOCAL (CEAAO)

I/O call.

Exits:
Normal -- Return to calling routine.
Error -- ABEND macro instruction.

IOREQ uses control blocks and buffer
areas that are allocated during lOR OPEN to
build channel command words in the IORCB.
(See Chart BE.)
Attributes:
Reentrant, resident in virtual
storage, closed, nonrecursive, read-only,
privileged.
ent.ries;
CZCSB1 -- Type-2 linkage. Entered from
user IOREQ macro instruction.
-- Type-l linkage.
sy-tem.

~ZCSE2

NCS

I ·1 '" I .1

Of'

IH

I

I

\. 1___-'

IOReB

Entered call by

Input:
Rpgister 1 contains the address of
a two-word parameter list;
'",ord 1

Operation:
A user originally issuing an
IOREQ macro instruction enters IOREQ to
edit the VCCW list.
IOREQ initially saVES
the general registers and then loads them
with pointers to referenced controi blocks.
This starts with the DECB.

The DECB pointer to the DeB is included af,
one of the IOREQ macro instruction
operands, and the other pointers are
described in lOR OPEN.
IOREQ then performs
the following fUnctions:

Address of the DECB.
• Validates user parameters.

Word 2
Address of main storage furnished
by the privileged user for IOREQ portion
of DCB and for IORCB.
42

Part 1:

• Checks that the DCB identification is
valid DCBID=*%*%.

Access Method for BSAM, MSAM, TAM and IOREQ

Tdblp 16.

0uffer i\llocatioll

f'ld'~

BltS 0t CCwc,

-----------T---------------------------------"----------------------------------------------1
I
Comrner,t_s
I
1----+-------------------+--------------------------------------------------------------------------------f
1 48
jRI':,,;(·rv.:,(j tf)r future

1'-1 t ,;

Ndmp

lfl;.u~~t;_.d

f'xPdnsion~

I

I

I 4'1
1

In"qln Cuntrol
I
1

]1

I
',(' I En'i Control

! ~·t.·xt Control

"

I

:'Hf

!1

I

'"

,t.

I

!
I

<.lIP

1 C'ldr-i",-t('n: rf>ql.l.irej~
,(":ll!
chc'ral-tf-r:; r~;quirf' 1 ,i.ftyc pnri control
:_"t-)t
. , fr'_T. itl"'· T:--:r and n,uv€·1 t(' bufft'I area

irlJ
I

I

r(!f"t [

Tt-Jxt

:0 - "J() llc'td

Ollt

1 do ~

1,'ontIDl ,--hilrat_~tpr~, cf:quirl> 1.
contrel clirt.racters requirpj aft.·-:.".r pollin 1 or dddrt-';;slna ha~, bPf'>f,
lnitidt~J4
Chardcters acl?' obtdined fr-oTI' the Tel and movpd to Duftpr ,'l:rPd
CriAIOR.

I

'<~)dt~.,

t

r~nct

11 1

I

I Tl 1

itA I ,,1,.

i~{)

-

I
I
!O -

I
<,

-

i
10 11
I

·}1

!'to rant tol (h(lfdctp{,"S r~'q\liled.
B~'qln {"untr{Jl ('hd:ldt"tpt:-:;
tf'qu;.rt'J ~t'tor~ pnlluvl 1'1 .tddrt-",:~l[lq \.::
~'i'r1L1{'tf'['
HI
(,\Jt,tin{·d frem tht Tel" dnd Ill0v'-'.i t l \ Il',;tl, t d l " d In

10 -

\

char.-'ictf·r~·;.

In the-

ChaIdctCrs

CHA10~.

to tf'rmindl.
Ddt d to hI( rroveJ f rom u~,pr ,1rt'(j (dd.jr,,=,s~-; i.n CriADEcn) to lJut t er dTf ,i 11'1
l'HAIOR ti.JtJ 1:, tl~~tf'd tor function control chdrdctpr~;).
FUnctl"r ~'r-,ntrr;J.
Cllr1rdct('r~~ .-;;r:d r4'1~tl'd cndp:; which ,1rf' not
rcc(;qn~zyrl L'1 diff~'l:Tf,t
tf>rrnln.d
r'nl~
.iH' jpll,tpo trnm tlF("-'~;!:dq"
whpn m(lvpd to tht-' bllftf'I dr.-! If, l-flAU)iC
'Irdn::Ltt i:HI ,i,tt.! to tptminri.l (~hd("dctr'r !'~et ,:0\!1" l.~; dnn .... dt com;)},·tlon ( ) t

-

1

I

tran~;1J.ttl·\i

1

!
I

I

!

C!tA] !)h.

1\:0 ·j,~tJ t rdrr;mit-tpo to cpu.
Ddtd to lIt;- transmittea from tprmindl to CPU.
A bdtft?r <":11:·' i~-: r· ~-I:::'rv(·j if1
t.hp (,kAlOk to <:!ccept t.he mes~j.(jqe.
Th,,-' nle5sdqf~ is not t.P~,tf-'d f(ir func! lun

1 -

~

I

control

~tldr~cters.

Translating data to EBCDIC is dccomplishpJ .n

'I'A~

l-'O:JTING routine.
Error

!W('dG

~5

I ResPJn~~1
I
I
I
I Head E.rror :.f'gat i
I R espanse
I
I
I

:'6

q

, .. rlt.• Error
f K€;S fJOnsf'"

IAddress 1 nq

I

I

',H

IAdd res,,, ng

I

the CHAIO'!.

10 -

:... 0 VJr i te

IlI
I
I
10 t1 I

control characters arp transmitted by the tpTwindl contr()l Ilnit.
Th( cuunt ~s obtained from the Tel and :"'pdce dllocdted in the buffer area ot
the CliAlOR.
I
~rit~·

errur cont rol chardC'"t_ers rf."quired.

~rror

No dddr<'ssing required for a terminal.
P.ddreSS1!Y, r~quireJf obtain dddressing characters from the terminal (~ntry
list (CITRMeNT-addrE-ss located ~n DECBI.
I f not present, dddres';ing
C11.drdcter-.:..; dre obtained from the Tel ~
("har;Jcter~, are placed into thp buff~r
area of thee eHAlOR.

I

I

I
I

11 -

"Jo addressing response required

~

I

A'idrf-'ssiny re-quired, obtain characters 1 rom the TCIB.
into tht buffer area of the CHAIOR.

I
10 -

"0

t

Ie - current cnannt·l cOnun;lnd wc.rd will bf'

I

I
\1

ar0.1

-

10 -

C'tA£dct_f::-rs

aIP

moved

polling response requlred.

11 - Polling requirellinq characters arei
~,bt~inei from the Tela.
Chdracters are plac~d in th~ hufter arPd of the
I
'HA ~"r.

I
RE:Spon:-ie\ 0 -

1

I

I

I

.1

62

I
I

I

I Polling Response

I

I

I

\(' 11 -

i~ollinq

No t.:"'·drl Error :-.It.·qat ive KeslXlnse characters requir-ed.
~.,.;;a-i t,crtJr ;-.ifl-g.ative Rf'sponse characters required dtter transmission of
('PU~
charact-ers arf' obtaln£'d frorr, the Tel -and moved to buffer arPd

to

I

I
I
I

,

11 -

I

i

61

10 -

i
i

I

60

Ve

I

I

'J q

t1 -

t

I
I

-.~o he'ad Error Positive kesl_KHiS€> Chitrdcters required ..
Head ~rror Positive Response characters required dtter transmission llf ddtd
to cpo.
Charact"ers are nbt_ained trom the TeT and moved to bufter arf'd cf
the CHAIOR.

YU;,ltlVeiU

'",4

v~

Inhiolt
Follo~

the ~L~·
currer:'

normal

~he

TC'IB.

(h'vlI?loi~f>~i

characten, are moved

dnd plact-"'l1 Intn tt:e tnli ld

~.

-~"\annel
·.~encp

corrmand word from belnq

df-'veloped~

of CCWG operdtion.

I
11 - ,"Grmal sequence of CCWG is chanqf'd. It permit", return to a PH>v1cusly
I
I
UXf'<'utPQ ceWG.
I
I
b j I fnd
10 - Continu.' normal sequpnce of COl';.
- Terminatps the eCWG list.____________________________________________________ J
lI ____ LI ___________________ L11
____________________________

SE'ction 3:

F:",ad/Writ~,

4 .l

• Checks that the DEB identification is
valid DEBID=. (.
• Stores address of DECB in DCBTMP (work
area).

• A counter cC:'.taining the amount of
buffer SpilCP nt'f'clpd in ttl<' lORen tc)r
redd requp<'t :,~.
FOl' tht'~,f> 1 • «hi
requests, the dmount ot butt",r :~}h~C'" i:;
the contiquous difference betwpen the
high and low-address buffer pOinters.

• Clears the fixed portion of the IORCB.
• Clears the outstanding IOREQ re.
• The DECB is in use (DECB active).
• The queue of pointers in the DEB is
full (DEBNPC is exceeded).

IOREQ then begins the edit phase. This
edit phase consists of a preliminary pass
through the VCCW list pointed to by the
IOREQ macro instruction to determine the
validity of the VCCWs.
In addition, the
amount of space required for the buffer or
page list entries and the VCCW list is
determined.
If buffering is requested by the IOREQ
macro instruction, the following pointers
and counters are also initialized:
• A pointer to the lowest address of a
read request VCCW, used to determine
the low-order buffer address needed for
the read request.
• A pointer to the highest address of a
read request VCCW, used to determine
the high-order buffer address needed
for the read request.
44

Part 1:

Tests are llso made in this edit phase
to assure that chaining rules are not violated.
Chaining rules are listed in IOREQ:
vccw section of Assembler User Macro
InstructJ.ql1~. GC2B-2004:'
If any rules are
violated, a ret,urn to the user occurs. The
user's program has been checked for validity within IOF:EQ but: a system program that
calls IOREQ directly. ent,ers at this second
point and therefore is assumed to have the
VCCW list built correctly without the need
of edi t.ing.
However, on IOREQ recognizing
a system program entrance, it branches to
the previous phase only to set up buffer
addresses and values or to build page list
entries. During this build phase a different sequence is followed depending on
whether or not buffering is specified.
If buffering is requested:
• The start address of the IORCB buffer
is set.
• The buffer total length is set.
• The start of the CCW list is set.
The ccw entries are generated in the
IORCB using the VCCW list as input, and
space is allocated in the buffer area.
In
addition, in write and control requests,
data specified in the fields of the current
vccw are moved into the buffer. If the CCW
is a transfer-in-channel (TIC), the displacement address of the CCW is set to point
to the desired CCW (displacerr~nt is from
CCW origin).
If buffering is not requested by the
user, the appropriate addresses in the
IORCB are set from values calculated in the
edit phase (the previous pass through the
VCCW list). The number of page list
entries is calculated for the privileged
request by a special branch to the initial
edit section. For read, write. and control
requests, the linkage is made from the C~rl
page list pointer to the appropriate page
list entry, by searching through the page
list for an address which has the same segment and page in the CCW.
For bo~~ buffered and nonbuffered
IORCBS, the following also occurs:
• The length of the IORCB is obtained by
adding to the fixed area, the buffer
area (either buffer or page list
entries), and the CCW list length.

Access Method for BSAM, MSAM, TAM and IOREQ

lenqt h 01 thf' IORCll, if gredter
than t_he ma ximum allowed, causes lORE!)
to return to the user with an error
code in register 1~.

the laC flag in the last vce".
It
set, this lORCB must be chdined to the
next IORCB.

.. The

.. Test

.. This pass through the VCCW list moves
the op-code count, and flag fields to
the appropriate CCW list entry in the
IORCB .

.. Move the DECB address into the queue by
updating pointers to this DECB as well
as updating the number of IORCBs and
DECBs that are outstanding.

.. The protection key and other flags are
set in the lORCB.
The system programmer that entered at
the second entry point now returns with a
return code of zero in register 15. Hence
to execute his lORCB, the system programmer
must update the required fields and issue
his own lOCAL. The sequence IOREQ follows
for the lOREQ macro instruction user is:

.. Dete.rmine if the IORCB is not to be
executed so that the DECB can be placed
in queue and marked intercepted.
.. ISSUE! the lOCAL macro instruction.
.. Return to the user.

Section 3:

Read/Write

45

SESTIO~4:

POSTING AND CHECK

POSTING AND

~HECK

PROCESSING

The following routlnes describe plsting
and error processing for SAM, SAM di:rect
access, MSAM, TAM, and IOREQ. and the
operation of the Check routine.

Reset (CEEAH> -- Permit task to access I/O
device.
SYSER

(CF~IS)

-- System error processor.

Exits:
Normal -- Return to task monitor.
Error -- An ABEND is issued if the I/O
device is not tape or disk. A SYSER is
issued if:

This routine processes a synChronous I/O
l.ntJ'rrupt ion cau~;ed by the termination of a
:;AM I/O operat~ion.
It_ post_s the completion
code in the event control block CECB) of a
data eV~"nt control block (DECR).
In addition, depending upon tne device, this rout_ine may perform ot.her post-I/O activities,
r;uch as adjust.ing magnetic tape block
counts.
The retry/recovery operations are
also incorporated into this routine; they
are employed if the channel status word
(CSW) returned at the most recent. interruption reveals an abnormal end condition.
(See Chart CA.)
Attribut.es:
Reentrant. nonrecursive, resident in virtual storage, privileged.
Entry Point: CZCRPl -- Main entry point
via type-l linkage.
The channel status word (CSW) and
sense information pertinent to the I/O
operation are contained in the ISA.

J~ut:

Data References:
CHADEC, CHADEB, CHADCB,
CHAIOR, CHAISA. CHASDA, CHASDT.
Modules Ca.lled:
VMER (CZRX2) -- Virtual memory error
recording.
VMSDR (CZCRYY) -- Virtual memory statistical data recording.
(CZACP1) -- Abnormal task
termination.

ABEND

')1£

(CZCJTQ)
mon it_or.

Build queue in task

WTO and WTOA (CZABQ1) -- Write message to
operator.
ASCII Translation (CZCWA1) -- Translate
ASCII data to EBCDIC.
DA Error Retry (CZCRH1)
error retry routine.
46

Part I:

Direct_ access

• A program check has occurred.
• A protection check has occurred.

• A specification error has occurred.
• The

CS~

has a status of X·OO'.

• There was no entry for the SDA.

• A command reject occurred because of
an invalid op code.
Operation:
SAM Posting exarrtines the completed IORCB and either posts the DECB or
passes control to a device-dependent error
routine.
completion of the requested I/O is signalled by the device via an I/O interruption that is associated with the lORCB by
the Supervisor.
The completion information, along with
the lORCB, is passed back to the requesting
task as a synchronous I/O interruption
enqueued on the TSI. During the interval
between request and response, the task
could have generated other I/O requests,
and possibly had its time slice ended.
SAM Posting requires that all interruptions be maSked.
It will process a synchronous I/O interruption to cc.mpletion,
regardless of the interrupted operation.
SAM Posting will process only one synchronous I/O interruption at a time for a
given task.

The I/O Supervisor is expf'cted to return
unexecuted lORCBs when there is an I/O
interruption caused by hardware failure, a
unit check, or a unit exception condition.
SAM Posting expects the following fields
of the CHADEC Table (DEeB) to be zeroed:
ECB, BSJ, 581, Sa2, FLG, CSE.
Under error
conditions, it examines BSF to determine
how many sense bytes from the ISA are to be
saved for user reference. These are placed

Access Method for BSAM, MSAM. TAM and IOREQ

in the last field of the DECB (normally BSF
will contain X'02', indicating all eight
sense bytes are to be saved).
For the Control routine (CNTRL). IORCE,
Rewind, and Rewind and Unload, thE' DECB
pointer in the IORCB wl11 equal Z!~r<). The
Check routine will clear the Error flag in
the DEB to zero upon return from the user' s
SYNAn routine.
In handling the I/O synchronoul: interrUption, the task monitor performs short
save to provide working registers, dnd
executes a type-l call for the appropriat.e
posting and error recovery routine.
SAM
Posting is the proper routine for SAM.
SAM Posting first determines if the
10RCB has been executed. An IORCB would
not be executed if the preceding I/O operation for that device had resulted in an
abnormal completion.
(Such a check must be
done to handle error conditions properly
when multiple IORCBs can be outstanding for
one device by one task.)
If the lORCB was
not executed, the 10RCB is reissued (via
lOCAL), or the DECB is posted to indicate
-Intercepted- status. The choice depends
upon whether the preceding condition was a
permanent error.

NORMAL COMPLETION:
If the lORCB was
executed, a test for normal completion is
made.
If normal, the event control block
of the DECB is posted to indicate normal
completion. SAM Posting also performs
other optional services which can only be
done after completion of the I/O operation:
• Data Movement - Movement of data from
an lORCB buffer to the user area for an
input operation can be requested by the
user.
• Magnetic Tape Block Counts and Unit
Exception Flag - SAM Posting increments
(for forward tape movement) or decrements (for backward movement) the proper counts. The routine also sets
appropriate flags for unit exception
conditions.

If the 1/0 was not normally completed,
further tests are made and control is
passed, if necessary, to device dependent
error recovery routines which, if possible,
will issue a retry 1/0 request.
Each of
these device dependent error recovery routines subsequently returns to thE posting
routine.
UnrecoveraoJe (Hardware) Error Ccmpletion General (non-device-depenaent) Processing:
If the CSW information associated with the
executed IORCB does not indicate completion. the routine searches for an immediate
hardware indication of unrecoverable error.
If the error or condition is not yet.
considered to be unrecoverable, the routine
will issue a Reset SVC to 105. The purpose
ot t.he Reset SVC is to "unlock" the device
queue previously "locked- by the I/O
Supervisor.

If the error is unrecoverable, the
appropriate flags, addresses and counts are
set.
Recoverable Error or Exceptional Condit.ion
(non-Error) completion - General Processing: This condition is indicated by the
Unit Check or Unit Exception flags.
Recoverable Error or Exceptional condition
Completion - Device-Dependent Processing:
If possible. depending on the device, N
retries over the original path and also N
retries over 3 alternate paths will be
made, until a successful retry or until the
set maximum of retries is reached.
In the
latter case the failure is termed a -hardfailure.
The VMER routine is called to
record data associated with this -hardfailure.
Appropriate flags are set, messages are
put out, counters are incremented, information is saved, and routine linkage is
effected.
pevice-Dependent Error Procedures:
The
following are general notes on the device
dependent error procedures:

• Direct Access Read Variable Length
Record and Pending C.W.E. Flags - The
routine will perform the appropriate
address movement and flag setting.

Error indication:
When certain malfUnctions occur, the CSW will contain more than
one error indicator. Generally, only one
of these properly describes the malfUnction
while the other(s) indicate secondary
effects. Similarly, some devicelcontrol
Unit errors can cause more than one sense
bit to be present.

OTHER THAN NORMAL I/O COMPLETION:
105 will
lock the device to further I/O by this
task, until a Reset SVC is issued by SAM
Posting. This Reset SVC. when issued. will
set off the suppression flag so that the
task may resume I/O activity on the device
in question.

9riginal and alternat.e path retries:
For
some error conditions, there are no original path retries.
However, there are always
alternate path retries. An original path
retry utilizes the same channel and device
as that used in the original erroneous 1/0
Section 4:

Posting and Check

47

operation. An alternate path retry uses
the same device, but goes through a different channel.
Number of retries: The number of retries
is dynamic; the installation, howevEr, not
the user, determines the threshold number.
In the descriptions of the error retry procedures, in most cases N == a + b where a is
the threshold number, and b is a constant
for that particular approach to recovery.
User's SYNAn routine:
If appropriate, SAM
Posting will set the SYNAD flag in the
user's DECS. The user's SYNAD routine is
his own -error- routine.
It does not,
however, attempt error recovery on I/O
devices, but rather determines if the user
want.s to terminate or continue processing.
Return codes from error recovery routines:

2.

IORCL -- CCW list length; increment by
the number of additional CCWs
appended.

3.

IORST -- Relative origin of ·start
CCW W •
Modify this field in accordance
with the error retry procedure.

4.

lORSC -- lORCB Software Command Chain
flag set if addition to the CCW list
requires it.

MAGNETIC TAPE - 2400 TAPE SERIES ERROR
RETRY PROCEDURE: The device-dependent
error procedure for the 2400 tape series is
described as follows:
Unit Check (CSW bit 38): The routine
checks the sense byte information to determine the cause of the unit check condition.
Sense byte information will be found in
segment 0, page 0 of virtual storage.
Next, the routine checks the corresponding
bit position in the IMSK field of the DCB.

00 - Retry in progress.
04 - Permanent error encountered, no
retry.
08 - Normal completion.

OC - complete with error without retry.

Load Point Sense Bit Only: The rout.ine
will set Complete With Error in the ECB,
set on the Error flag, and move the CSW and
the first two sense bytes from segment 0,
page O. to the DECB. The tape block count
will be decremented by 1 and DEBMSK in the
DEB will be incremented by 1.

10 - complete with error after retry.

Load Point and/or Other Sense Bits Set:
Rebuild of the lORCS:
The IORCB will be in page O. segment 0
of virtual storage (that is, within the
interruption storage area). The issuance
of an error retry IORCB will consist, in
the main, of initializing certain fields
automatically. conversion of the ccw list
from real core to virtual storage
addresses, appending of the CCW list if
required, and initialization or modification of other fields within the IORCB.
The
purpose of these actions is to provide lOS
with an input lOReB, that is, an lORCB with
no main storage references, and no past
action flags set (such as start I/O
failure) •

1.

Bus Out Check (Byte 0, bit 2) -- The
retry will consist of repositioning
the tape, if required, and a repeat of
the failing CCW. If tape motion takes
place and the failing operation is a
forward or backward space of record or
file the error will be deemed unrecoverable. The routine will set the Per·manent Error indication in DCBIFL. set
the Permanent Error flag in the DEB,
and provide a return code of '04'.

2.

Equipment Check / I I"
I I I
! flag in the DECB
I
I I I
l " I ,; I
I Move csw to DECCSW
I
I I I
I Move sense bytes 0 and I,; I " I
11 to DECSBO and DECSBl I I I
I
I I I
ISet Error flag,
I "I I"
I DEBNF1. to 1
I I I
I
I I I
I Decrement DEBIOC by 1 I" I " I "
I (Allowed IORCB o/s
I I I
I Count)
I I I
I
I I I
I Move data from lORCB
I" I v I v'
Ito user virtual storI I I
I age, i f required
I I I
I
I I I
I Device-dependent termi-I " i " I "
Ination processing
I I I
I
I I I
I Normal Completion
I Iv I
1""7F' set in DECECB
I I I
I
I I I
I Link to VMSDR -- after I I" I
Isuccessful error retry I
I I
I
I 1 I
I Link to VMER
I I I"
I
I I I
I Clear DEBNFl to zero
I I" I
lafter successful error I
I I
I retry
I I I
I
I I I
I Set DCBIFL Error ReI I" I

I >/
I
I
I"
I
I
I
I
I
I
!
I"
I
!
I"
I
I
I
I "
I
I
I
I"
I

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
!
I

!

I
I
I
I
I
! I
I I
I I
I I
I" I
I I
I I
I" I
I I
I I
I I
! I
I I
I I

!

I
i
I
I
I
>/

Icovery in Progress in- I
I I I I
Idication=O after sucI I I I I
IL _____________________
cessful error ret.ry
I I __ .lI __ .lI __ .l.I ___ JI
.L-..cJ.

CONTINGENT ADDITIONAL PROCESSING:
In addition to that processing which occurs with
each error retry attempt. the following
contingencies may be encountered and the
ensuing processing involved.
Channel Data Check ()311. 2314, 2302) ~
Original path error retry is attempted.
Each t.ime an alternate path is requested,
the channel status byte of the CSW will be
moved from (0, 0) to IORCSB in the IOReB to
be used by the VMER rout ine.
Unit Exception: The Error flag is set on
and a test is made for a corresponding
DEeB.
1.

If a corresponding DECB exists, DECECB
is set to indicate complete With
Section 4:

Posting and Check

51

Error, the CSW is moved from th~ ISA
to DECCSW. and two bytes of sense
information are moved from the ISA to
DECSBO and DEeSE1.

2.

If a DECB does not exist and this is
not a retry IORCB, a return code of
'oct is set in general register 15
before exit.
Otherwise, when a DECB
does not exist and this is a retry
IORCB, a return code for VMSDR interface is set prior to ex~t.

Cha~l1j.ng

Check:
Thexe will be N original
path error retry attempts consisting of
repedting the original CCW list.

Incorrect l.R.:..!l9:!J!: The aC1:.ion tal<.I?..Il in this
case is contingent upon the format of the
record being processed clS indicated in
OCBREC. The possible logical paths and
actions performed are:
1.

Unknown - normal completion is indicated by a return code of 'OS'.

2.

Variable - if the residual count of
CSW is equal to zero, Complete With
Error is set in the DECB. the SYNAn
Requested flag is set, the Error flag
is set in t.he DEB, the CSW is moved
from (0. 0) to the DECB, and the
return code is set to • OC·.

If the residual count of the CSW is not
equal to zero, a comparison is made between
zero, and the difference obtained by subtracting the sum of the CSW residual count
and the 'LL' count from the CCW count.
If the result of subtraction is 0, the
return code is set to 'OS'; and Normal Completion processing will take place.
If the
result of subtraction is not 0, ·Complete
With Error- is set in the DECB. the SYNAD
Requested flag is set, the error is indicated in t.he DEB, the CSW is moved from (0,
0) to the DEVE, and a return code of 'oct
is set.
Unit Check (2311. 2314, 2302): The number
of retries over the original path is dependent upon t."le type of error which caused
the urut check condition.
Examination of
the sense byte data will. indicate the error
cause.
Prior to any diagnosis or error
retry, the appropriate bit in the DCBIMK
field of the DeB is tested against the
f;orresponding bit set in the sense byte
data.
If the bit is off, further procesSing will be that as contained above for
DCBIMK corresponding bit equal to zero.
If
the bit is set on. diagnosis and retry continues as follows:
EqUipment Check (byte 0, bit 3) -- There
is no original path error retry.
The
52

Part 1:

alternate path error ret.ry wi 11 consist of
repeating the original CCW list.
No Record F'ound (byte 1, bit 4) - - When
the Missing Address marx€'r (byte 1, bit 6)
is also set, there are N orlginal path
error retry attempts.
For d 2311 t.he error
retry prOCEdure consists of a Restore CCW
followed by a TIC to seek the original
address.
If the Missing Address MarKer bit is not
set, there are N original path error ret.ry
attempts.
Initially this error retry procedure consists of verification of the home
address.
This is done by comparing the
CCHH of the home address stored in the
IORCB against the CCHH of the search argument.
If the comparison indicates equali··
ty, an ABEND sit.uation is encountered. The
routine performs termination processing by
setting on the Error and Permanent Error
flags. setting ABEND Requested in the DECB ,
and setting the return code to 'Oct in general register 15.
If the CCHH comparison indicates an
inequality, the error retry procedure will
be as indicated when the MiSSing Address
marker is set.
Seek Check (byte 0« bit 7) ~- I f Command
Reject (byte O. bit 0) is also set. an
ABEND situation is encountered, and a
return code of X'12' is set before return.
If Command Reject is not set, there are N
original path error retry attempts.
Intervention Required (byte 0 .. bit 1~ -A message will be sent to the operator to
ready the device and execution of the COW
list will be resumed from the point of
interruption.
Bus Out Check (byte 0, bit 2) -- The
original path error retry attempt will consist of repeating the original CCW list.
Data Check (byte O. bit q) - - There will
be N original path error retry attempts
consisting of repeating the original CCW
list. After unsuccessful retries, if there
is a data check in the count area, the routine abnormally terminates.
If there is a
data check in the count area, and the Read
Variable Length Records flag i55et, and
the failing CCW is t.he last in tre CCW
list. t.hen terminatcion processing will be
in accordance with the ret urn cod e in general reaister 15 set to ·Oq'.
If the foregoing • AND' situation does nat occur the
Error and Permanent Error flags, DEBNF1 and
DEBNF2. are set, and an ABEND is effected.
When error retry has been exhausted for
data check and there is no check in the
count area, then overflow Incomplete (byte
1, bit 7) is checked.
If there is an

Access Method for BSAM. MSAM, TAM and IOREQ

·Overflow Incomplete- condition, processing
will be as follows:
a.

Add 1 to 'HH' of seek to seek to next
consecutive track.

b.

Set R=l in search argument.

c.

Set 'CCHH' of search from 'CCHH' of
seek argument.

d.

Append CCW list 'B' to origin featu:re.
If
retry over the same path is unsuccessful.
an alternate path is requested and a message sent to the operator.
The error is
recorded as intermittent when successful or
a~, solid when unsuccessful for a path.
The
error is processed the same for each path.
~'xcept t-:ach alternate pat.h is tried once
(PRBITS).

If Unit Check - Intervent.ion Required is
tht error, and the DeB for type is D or S
(that is, form-sensitive), the operator
will be sent a message to ready the printer.
The SIR macro instruction will be
issued to handle the expected asynchronous
interruption.
The error recovery in progress flag will be set on in the DEB and
contI·ol wi 11 be returned to the task monl.tor.
When the operat.or signals correction
of the error condition by hitting the stop
button followed by the start button. the
asynchronous inter~lption will occur.
Posting will be entered at its second entry
t~int (ClCMG2), which was specified in the
Specify Asynchronous Entry Condition macro
instruction ICB.
The virtual storage IORCB
will be reissued beginning wi th the failing
ccw, the number of outstanding IORCBs
incremented by one, and control returned to
the calling program.
For form type-F, a
message is sent to the operator directing
him to mark the error page. The fixed area
of the IORCB is moved from the interruption
storage area to the DEB page.
The address
of the ICB in the DEB page is stored in the
OCB, and the V- and R-con for posting entry
2 are stored in the ICB.
The SIR macro
instruction is issued to service the
expected asynchronous interruption, the
error recovery in progress flag is set on
J.n t.he DEB, and control is returned t.o the
t.ask monitor.
After the asynchronous
interruption occurs. processing is identical to that done for error recovery on form
type F for the printer after an equipment
or data check (INITSEL - PRBITl - PTRINT SETASYN2

-

SETASYNC).

Unit C,-h~ck~s Out is caused by a
parity error on a cormnand (initial select.ion) or data (data transfer) byte.
Each
path is retried the number of times specified in the SDT; when the maximum is
reached, the failing path is recorded via
VMSDR, a message is sent to the operator
58

Part I:

the failure. and tbe IORCB is rels.
Unit check - sense failed error is recorded via VMSDR, permanent error is posted,
CHKINTM and WTO are called (TSTDUC).

Unit exception - first, intermittent
errors are recorded using the CHKINTM subroutine. Then, if receive mode, the first
byte of the buffer is checked for an EOT.
(An EaT will be found if the operation was
completed in the previous buffer but there
was no room to write the EOT, or if a card
jam occurred just as the buffer was being
completed.) If there is an EOT. the
DCBENOF flag is checked, and if on normal
completion is posted.
If off, it indicates
either a card jam or the 'STOP' button was
pushed. The operation will then be set up
to be handled by an asynchronous interruption (SKPINTM - TSTEOF - CHKSAIN).

If the first byte of the buffer does not
contain an EaT, then the data buffer being
read at the time of the interruption is
checked for ETX or ETB. This check will be
made at the middle of the buffer (byte 83)
if IORJEOC is on, or at the end of the
buffer (byte 167) if IORJEOC is off. If an
ETX, the operation has completed normally,
DCBENOF is set on, and normal completion is
posted.
If ETB is found, either a card jam
has occurred or the STOP button has been
pushed. Setup will be made for an asynchronous interruption. If neither ETX or ETB
is found, a minor software SYSER is posted
{SETEOF - CHKSAIN - RJEMSERl>.
For unit exception transmit mode, incorrect length is checked.
If off, normal
completion is posted. If on, either a
paper jam exists or the printer was stopped
by pushing the stop button.
In either case
Section 4:

Posting and Check

59

the operation is set up for an asynchronous
interruption (CHKFORM).
Incorrect length errors are recorded via
VMER, any intermittent errors are recorded
and a message is written to the operator
Vl.a WTO infor-ming him of the permanent
error (CHKIL>.
Control unit end, program check. chaining check. and protection c~eck errors are
posted as permanent errors, intermittents
are recorded, and a message is written to
the operator via WTO (CUEND - CHAINCHK).
Attention, status modifier, and busy
errors are handled the same as incorrect
length (09) (BUS¥CHK - ATTNCHK - STATMOD).
If none of the status bits are found on
a minor software SYSER is called
(RJEMSER2) .

Input: The IORes and the ISA contain
information relative to the condition under
which the I/O operation was terminated.
Data Reference: CHAISA, CHAIOR, CHADEC,
CHATOS, CHADCE, CHADEB, CHA SDA.
Modules Called:
GETBlJF (CZCl"A) -- Get a but fer area.
WRITE (CZcn) -- TAM Read/Write.
WTO (CZABQ -- Write to operator.
RESET Ssinq then continues with
post control.
If the Data-In logical function code is present it performs the previous action and also branches to the DataIn processor.
This Data-In assures that a
user buffer area is available, and translates and moves data to this buffer area
when required. It is the initial Dai:a-In
ccw, in the CCW trace list, that detf'rmines
the user buffer area requirements.

Table 18.

The Data-In processor is entered if
t.here is a Dat.a-In logical function '.n the
CCW list.
The Data-In processor codl.ng
determines input bufter length, detemmines
~nput bU£fe.r processing requirements, translates input data when required, moves data
to user buffer area. and maintains input
data bookkeeping.

I Option
I ignored
I

IA=S
IL=N

!L=N

IA=S
I LFS

TAM Postinq:
IJser Buffer

Specifir:at1.on of

r---------T-------,.--------------------,

I

DCB
i
DEeB
I
Comment s
I
t----------+---------+--------------------~

IOption

IIFC

I ignored
I

I
I

!

!

I

I

IConversational move,
I dynamic buffering
I length is twice
I standard termindl
Ilength.

I
I
I
I
I

t----------+---------+--------------------~

I

I
I

The input buffer length and processing
requirements are determined by doing a
translate and test of the input data. The
dat.a in the translate and test table (ZATDIT) contain" onlv one funct.ional charact;cr, at present, which senses the end of t.he
input dat.a record.
The ZATDIT functional
character code is used to do a table lookup
ior t.he processing routine to be called.
The data in the processing control table
(ZATDIC) is provided for this purpose and
contains the location of the end-of-record
processor.
This end-ot-record processor
det.ermines i t translation of the input data
is required and translates the data to
EBCDIC when necessary.
The translation
t.able address is obtained from TOO.
If the
lield is zero, no translation is required.
One error condition may be determined as
a result of the translate and test.
This
is an input buffer overflow and exists when
the tennl.nal operator inputs a single record length greater than the specified length
for the terminal.
This condit.ion will
cause the Master Exception flag in the
Posting flag field of TOS to be set, and
the Input Buffer Overflow flag bit to be
set in the flag field of the DECB. When
the translation requirements are completed
the message is checked for the end of line
(EOL) sequence of the input record (illustrated in Table 19).
It is determined that the terminal has a
specified EOL sequence when the EOL
sequence count in TOS is other than zero.
62

Part I!

IDynamic buffering.
I Length is stated
I value""N (from OCB).

I
I
!

j

i-----------+-.-------+-------------------~

I
I L=N

I
I

I

I

I
!
I
Ivalue=N (from DCB). I
IDynamic buffering

1 (f rom OCB).
I Length is stated

r--- ------+---------+ ----- -------------.-~

!BUFTEK=DYNI LFN

IDynamic buffering

I

I (from

I
I
I

iLength

! ignored
If TAM Posting issues the GETBUF macro
instruction to obtain dyna.mic buffer areas,
the user must return these buffer areas,
when processing of the input data is
complete.

I
I
!

t----------t---------t-·-------------------i

IBUFTEK=DYNIIFS
The user may supply the necessary buffer
area, by specifying in the TAM Read/Write
macro instruction, the address and length
of this area.
The user may also specify,
in other parameters in this DECB or in the
DeB, that dynamic buffering is requested.
(See Table 18.)

I Jynamic buffering.
ILength is stated
Ivalue=N.

i

DCB).

ILength is stated

I value=N.

I
I

t----------+---------+--------------------~

IOption
I ignored

IA=addresslBuffer address is
I indicated.
I Length is stated
Ivalue=N.

I
I L=N
I

I
I

I
I
I

I

t----------.l---------.l--------------__ ~

I L - LENGTH
I
I L=S - implies length in
I

I
I
OCB.
I
I
IDynamic Buffering - Buffer obtained by
I
I POSTING and address passed to user in
I
IDECB.
A user is therefore responsible
!
Ifor returning these dynamic buffers by
I
lusing a FREEBUF.
I
l __________________..______________________ 1

Table 19.

TAM Posting:
Sequence

Expected EOL

r--------------------------T--------------,
Terminal
I
sequence
!

I

~------------.--------------+--------------~
IIBM 10~O
ICR, B
i

I

I

!

I

i

I

IIBM 2741

(IBM 1052-1
lTTY MOD 35

JCR, C

f

INaNE

ICx, L.F., XOFFI

t---------------·-----------+-------------~

carriage Return

ICR

-

I
IB
I

- End of Block

IC

I
I
I

I
I

!

- End of Transmissionl

I

I
I
I
I
!XOFF
- Transmitter Off
i ______________ I
l __________________________
jL.F. - Line Feed

Access Method for BSAM. MSAM, TAM and IOREQ

~

~

---

When a successful comparison cannot be made
the device type code is obtained from the
TOS and used to do a table lookup for the
abnormal EOL routine for that device.
':'he IBt4 1050 and 27(11 use a cemmon
Abnormal End of Line routine and it. is
entered whenever the ending sequEnce is
other than the expected. The routine will
determine one of four possible conditions:
1.

2.

3.

4.

B--EOB character only -- Normal allowable ending which may indicate card
input of inter-line record formatting.
Detection of this condition will inhibit the placing of the New Line code
character in the data record and will
return to the normal program flow.
Last character received is C--EOT -If this character is received the Unit
Exception flag in the Post Flag field
in the CHATOS is tested, and if set,
the Message complete flag will be set
and the return is to normal Data-In
processing flow.
If the Unit Exception flag is not set, the Attention on
Read and Master Exception flag are set
in the Posting flag field of the CHATOS and the Attention flag bit in the
Pre-Post Data field in the CHATOS is
set. control is then returned to the
normal Data-In processor flow.
Neither B nor C -- The Master Exception flag in the Posting flag field of
CHATOS is tested.
If on, control is
returned to the Input Data processor
to allow the record in error to be
moved to the user buffer area.
If the Master Exception flag is not
set, an undefined system error has
occurred and control is given to the
undefined error routine.
Should the
record length prove to be greater than
the user the user buffer remaining
count field, that portion of the record equal t.o the user buffer re..maining
count is moved to the user buffer
areas, t.he User Buffer Overflow flag
in the flag field of the DECB is set,
and the master exception flag bit in
the posting flag field of the TOS is
set.
Normal processing continues with
control being returned to the CCW
trace list as if no user buffer overflow had occurred.

If the EOL sequence comparison is successful the first character of the EOL
sequence is overlaid with an EBCDIC new
line (NL) character and the record length
is adjusted to include the text plus the NL
character. This record length is then compared to the user buffer remaining count
field of TOS.
If it is equal or low, the
Iecord is moved from the input buffer to

the user buffer area. The user buffer
pointer, user buffer remaining count, and
input character count fields in the TOS are
updated.
Control is then returned to the
CCW trace list.
The CCW trace list coding continues for
each logiccll function by~_e until the enti~e
CCW list has been processed. When the last
CCW is processed, we continue processing
with the proper post control coding as
determined by the option type-code
reference in the post control table.
The functions of the post control routine coding are to determine the proper
posting and cont.rol for:
• Read operation entry
• Write operation entry
• Write with response entry
• Control order entry
If a read request is complete within
this IORCB, the area and length are moved
to the DECB and cOIlUl1on DECB posting continues. If the read is not complete, TAM
Read/Write is called.
If a write is complete within this
IORCB, common DECB posting continues.
If
the write is not complete, TAM Read/Write
is entered as a subroutine.
If the write with response is complete
within this IORCB, the data in the buffer
bit in the Posting flag field of TOS is
tested.
If set, the Message Complete flag
is set in the Post flag field and control
is transferred to post control read.
If
the data in buffer bit is not set, enter
TAM Read/Write is entered as a subroutine.
If write with response is not complete,
TAM Read/Write is entered as a subroutine.
If a control order entry. common DECB
posting continues.
Common DECB posting
ends post control by making an initial test
of the Master Exception flag in the Pm,ting
flag field of TOS.
I f set, the ECB field
of DEeB is posted complete with error and
the synad request. is set in the DECB flag
field.
If the Master Exception flag is not
set, the ECB field of DECB is posted COffi"plete without error and the pre post dat~a
field is moved to the DECS flag field.
Common DECB posting t.hen moves CSW and
sense data from ISA to DEeB.
If the Master
Exception flag is set, TAM Posting does not_
allow entering TAM Read/Write as a subroutine but continues with common DECB
posting.
Section q:

Posting and Check

63

After completing cornmon DECB posting the
housekeeping completion routine coding is
executed.
The hou"eK:pepinq funct"ion
incl ndes:
.. kecordin'j unrec-uvprabl,' errDr data
• Recording recovered prror delta
• Clearing error counters and error data
fields
• Preparing line on abnormal end and
return
.. Issuing status of IORC8 and return
" Setting up nonT..'!1 return to task
monitor.
Note that Tl,M Posting does not issue an

ABEND.

On determining any exception or
exrOl: condition. the a ppropria te i nf orma'lion is posted in t.hf' DECB and at the proper time a reLurn is made t.o Task Monitor.

Only if TAM Post.ing camlOt determine a
path to .follow will it issue a SYSER.
TAM Posting provides exception analysis
(-error decoding and recovery actions. The
processing of all exceptions except attention inter~Jptior0 posts all data to the
u::;er, whenever error· recovery is not indicated or possible.
The following flags may
be set in TOS to communicate unrecoverable
termtnation status to the user via the DECB:
.. Unit Except.ion flag - set when a function is terminated by unit exception,
.. Master Exception flag - set whenever an
exception interruption has terminated
t.he action.
.. Abort flag - set whenever maximum error
recovery at"t" empts have been
unsuccessful.
.. Attention flag - set. whenever attention
signalling is detected during a read
type operation.
.. Recovery III Progress flag - set whenever an error recovery action is
initiated.
An example of Start I/O (SIO) failure
follows.
The SIO Failure flag in the IORCB
15 inLf'..rrogated hy the Define Interruption
coutine.
If the flag is found to be on,
transfer is made to the SI0-HIO failure
processor.
The status in the CSW is then interrogated to see if a unit check or unit exception has occurred.
If either bit is on,
control is turned over to the proper pro64

Part I:

cessor.
If neither bit is on, a message LS
sent to the system operator informing him
of the Start I/O failure and the. associated
:-;ymholir devicp .
The ABEND Required and SYNAD Requf'sted
flags ace set in the flag bytps of the
DECB.
The ECB f ipld of t.he DECB i::; set to
indicate ·complete with error R •
A branch
to the Housekeep and Return subroutine
occurs.

The t.wo types of outboard failures are
unit check and unit exception.
Each has
its own control routine coding whose purpose is to determine the recovery action tee
be ini tia ted.
Each of the recovery routines is coded to operate for unique combi-nations of conditions.
As an example of error recovery on unit
check. TAl'; Posting starts with the int.errupted CCW obtained t"hrough the data provided in the ISA and the IORCB located in
the ISA.
The sense byte bits in the ISA
are then tested in a predetermined
priority.
When a test" is found to be positive. a
counter located in TOS which represents
that. sense condi tioD is stepped and tested
for a maximum count.
Refer to Table 20 for
CSW status and sense data t.ypical 'l1laximu:r
Except.ion retry' counts.
When any sense condition retry counter
is stepped to maximum, the Abort flag is
set to indicate an unrecoverable condition,
the failures are recorded, and TAM Posting
branches to conclusion housekeeping.
If it
is a recoverable condition the internal
recording saves pertinent error data in
TOS.
After this recording, the Unit Check
Director routine coding is entered. to
access the Unit check Recovery routine to
be initiated as determined by the interruption conditions.
The Reinitialize IORCB subroutine is
provided to be used by all unit check
action routines.
Prior to entering. all
altering of the channel program and buffer
data is completed.
This routine initializes all relative addresses in the IORCB,
sets the necessary flags, and issues the
IOCAL macro instruction.
TAM Posting then
sets up for a return to task monitor.
The following describes typical unit
check recovery routine coding provided:
Ret. ry Full IORCB on System Error:
This
action is used where the channel program
has been terminated in such a way as to
require a retry ot the full program or
posting of a system error which is unrecoverable. The routine will first test the
Abort flag in TOS.
If set, it will set a

Access Method for BSAM, MSAM, TAM and IOREQ

Table 20.

TAM Posting:

CSW Status and
Sense Data Typical Maximum
Exception Retry Counts
(Extracted from CHASDT)

IOREQ Posting Routine (CZCSE)

r---------------------T-------T-----------l
!
CSW Sratus
IBit No.IR,1 by tilt' T.ISk
Monitor to IOREQ Po~;tiny to I'fOC.,,;!; t hi,~
I/O interruption.
The addrpss ot 10REQ
Postinq is specified by the posting addre~~!;
constants in the IORCB.

~

Attributes:
Reentrant, resident in virtual
storage, closed, nonrecursive, read-only,
privileged.
Entry Point~:
linkage.

CZCSEI -- Entered via type-l

Input:
None.
Information relative to the
conditions under which the I/O operation
was completed is in the lORCB and the ISA.
Data References:
CRADCB, CBAIOR.

CBAlSA, CHADEC, CHADEB,

Module Called:
Reset (CEAAH) -- Resets
error flag so that task can access I/O
device.
System Error and ABEND Requested flag in
the DECB and enter the CCW trace list routine.
If the Abort flag is not set, the
routine will set the Retry in Progress flag
in TOS.
The Reinitialize 10RCB routine is
then entered.
System Error Retry from Interrupted CCW:
This action is used whenever a system error
has occurred and it is necessary to restart
the program from the interrupted CCW. The
Abort flag in TOS is tested.
If set, the
routine will set an error condition in the
DECB and enter the CCW Trace List routine.
If abort is not set, the Retry in Progress
flag will be set.
The relative location of
the interrupted CCW is saved and the Reinitialize 10RCB routine is entered.
Record Only: This action is used when an
error has occurred which will not effect
channel program operation, but must be recorded as a system history.
It also may be
used when the terminal is not equipped with
error correction.
A branch occurs to the
CCW Trace List routine.
Unit exception. for example, can be
caused by a negative response from the
1050, either during addressing or I~lling.

Exits:
Normal -- Return to calling program.
Error -- ABEND macro instruct_ion.
Q£eration:
10REQ Postinq initially saves
the general registers.
A check is made to
verify that the 10RCB has been executed
(that is, the channel program has been
attempted) •

If the 10RCB was not executed, a check
of the Error flag for the correspondiTlg DEt'
(pOinted to by the lORCB) is made.
If the
error flag is set, an intercepted conditior
is set in the ECB (pointed to by the JORCB)
of the DECB.
The allowed lORCB count field
in the DEB is decremented by 1 an a return
to task monitor occurs.
If the error flag
is not set, an exit to ABEND occurs.
If the lORen was executed, the csw is
moved to the DECB, the ISA sense information is moved to the DECB, the allowed
IOReB count in the DEB is decremented by 1,
and the input dat.d in t.he IORCB data buffel
area, if buffering is used, is moved to the
data area in the user virtual storage
pointed to by the DECB.
Section Q:

Posting and Check

65

I f START 1/0 failed 'Complete with
Error' is posted, DECBSF is set to show SIO
failure, SYNAD is requested. and the IORCB
count decremented. The return code is set
to zero and a return to the task monitor is
effected.

Exi t.S:
Normal -- Returns to the ca lli:1q
with zero in reqister 1S.

Plv(lTdIT

other conditions -• If a SYNAD condition, rpturns with:

The CSW bits dre examined and. depending
on their s('ttinq, normal or error complf>-·
t.ion i!; post<:'(L
If the CSW=O, ABEND i!;
re<~uP!ltecj and el'ror and permanent error
f lag;.; set in th .. DElL
IOREQ Posting doe:;
not perform dny error recovery.
For normal completion, -norl'oal completion" is posted in the ECB of DECB, and a
ret.urn to the task monitor occurs.
For abnormal completion, ·complete with
error- is posted in the ECB of DECB, a
request is set for SYNAn in DECB, the error
flag is set in DEB, and a return to the
task monitor occurs.
Check Routine (CZCRC)
The Check routine is entered as the
result of the CHECK macro instruction that
a user issues to ensure the completion of a
previous READ or WRITE macro instruction.
To determine completion or other results,
Check examines the DEeB.
SAM Posting and
Error Retry will have posted information in
the DECB if the 1/0 operation is complete.
If not complete. Check awaits completion.
On completion (successful or otherwise),
normal return, an ABEND, or set-up for entry to a user's SYNAn routine occurs,
depending on switches set by SAM Posting
dnd Error Retry.
Check also calls SAM
Mainline EOV for necessary end-of-volume
processing.
If end of data set is encountered, Check sets up entry to a user's
EODAD routine before returning to the
caller.
Attributes: Reentrant, resident in virtual
storage, closed, privileged, nonrecursive.
Entry Point: CZCRCS -- Entered via type-1M
or type-2 linkage.
Input:
Register 1 contains the address of
the DECB to be checked.
Data References:
CBADCB.

CHAnEC, CHADEB, CHASDA,

Modules Called:
SAM Mainline EOV (CZCXE) -- SAM EOV mainline processing.
SAM Read/Write (CZCRA)

SAM Read/Write.

AWAIT (CEAP7)

Await an interruption.

TWAIT (CEARO)

Terminal 1/0 wait.

66

Part I:

Register
Rpql.,;tf'r
Rf"llstf'T

0 -

UECB

1

8 ··I-n

-

1') -

dJdrps~

t

;;'U~",lJ

Ad<1[fd;:,

(If

list. contrllninq u~;"r',;
dnd R-con addl'esses.

r,)d.,
!,,'!rd!1lpt

SYNAD

"r
V-cor)

• If an EO DAD (end of data set) condition, returns with:
Register 1 - DCB address
Register 15 - Address of parameter
list containing user's EODAD V-con
and R-con addresses.
• ABEND occurs if EODAD or SYNAD exits
needed but not provided. Requested by
SAM Posting and Error Retry.
I/O
requests checked out of sequence.

If the In-Use flag to the DECB
is not on, Check has been entered to check
a DECB for which no I/O is outstanding.
Therefore, control is immediately returned
to the calling routine.

~ation:

When the DECB is in use but the 110
operation is not complete, the AWAIT macro
instnlcticm is issued to wait for the
expected 1/0 event to complete.
When the I/O event has occurred; the
DECB is checked for errors. The task will
be abnormally terminated when the SYNAn or
EODAD exit is to be given control and i t h;
not supplied.
Note: When an intercepted DECB is checked
and it has an end of volume request post.ed .
in it, end-of-volume proceSSing is performed as explained below.
However, if the
intercepted DECB has no end-of-volume request this means that the 1/0 associated w~th
the DECB was never attempted. Therefore,
Check links to the ReadlWrite routine to
reissue the 1/0 request.
Check waits until
this request is complete before doing any
other processing.
If complete with errors is posted, and
if there is a unit check caused by reading
backwards into a load point, the end of
volume processing is performed as explained
below.
If the DECB is marked complete with
errors, and there was no read backward into
load point, this means that an I/O error
has occurred, and the system retry procedures cannot correct it.
The Check routine
first tests the ABEND bit (in the DECB), if

Access Method for BSAM, MSAM, TAM and IOREQ

thE.' data :~,>t is s(~qupntiiilly orq.Jniz,>d.
on, thi!; m"dTl!; t 11,lt t h .. ,'[ror I!; ,",It,I!;--

11

:;pond 10 end 01 ddtd set, t
Ut'.('J\ which Cdll~,,'d til<'

~:OV

1

ht' read realle~~t
(''lu('st i:; .

trophic, and the ta!;k: cannot continu('.
ABEND is then callpd.
If the AB~ND bit is
off, then the SYNAD requEst flag (in DECB)
is tested, and the user's SYNAD exit is
entered.
If SYNAD is not on, a normal
return is given to the user.

ed.
:;hould it be d wri t.E' rpt]lh',;t
OECH which causes the EOV condition, d
normal return is made to the calling routine with the DECB marked "Complete, No
Errors".

If the data set. i3 not sequentially
organized, the Check routine proceeds as
df'scribed above for the case in which the
ABEND bit is found off.

Note that. when condit.ions arise which
require a branch to SYNAD or EODAD, the
Check routine only sets a pointer to the
R-con and V-con of that routine in register
15, and returns to the calling program.
The point returned to will be within the
expansion of the CHECK macro instruction.
If general register 15 is zero, the next
sequential instruction after the expansion
should be given control.
If non-zero, the
succeeding instructions of t.he expansion
must set up a type-l linkage with the supplied R- and V-type address constants.

~d-of-Volume Processlng:
Check: calls the
tvlainline EOV rout.i ne which performs various
end of volume processes and will do volume
switching if necessary. When control
returns to Check, if t.he end of volume
corresponded to end of data set, the user's
BODAD exit is set up ( i f supplied).
When
the end of volume condition does not corre-

rp~;t.drt

Section 4:

Posting and Check

67

SECTION 5:

CLOSE

CLOSE PROCESSING
The following routines describe the
CLOSE processors for SAM, MSAM, TAM, and
lOR, as well as Close Common and MSAM
Finish.
close Common Routine (CZCLB)
The Close Common routine will logically
disconnect the data set from the rroblE'JIl
program, close the data control block, and
relinquish main storage.
It then branches
to the appropriate access dependent close
routine to complet.e the closing.
 is entered.
When Finish is first entered on output,
and an error was recorded by a user-issued
PUT, no attempt will be made to flush the
buffer. Otherwise, if no error occurred,
the device type determines the line of
processing.
For a printer, a PUT is issued to write
the last buffer page. If the PUT is not
yet complete, the return code is set to
-incomplete R and the routine returns to the
caller.
If the PUT is complete but an
error On a Finish-issued PUT is indicated,
the user will be provided with error pointers if this has not_ already been done
(error recovery will be attempted if the
error indicator is set off), and control
returns to the caller with the Finish-JustIssued flag on, the Finish-in-Progress flag
off, and a return code indicating "complete
with error" in general register 15.
Otherwise, the message -Remove output
from printer XXXX, then ready printer" or
-Remove output from punch XXXX, then ready
punch" is sent and the routine awaits
70

Part I:

operator rpsponse.
However, if the combine
opt-ion is indicated, an IORCB for a card t_o
be read and stacked in pocket 3 is built
and executed before this message is issued.
For a punch, a blank record is constructed and PUT in order to force the last
card into the stacker.
If this punching is
incomplete, control returns to the user
with general register 15 indicatinq -incomplete".
If tne punching is complete with
error, another PUT is issued to obtain
error pointers for the user if this has not
already been done (error recovery will De
attempted if the error lndicator is set
off) and control returns to the caller with
the Finish-Jnst-Issued flaq on, the Finishin-Progress flag off, and a return code
indicating "incomplete with error" in general register 15. If nO error occurred in
the punching, processing continues. as with
the printer, at the PUT for flushing the
last buffer.
For subsequent entries to Finish, the
path taken depends on the value of DCBRCX
as set by the previous FINISH.
DCBRCX=30: Completion of input is being
awaited.
If the input operation is not yet
complete, the routine returns to the caller
with the return code indicating "incomplete".
If the input operation is complete
with error, the completion routine (see
DCBRCX=80 below) is entered.
If the input
operation is complete without error processing continue~, at. the message-defining
loop.
If any of the DECBs are marked corr~
plete with no errors and a unit check is
indicated, the message wRemove output from
reader XXXX, t_hen ready reader" is sent and
operator response is awaited.
If a unit
exception is indicated, the message "Remove
output from reader XXXX" is sent and Finish
enters its completion routine.
If there
are no such DECBs, the message sent will
instead be "Remove input/output from reader
XXXX, then ready reader."
DCBRCX=40: Finish is awaiting completion of the PUT. Processing continues as
if Finish had just issued its PUT to write
the last buffer page.
DCBRCX=60: Awaiting an asynChronous
interruption (operator response). The
interrupt_ion has still not occurred, so the
return code is again set to indicate
"incomplete- and the routine returns to the
caller.
(Not~ applicable to RJE.)
DCBRCX=80:
End of wait for the asynchronous interruption. This condition is
caused by the occurrence of the interruption or by the user's turning off the
FINISH-in-Progress bit before the interruption was received. The completion routine
is entered, the FINISH-Just-Issued flag is

Access Method for BSAM, MSAM, TAM and IOREQ

set, the FINISH-in-Progress flag is turned
off, the appropriate return code indicating
·complete- is set in general register 15,
and the routine returns to the caller.
(Not applicable to RJE.)

Entry Point:
CZCMIl -- Entered from Common
Close via type-l linkage.

DCBRCX=50: A wait for a card to be
stacked in pocket 3 when the device is a
punch and the combine option is indicated.
If there are any outstanding IORCBs, the
card-read-and-stack operation is not yet
complete so the R15 return code is set to
-incomplete- and the routine returns to the
caller. Otherwise, if no errors were recorded on the card-read-and-stack operation,
the message ·Remove output from punch XXXX,
then ready pUnch- is sent and operator
response is awaited.
If an error was recorded, the message sent instead will be
-Feed card from reader YYYY, stack in pocket 3, remove output from punch XXXX, then
ready punch.(Not applicable to RJE.)

Data References: CHAnCB, CHAnEB, CHADEC,
CHATDT, CHASDA, CHAICB, CHADBP.

Asynchronous Interruption Entry Point
(C2CMH2) Processing! This interruption is
caused by the operator changing the device
state from -not ready· to -ready·, the
response required following the issuing of
a message.
(This routine is not entered
~ ring an RJE task.)
The DCBRCX field is set to indicate that
the interruption has occurred. The DIR
macro is used to delete the interruption
routine and control is passed to the calling routine with a return code of zero in
general register 15.
Synchronous Int.erruption Entry Point
(CZCMH3) Processing:
This interruption is
caused by the completion of a read, feed
and stack in pocket 3 operation when the
combine option is indicated.
(This routine
is not entered during an RJE task.)
Errors occurring during the I/O activity
may result in limited retry, depending upon
the type of error. Any final error is recorded in the DEB.
Except when a retry is in progress, the
number of outstanding IORCBs is reduced to
zero and then. in all cases, a return code
of zero is set in general register 15, and
the routine returns to the task monitor.
MSAM Close Routine (CZCMI)
MSAM Close calls Finish to complete output if necessary, to attempt recovery from
an error on a previous PUT, or to indicate
end of data group to the operator. MSAM
Close frees pages of virtual storage
obtained by MSAM Open.
(Chart DO.)
Attributes: Privileged, reentrant, readonly. public, system, nonrecursive.

Input:
Register 1 contains the address of
the DCB.

Modules Called:
MSAM Finish (CZCMH) -- Complete output and
indicate end of data group.
OIR (CZCJD) -- Delete an active interruption routine.
FREEMAIN (CZCGA) -- Release virtual
storage.
INTINQ (CZCJI) -- Interruption inquiry.
AWAIT (CEAP7) -- Await an interruption.
RJELC (via SVC 232) -- Disconnect RJE line
control.
Exits:
Normal -- Return t.O caller.
Error -- ABEND macro used for abnormal
termination.
Operation:
If the DEB is invalid, MSAM
Close abnormally terminates.
Finish is called to assure that I/O has
been completed.
If it. has not, the routine
goes into the wait state (using AWAIT)
until the I/O is complete.
FINISH will
then be reissued. This process will be
repeated until all DECBs have been checked
for I/O completion.
If Finish is awaiting
an asynchronous interruption the INTINQ
macro will be issued. If Finish is in the
process of stacking a blank card, Close
will wait until that operation is complete.
The interruption will then be dispatched
and FINISH will be reissued unt.il a return
code is received indicating that the operation is complete.
In an RJE task, the
INTINQ macro will not bp issued (Finish
does not field an asynchronous interruption
during an RJE task) and the test for a
blank card being stacked is bypassed.
If
an unrecoverable error occurred on a PlIT,
FINISH is reissued in order to attempt
recovery before informing the user of the
error.
The SDAT malfunction flag is set on if a
permanent error is indicated.
The DEB
pointer in the JFCB is Te.moved. and the DIR
macro instruction is used to delete any
active interruption routine. The DIR is
bypassed in an RJE task (BULKIO specifies
and deletes interruption routines for RJE).
RJE line control will be disconnected if
the device is a remote printer and the
Section 5:

Close

71

installation operator will be notified at
his console via a VITO macro.
If the DEB indicates USer read-write
protection class, two FREEMAIN macro
lnstructions are issued to free the two
noncontiguous groups of virtual storage
pages obtained by MSAM Open.
If user-readonly or user-inaccessible protection is
indicated, a si"91e FREEfllAlN is issued to
free the contiguous pages of virtual
storage obtained by MSAM 0f~n.
The DEB pointer in t.he DCB is removed,
and control returns to Close Common.
'J'AM Close Routine (CZCYQL
TAM Close is ca lIed by Close Common if a
user desires to close a TAM DCB, because of
ABEND requirements for a task to be closed.
or as a result of a LOGOFF command.

In continuing the close processing from
Close Common, TAM Close is called to perform additonal closing functions unique to
This includes freeing the
control blocks and buffer areas obtained
during TAM Open and performing the disable/
enable function at logoff time.
TAM Close
then returns to Close Corr~on except when an
abnormal end is required in which case it
goes to ABEND or SYSER.
(See Chart DE.)

TAM terminals.

Attributes:
Reentrant, resident in virtual
storage, closed, read-only. privileged.
Entry Point:
linkage.

CZCYGl -- Entered via type-l

Input:
Register 1 contains the address of
a two-word parameter list:
Word 1

Address of DCB being closed.

Word 2

Address of associated JFCB.

Data References:
CHADCE, CHATDT. CHASDA,
CHADEB, CHAISA. CHADEC.
Modules Called:
Write (CZCYM)

TAM write.

Check (CZCRC)

Check.

VMA (CZCGA) -- Free virtual storage.
ABEND (CZACP) -- Abnormal task termination.
WI'O

(CZABQ) -- Write to operator.

SETAE (CEAMO

Set asynChronous entry.

ADDEV (CEAAC)
list.

Add device to task device

RMDEV (CEAAD)
device list.

Remove device from task

72

Part I:

XTRCT (CEAH3)

Extract TSI field.

SYSER (CEAIS)

System f'rror.

Exits:
Normal -- Return to callinq routine.
Error -- 1.
2.

ABEND macro instruction.
SYSER.

QFP::.!ati0ri:
TAM Close initially saves the
general registers.
The Recursive Call flag
is tested to prevent a recursive loop
between TAM Close and ABEND.
If t_he flag
is set, it indicates that this is a recursive call.
This means that just prior to
this entry 1:0 TAM Close (through Close Common) from ABEND, and exit from TAM Close to
ABEND occurred. TAM Close therefore does
not proceed but only clears the Recursive
Call flag and branches to ABEND.
If the Recursive call flag is not set,
the opened DeB count in SDAT for this terminal is decremented by 1 (for this DCB)
and the number of opened DCBs that are
still open for this terminal is examined.
If the number is positiVe, the pages of
virtual storage created for this DeB are
freed, and the pointers that were set during TAM Open are removed.
(See TAM Open
Figure 4.)
A return is then made to Close
Common.
If the number is zero, processing continues.
(This indicates there is now no
opened DCB for this terminal.)

If the number is negative, the recursive
call flag is set, a count of zero replaces
the negative number and processing continues as if there were a zero count.
Processing continues with this terminal
no longer having any opened DCB. A test is
made to determine if the interruption
storage area (ISA) flag is set with ABE~~
2.
If it is not, TAM Close continues test.ing the terminal to determi.ne the type of
close.

If it is set, then TAM Close immediately
goes to the final steps of a close.
Note:
ABEND=2 indicates that the entry to
this closing came from ABEND and, after the
closing, a return is made to ABEND. When
this return is made, ABEND retains control
of the terminal.
Testing continues at this point to
determine the type of close by verifying
that the terminal is defined and, if so, if
it is on a 2702.
If it is defined and is not on a 2702,
TAM Close proceeds with the final steps of

Access Method for BSAM, MSAM. TAM and IOREQ

a close. bypassing the disable/enable function.
(The terminal defined in this manner
is the operator's terminal; a 1052-1 direct
connection to til., multiplp-xor channel.)
If it is supported and is also on a
2702, then the disable/enable function is
required.
Initially, after che,::king that
the device has not, been phased out, processing takes place to provide a SYNAD address
for the disable/enable function. The SYNAD
address in the user's DeB is saved in a
temporary area wi thin TAl'l Close and is
replaced with a TAM Close SYNAD address.
Should any I/O operation fail during the
disable/enable function the SYNAD will
either declare a minor SYSER software error
or abnormally terminate the task.
In all
error cases the task is abnorm.:;,lly terminated. At this point the terminal is
disabled and TAM Close must then enable the
line.
In order to enable the line, TAM
Close reopens the DCB (by setting the DCB
open flag) that was previously closed in
Close Common.
After performing the following functions, TAM Close closes the DCB
again with the disable/enable function completed and the user's SYNAD address
replaced. The following functions are
required in order for TAM Close to enabl(?
the line:
• The disabled terminal must be added to
the task.

• Due to normal completion of a task.
• Due to ABEND requirements for a t.ask to
be closed.
In continuing the close processing from
Close Common, lOR Close is called to perform additional functions for these
devices.
lOR Close waits until all outstanding DECBs have been completed and then
frees the lOREQ work area, DEB and IOReB.
lOR Close then returns to Close Common.
(See Chart OF.)
Attributes: Reentrant, resident in virtual
storage, closed, read-only, nonrecursive,
privileged.
Entry Point:
linkage.

CZCSDI -- Entered by t.ype-l

Input:
Register 1 contains the address of
a two-word parameter list:
Word 1

Address of DCB being closed.

Word 2

Address of associated JFCB.

Data Reference:

CHADCB, CHADEC. CHADEB.

Modules Called:
VMA (CZCGA) -- Free virtual storage.
AWAIT (CEAP7) -- Await an interruption.

• Asynchronous interruptions must be
ignored when the disabled terminal is
connected to the task.
• The terminal control unit must be
restored to the initial SAD order.
• The line is then enabled.
• The terminal is removed from the task.
If it is not defined, then the Recursive
Call flag is set and TAM Close proceeds
with the final steps of a close, bypassing
the disable/enable function.
In the final steps of a close, the pages
of virtual storage created for this DCB are
freed and the pointers that were set during
TAM Open are removed (see Figure 4).
A final test is then made of the Recursive flag.
If it is on, a message is
issued to the operator and ABEND is
l-nvoked. If it is not on, a return is made
t.O close Conunon.
lOR Close Routine (CZCSD)
lOR Close is called by Close Common:

DIR (CZCJD) -- Delete asynchronous interruption requests pending.
Exit:

Normal return to calling program.

Operation: lOR Close initially saves the
general registers. The address of the DEB
(DeBDEB) is obtained from the DCB. A test
for any unchecked DECBs is made.
• If there are no unchecked DECBs
(DEBNPC=O>, processing continues by
determining the area to be freed.
• If any DECB is unchecked (DEBNPC~O)t
the address of the last DECB in t,he
queue is obtained (from DEBDEL). The
AWAIT SVC is moved into this DECB and
the lOR Close executes (EX> the AWAIT
in this DECB.
lOR Close then waits
until this last DECB is posted complete
(DECECB), and then processing continues
by determining t:.he area to be freed.
In determining the area to be freed the
size of the DEB is added to the size of the
IORCB and then a FREEMAIN macro instruction
is issued to free the area. The final step
of lOR Close is to return to Close Common.

Section 5:

Close

73

SECTION 1>:

ROUTINES

~;PECIFICALLY

DESIGNED FOR 8SAM

Operation:
The text of the 'Operation' is
keyed to the labelS of Chart EA.

LABEL PROCESSORS
The following routines describe tape and
direct access input and output label
processors.

The Tape Volume Label routine is called
by Device Miinagement to read a tape volume

idbel, or to rewind and

un~oad

a tape.

It

may also be called by Device Manageroent or

the LABEL command routoine to write a volume
label (Chart EA).

Entry Points:
Ent_erect too read the volume label.

CZC'WXl

Entered to rewind and unload a

CZCWX2

tape.
CZCWX3 -- Entoerect to write the volume
label.
Regi~;ter 1 contains the address of
the following parameter list:

1!1f:l!!:

Word 1

Address of tne SDAT.

Word'
Address of an 80-character label
buffer.
Word 3 -- Address of a i-byte field containing the density setting.
Word 4 -- Address of a i-byte field containing ASCII/EBCDIC indicator (X'20'
ASCII; X·OO· = EBCDIC).
Modules Called:
Control (CZCRBS> -- Rewind, rewind and
wlload, write Tape Mark, or backspace.
GETMAIN (C2CGA2)

Get a work page.

Read/Write (CZCRAS) -- Read a block, write
a label.

CZCRAS reads the label for a Read option
and returns on normal completion or returns
a code as described under 'Exits' (CA004C CA008A) .
CZCRAS writes a number of tape marks if
the first word of the buffer is blank, or
writes a label.
An American National Standard format label is written where ASCII is
specified. The label write will be followed by a write of tape marks.
If CZCWX
was called by pause, two tapemarks are
written; otherwise, five tapemarks are
written (via five calls to Control) {CA004
- CA004A - CAOOa - CA005E).
If CZCWX was called by PAUSE. the file
is backspaced past the tape marks.
If nat
called by PAUSE, it is rewound and unloaded
(CA005F - CA005ri).
At CZCWX2. a temporary DEB is created
dnd CZCRB is called to rewind and unload
the tape.
Various return codes reflect the possible READ/wRITF errors.
(See 'Exits'.>
Tap~_Ddta

Set Label Routine (CZCWY)

This routine reads and writes data set
header and trai~er labels on magnetic tape
volumes. , Error checking is provided after
reading labels.
User label routines are
called if required. Provision is made for
reading and writing labels in either standard IBM or American Nationa~ standard formats.
(See Chart_ EB.)
Attributes:
Reentrant_, resident in virtual
storage, read only, public, privileged,
system, nonrecursive.

Exits;
Return Code
00

14

A Read is e:ltered at CZCWXi, a Write at
CZCwX3.
Tape Recording Technique, density,
BPI are set ll :;CHIOA, which p~)int!1 t.o ilTl
60-byt~ butter a.rt'ltl.
.l-'ieldH of .special
l.ntereut. reached through CHASeS:
DCGOFG (Open Flag - DCBO)M) which may
contain:
o
Data set being opened or closed.
1
Data set open, EOV proce.ss.
DCBOFG (EDT Flag - DCB06M) which may
contain:
o
Process on basis of open flag.
1
EOT occurred while writing EOF
labels - write EOV this time.
DCBOPT (Option - DCBSU2) which may
contain:
o
Standard IBM labels (EBCDIC
user) .
1
American,ational Standard labels
(ASCII us cd .
TDTLAB (Labels .- TDTSUM) which may
contain:
o
No user labels.
1
Process user labels.
Data References: CHASCB, CRADeB, CRADEB,
CHADEC, CHAISA, CHALBl, CHALB2, CHASDA,
CHATDT.
Modules Called:
BSAM Read/Write (CZCRA) -- Read or write a
physical record.
Control  beginning of t.he tape is encountered,
an abnormal end is made. If the label is a
volume label, another read is issued.
If
the label is not a volume label, and is not
a fiDRi, EOV1. or EOf'l label, an abnormal
end is made.
I f the label is l:lDR1, EOV1, or EOf'l, the
block count is stored in the DCB. The
DSNAM subroutine is entered to check the 17
least Significant characters of the data
set name against those in the JFCB. The
user is notified through the PROMPT macro
inst.ruction when the data set names in the
label and the JFCB do not agree and given
the option to continue or to terminate by
an abnormal end.
If t.he generation/ver,jion numbers are
not correct, the user, as above, has the
choice of terminating or continuing.
The next label is read and the read is
checked.
An abnormal end termination is
made if a read error occurs. If a tape
mark is read during a read backward operation, the routine backspaces the tape to
position it for a data set read.
If the
label was an HDR2. an EOF2, or an EOV2, and
if the record format, record length, and/or
block size in the CHADCB are zero, t.he rt'll
called for an end-of-tape condition, and an
EOVl is placed there.
The remainder of the
label is created and written by a branch to
the Build subroutine.
Build writ.es the two
trailer labels in <,;i ther standard IBM or
American Nat.ional Standard label format.
The SUL subroutine is called if user
labels have been requested.
Control ie.;
called to write a tape mark and p08iticn
the t.ape.
Normal return is then made to
the caller.
Build Subroutine: This rout.ine builds 80byte out.put header and trailer labels f01
tape volUJ1!e data sets and writes them by
calling BSAM Read/Write.

USt~r

SUL

out:e..ut Header Label ProceSSOL CCZCWY3):
'I'hi s routine checks the currently mounted
output tape to see if the expiration date
of any data set currently on the tape (and
about to be oveIlaid) has been reached and
oversees c.rer

GeDerat.ioD

held of CHASD"

I

I CHASCB I
i
I
I
I
I CHATl7I' I
I (JFCBl I
I
I
t CQATOT I

!

PlUIIbe[

I
!
t

I
I

Vol\lallt" Sequence

DaU Set Sequence

I Name in th~ Job Fi le
I Cont [01 Block

1

except fcr the buffer offset field which
must be filled in for the American Nat.ional
Standard format.

I
I

t--------------------~--------~--------~-------------------------4

Il ____________________________
TOTAL
16 Bytes
.. _______________________ JI

Section 6:

A more detailed discussion, including
tables, of both standard IBM and America"
National Standard label formats, is contained in Appendix A of Data Management
Faci litie~~f GC28- 2056.
SUL ~;ubroutine: This routine reads and
writof's user labels. Standard IBM format
user!; may have a maximum of eight user
labels; ASCII users, who must conform to
the American National Standard label format, are allowed in TSS/360 to have a number of user labels limited only by the physical extent of the tape volume.
Initially, the routine calling c;UL will
have placed UHLl (user header label) or
UTLl (user trailer label) in the label
buffer. SUL will then determine from a
code passed in register 1 whether to read
or write.
If a user label is to be read,
the Read subroutine will be branched to for
reading and checking a user label.
An
abnormal termination will occur if the
label read is neither a header or trailer
label. The user's label processor will
then be called.
Wnere a label is to be written, the
user's label processor will be called first
to build the rest of the label in the la bel
buffer. and then SUL will cause the label
to be written and checked.
If the user is nonprivileged, his USEr
routine is not called directly; he gains
control through the Leave Privilege
routine.
When thE user labels have all been read
or written (a maximum of eight for EBCDIC
users, no maximum for ASCII users), return
is made to the routine which called SUL.
Check Subroutine: This routine is entered
following a return from BSAM Read/Write to
check the I/O operation results and det.ermine further processing.
Check inspects various fields and flags
in the data event control block and sets
the return code as follows:

Routines Specifically Designed for BSAM

71

,----------------------------------T-----'
I
OPERATION CHECKED
I
I
I
I Code I

t-------------------T-------------~Rtn.

!

I

READ

WRITE

~---------.-----------+---------------+----~

I Normal Complete

I Normal Completel • 00'
I
I
I
I • 04'
I
i
I Error
I 'OS'
I
I
I Intercepted
I • DC'
I
I

I

jUnit Exception

IError
i

! Intercepted
I

I
I
I
I
I
I
I
I

jUnit Check
IUnit Exception /'10' I
I (Beginning of
I
I
'I'ape)
I ________________ .I. _____ J!
lI ______________________
J..

Figurp
If the operation is intercepted, the
routine sets a counter so that a maximum of
50 interceptions on t.his operation is
allowed before the return code is set to
t.he error code.

If the operation is not complete, the
AWAIT macro instruction is used to allow
the operation to complete.

The Direct. Access Input Label processor
reads standard direct access user header or
trailer la.bels. and provides linkage to a
user label processing routine as specified
in the DCB exit lisL
(See Chart EG.)

Attributes:
Reentrant. nonrecursive, resident in virtual storage, privileged.
~ntry

Point:
linkage.

CZCXNl -- Entered via type-l

Input:
Register 1 contains the address of
the SAM communication block.
Data References:
CHAISA.

CHASCB. CRADEB, CHADCB,

Modules Called:
Message Writer (CZCWM) -- Message processing and ABEND processing.

8.

Obtain Keys and Label I/O Areas

area.
When a file mark i~5 read, or the
user returns a zero code from LVPRV, the
routine places a zero code in general
register 15 and returns control to the
invoking program.
If the exit type in SCBEXT is not for
input user header or trailer labels, the
routine sets a unique ABEND code in SCBABN,
and links to the Message Writer for ABEND
termination.
If there was a hardware error while
attempting to read a label, the message
~XXXX LABEL UNREADABLE, ENTER N TO READ
NEXT LliBEL, B 1'0 BYPASS LABELS OR E 'ro END
THE TASK" is sent to tone Llser via the Mes-sage Write~ routine.
If the user replies
-N·, and there have not been eight attempts
t.O read labels, reading of the next label
is attempt_ed.
If eight attempts have been made, or if
the user replies RB", control is returned
to the caller with a zero return code in
general r~gister 15.
If the user replies
BE", the routine sets a unique ABEND code
in SCBABN and calls the Message Writer routine to perform ABEND termination.
DA_gut~bel

Obtain/Retain

(CZCFO)

Routine (CZCXU)

-- Obtain DA user

labeL

LVPRV (CZCJL) -- Leave privileged state.

The Direct Access Output. Label processor
provides the user with the facility for
building and writing standard user labels
on a direct access device.
(See Chart EH.)

Exit:

Normal --

Return to caller.

Attributes: Reentrant, nonrecursive, resident in virtual storage, privileged.

Error -- Call Message Writer to do ABEND
processing.
Operation: Standard user labels are read
via Obtain, and, if the user is nonprivileged, processing is provided for via
the Leave Privilege routine (LVPRV).
Figure 8 shows Obtain keys and Label IIO
78

Part I:

Access

~ethod

Entry Point:
linkage.

CZCXUl -- Entered via type-l

Input:
Register 1 contains the address of
the SAM communication block.

for BSAM, MSAM, TAM and IOREQ

Callpdl
i.vPRV (CZC.IL)-

rvlodul~s

LpdV(' p..-lvilc-Qf·(j :ltatt~.

Obtain/Retain (CZCFO) -- Retain DA user
label.
Exits:
Normal -- Return to caller with '00' in
general register 15.
Error -- Register 15 contains '04'.
Operation: If there is a label track in
the first extent of the data extent block,
and an output label type is specified in
the CHASCB, and the exit type is active,
the user is given the facility to build
labels via the Leave Privilege routine, and
to write labels via Retain, until the user
passes a zero return code in general
register 15, or until eight labels are
written. At that time, a file mark is
written via Retain.
(See Figure 9 for the
RETAIN keys and the LABEL I/O area.)
If the exit type specified in the CHASCB
is not for output header or trailer labels,
a unique ABEND code is set in the CHASCB,
and control is returned to the caller with
a return code of '04' in general register
15.
If Retain returns with a code other than
zero in general register 15. a unique ABEND
code is set in the CHASCB, and control is
returned to the caller with a return code
of '04' in general register 15.

The }>'orce End of Volume rout.ine terminates the processing of the current
volume of a data set, and prepares for the
processing of the next volump.
It accomplishes this by in1 t iot inq tht· r:nd of Volum ..
(EOV) rout.int':;.
(!~"t' Ch.ltt FA.)
Attributes:
Reentrant, I:t'sident in virtual
storage, closed, privileqed, read-only,
public.
Entry Point: CZCLDF
or type 11M linkage.

Entered by type 1M

Input:
Register 1 contains the address of
the OCB.
Data References:

CHADCB. CHADEB.

Modules Called:
SAM Mainline EOV (CZCXE)-end of volume processor.

SA~

Mainline

QSAM FEOV (CZCSA) -- QSAM forced end of
volume processor.
Exits:
Normal -- Return to calling routine.
Error -- ABEND macro instruction.
Operation: Force End of Volume abnormally
terminates the task via the ABEND macro
instruction for any of the follOWing
reasons:
• OCB identifier is not valid.
• Data set is not physical sequential.

rov

PROCESSORS

• Data set is not on magnetic tape or DA.

End of volume processing consists of
tape and direct access input and output EOV
routines, mainline and 'forced' EOV routines, and concatenation and check processors. The EOV routines are entered as the
result of one of two conditions: end of
data set or end of volume.

UHL (n)

UHL (n + 1)

or

or

un

UTl (n + I)

(n)

Use, 'obet key

Retoin k..y

4

Figure

CCHHROOO

4

9.

• Not all BSAM DECBs have been checked.
Control is returned to the calling routine
when the input DCB is not open.
Should all of the above tests be passed
and if QSAM. QSAM FEOV is entered.
If not
QSAM, or on return from QSAM FEOV, the FEOV
flag is set on and the Mainline EOV routine
is entered. When Mainline EOV returns to
Force End of Volume, control is then
returned to the calling routine.
Note the function of this routine is
mainly performed by Mainline EOV.

Miscellaneous

Direct Ace ....

User Data

Address

76

8

Retain Keys and Label I/O Areas
Section 6:

Mainline EOV Routine (CZCXE)
Mainline EOV performs as a control program to End of Volume (EOV) processing. It
oversees the modifying of the DEB, label
processing, volume switching, determining
end of data set. concatenation proceSSing,
Routines Specifically Designed for BSAM

19

<'lnd pdut;ing contrul to uSPC label exit routine!;.
(See chart Fll.)
Attributes:
Reentrant, resides in virtual
storage, clospd, read-only. privileged.
Entry Point:
linkage.

CZCXEl -- Entered by type-l

!~.!:

Register 1 contains the adjress of
the DCB causing EOV involvement.
The PSECT
contains CHAses and three temporary control
blocks for use in the I/O operations of
label processing.

References:
CHAnCS,
CH.ATI1l'. CHADEC, CHAISA.

2~ta

CHA~EB,

Ca~SCB,

l"iOdules Called:
V/'f.J\ (CZCGA) -.- Get virtual storage, free
virtual storage.
Build Common DEB (CZCWB) -- Restore the
common portion of the DEB.
Volume Sequence Convert (CZCwv)
address convert.

DA Output EOV (CZCXI) -- Direct access
input end of volume processing.
Tape Output EOV (CZCXO) -- Tape output end
of volume processing,
Tape input end of

User Prompter (CZCTJ) -- communicate with
user.
AWAIT (CEAP?) -- Await an interruption.
Exits:
Normal

initiali~es

the temporary

by SAM EOV.
End of data set is indicated
for non-concatenated unit-record data sets.
If thp dt'VlcP l~; Llpt', th., tt:'l11p()r'lIY
control block:; ar.' ddjustpd 1;0 t ap(' 1.'\bE'1:,
may be read or written.
For DA devicP5,
th .. temporary DeB is set so user labels may
be read or Ioiritten.
In either case, t.ape
or DA t if user labels are specified, GETMAIN is called to get unprotect.ed virtual
storage for a label buffer.

Depending on whether the device is tape
or DA. and ,,,hether the last VO operation
was input or output, Mainline EOV branches
to Tape Output EOV, Tape Input EOV, DA output EOV, or DA Input EOV routines.
When the device-oriented EOV routine
returns control to Mainline EOV, any
storage which had been obtained for label
buffers and format-3 DSCBs is released via
FREEMAIN.

Volume

DA Input EOV (CZCXD> -- Direct access output end of volume processing.

Tape Input EOV (CZCXT)
volume processing.

The rOlltine

DeB and DEB tor use by SAM routines called

If no abnormal conditions occurred during EOV processing, control is returned to
the calling routine.
Tap~~ut

EOV Routine (CZCXT)

The Tape Input EOV routine executes the
end-of-volume procedures for the mOlmted
input magnetic tape volume.
That is, it
oversees label processing and final volume
poSitioning.
If the mounted volume is only
one of a multivolume data set, Tape Input
EOV Cd uses the next volume to be mount. ed,
oversees poSitioning and label processing
of the new volume, and updates the DEB to
reflect the presence of the new volume.
If
the data set is a member of a concatenation
of data sets, the Concatenation routine is
used.
(See Chart FC.)

Return to calling program.
Attributes: Reentrant, resides in virtual
storage, closed, read-only, privileged •

Error -• Call User Prompter to inform user.
• Via ABEND.
Operation:
The SAM control block 1A -- Entered via type-l

Input:
The fo110wi ng parameters are
passed:
Register 0 -- RelatiVe DA address, or relative magnetic tape block address.
Register 1 -- Address of DeB.
The relative block address should have
been obtained .by use of the Note routine.
Data References:

CHADEB. CHADCB.

Modules called:
RELFUL (CZCRR) - convert a relative DA
address to a full DA address.
Control (CZCRB) -- Tape poSitioning.
Exits:
Normal -- Return to calling program.
Error -- ABEND termination.
Q£eration: Point does not apply to devices
other than OA or magnetic tape. Therefore,
for other devices, normal return to the
calling routine is made immediately_

Access Method for 8SM, MSAM, TAM and IOREQ

Note always returns the relative address
of the las!, block read or writtpn.
If the
user wishes to point to that block, the Z
byte should remain zero.

-

When Point is entered for a DA device,
the above mentioned flag (DEBIPT) is set if
necessary, and the relative DA address is
passed to the RELFUL routine. The RELFUL
routine converts the relative add;~ess to a
full DA address which is stored into the
DEBNIO field. The DEBBP flag is set on to
indicate to Read/Write that a Point operation has occurred.
When Point is entered for magnet.ic tape,
1f the tape volume is not currently at the
requested postion, the Control routine is
used to forward space or backward space the
tape to the requested position.
~~he difference between the requested block count
and the current block count i!> the number
of blocks to be skipped.
If errors occur during a point, DEBNF1
is turned on so that subsequent reads or
writes will be intercepted and SYNAD will
be given control when those reads or writes
are checked.
Backspace Routine (CZCRG)
The Backspace routine backspaces a physical record on the current magnetic tape or
direct access volume.
(See Chart GC.)
Attributes: Reentrant, resident in virtual
storage, closed routine, nonrecursive,
privileged.
Entry Point: CZCRGA -- Entered by type-1M
or type-2 linkage.
Input: Register 1 contains the address of
the DCB.
Data References:

CHADCB, CHADEB, CHASDA.

Kodules Called:
Find Records per Track (CZCRQ) -- Find
records per track.
Control (CZCRB) -- Tape positioning.
Exits:
Normal -- Return to the calling routine.
Error -- For unsuccessful completion, general register 15 contains a return code
:>f ·Oq·.

I\.BEND is called under the following
conditions:
• Invalid DCB
• Unchecked Read or Write outstanding
• Illegal device or overflow records.
Section 6:

Operation:
For magn(>tic tape d bdckspac<.~
is much easif'r to perform sinc(' only th('
physical position of the tape need be established. On the other hand, the records of
a sequential data set on DA are not necessarily packed on the volume, and are not
necessarily on the same track.
They must
be on the same volume for backspace.
For a ba~kspace on maqnetic tape, the
Backspace routine links 1:"0 Control via a
type-1 link~ge, with a backspace record
request.
If a backspace record goes over a
tape mark, a forward space record commdnd
is issued to Control, and an error return
is given to the user.
If an unrecoverable
error occurs, a return code of • 04' i~;
placed in general register 15 upon return
to the user.
The backspace operation for a direct
access volume may be very easy or quite
involved, depending on where (logically)
the data set is positioned. The DEB contains the DA address of the next record to
be processed (DEBNIO). The Read/Write routine will operate upon that address when it
is entered. Consequently, the DA backspace
is accomplished if the DA address of the
previous record can be stored into DEBNIO.
A backspace is not performed on a data set
which has track overflow specified.
Neither is a backspace performed if the track
containing the user labels would be
entered.
If I/O operations have not been per-formed on the data set, no backspace is
possible and control is returned to the
calling routine with a non-zero return
code.
Should DEBBP be zero, no prior backspace
has occurred since the last READ or WRITE.
And if DEBLIOR contains some positiVE number, there is no possibility of backspacing
into labels or out of extents. TherEfore,
the backspace is accomplished by moving the
last I/O address to the next I/O address.
If a previous backspace operation
resulted in an er.ror, control is returned
to the calling routine (return code = 0)
without any attempt to backspace. The previous error will be detected by the Check
routine when the next I/O operation is
checked.
DEBBP is set to 1 when the first backspace is made. If a previous backspace has
occurred and cur cent position is not at the
first record in current track, the backspace is accomplished by subtracting from
DEBNIOR which logically positions to the
• previous record in the current track.
Note 1: The Find Records per Track routine
is used to count. the number of records in a
track. To use it one stores the MBCCHH of
Routines Specifically Designed for BSAM

85

interest in DCBRD and calls Find Records
per Track. When Find Records per Track
returns, the number of records in the track
is in DCBRDR. If Find Records per Track is
called by Backspace and it does not work
properly, Backspace sets DEBNFl on so the
DECB of the next read or write will be
intercepted by the ReadlWrite routine and
Check will transfer to SYNAD.
Now, if Backspace is entered and
DEBNIOR=l, the last record ot the previous
track must be found to accomplish the backspace. The important thing to determine is
whether the previous track is just a track
containing records or if it has the user
label::;.
DEBElIT set to one indicai.es that
there are labels in the first track of the
first extent.
DEBNIO pointing to the first
track of the first extent means a backspace
would leavE' the extents.
DEBNIO pOinting
to the second track of the first extent
means a backspace will get into t.he label
track if there are labels.
If the first
ext.ent is only one track in length. it will
contain labels if there are labels. When
DEBNIO is in the first extent and neither
the first nor the second track is pointed
to by DEBNIO. then it is safe to backspace
to the last record on the previous track.
Note 2: The ReadF.. ri te routine wi 11 perform I/O from the DEBNIO address if DEBBP
1.S on, and will t.hen turn DEBBP off.
DEB13P is turned on by the Backspace routine and DEBNH is also turned on if Backspace encounters error conditions.
It is
assumed that Read/Write will inte.rcept an
1/0 request to the data set when both the
above bits are on, and that Check will
transfer to SYNAD when checking that DECB.

Data References:
CHADEC I CHASDA.

CHADCB. CHADEB, CHAIOR,

Modules Called:
AWAIT (CEAP7>

Await an interruption.

lOCAL (CEAAC)

I/O call.

Exits:
Normal

Return to calling routine.

Error -• Abnormal termination via ABEND macro
instruction.
• Exit to SYNAn routine.
2£!Lration:
[nit.ially. t.he lORCR is
cleared. Then it is completely filled in
with the appropriate CCW as well as the
address of the SAM Posting routine.
When t.he IORCB is complete, the lOCAL is
executed.
If the requested operation is
HEW or RUN, control is then returned to the
calling routine. However, for all other
requested operations the DECB is tested to
determine if the operation is complete. If
not complete, the AWAIT macro instruction
is executed to wait for completion of this
event.
When the initiated operation is
completed. the DECB is tested for error
indicators.
Upon successful completion, control is
returned to the calling routine.
For
unsuccessful completion, the user's SYNAD
routine is given control.
If there is no
SYNAD routine and errors exist, the task is
abnormally terminated.

Control Routine (CZCRB)
The control routine performs magnetic
tape positioning, card reader stacker
selection andlor printer channel skipping.
control builds an lORCH containing appropriate CCWs, and executes it via the lOCAL
SVC which invokes t_he I/O Supervisor.
(See
Chart GD.)

Attributes:

Reentr-ant_,

storag~losed routine,

r:esident in virtual
privileged,

nonrecursive.
l:.ntry Point: CZCRBS -- Entered via type-1M
or type-2 linkage.
Inpu~:

The following parameters are

ASCII Translation and Conversion Routine
(CZCWA) f
Users may read or write physical sequential data sets encoded in ASCII with ANS
(American National Standard) label and
record formats provided the storage llledium
is magnetic tape. Since TSS/360 processes
internally in EBCDIC and standard IBM label
and record formats, this routine is
required to provide an interface for ASCII
users. On input, this routine translates
ASCII to EBCDIC and converts ANS formats to
the standard IBM formats.
On output, it
translates EBCDIC to ASCII and converts
standard IBM formats to ANS formats.
(See
Chart GE.)

passed:
Register 0 -- Two-character operation code
and count modifier.

Attributes:
Reentrant, resident in virtual
storage, read-only, privileged,
nonrecursive.

Register 1 -- Address of DCB
I/O device.

Entry Point:
linkage.

86

Part I:

idp~tifying

Access Method for BSAM, MSAM, TAM and IOREQ

CZCWAl -- Entered via type-l

Input:
Register 1 contains the address of
three-word parameter list:

d

Word 1 - Byte 1 - X'Cl' for output
X'CS' for input
Byte 2 - X'OO'

(unused)

Bytes 3 and 4 - Length of record
or block
Word 2 - Address of buffer area
Word 3 - Address of DCB
Modules Called:

None.

bits:
Normal
• Return to caller via BR 14 with return
code 0 in register 15.
• On input only. register 1 on return
will contain the number of bytes
shifted to overlay any block prefix.
Error -- Return to caller via BR 14 with
one of the following return codes in
register 15:
X'04' - First byte of parameter list not
X'C1' or X'CS'
X'OS' - Buffer offset greater than 99
Tables and Work Areas: CHADCB. CZCWZA
(ASClI-to-EBCDIC translation table). CZCWZE
fEBCDIC-to-ASCII translation table).
Operation: On input. after reading a record. where the user has defined his data set
as ASCII, SAM Posting and Error Retry calls
this routine to translate the record to
EBCDIC.
On output, before writing a record, BSAM Read/Write calls this routine to
translate from EBCDIC to ASCII.
ASCII Translation and Conversion
provides:
1.

A character-for-character translation
interface between EBCDIC and ASCII.

2.

Conversion of values in block and
record descriptor fields to unpacked
decimal (ootput) or binary (input)
where records are format-D
(variable-length).

3.

4.

American National Standard r~cord to
mats provide for an opt_ional block ,.net x
which may precede the first or only log ral
record in eack block. Thi~; PITt ix Illay contain user data and, for tormdt_-l) (v,lI:ldblplengt'h) records, the block length in the
block descriptor field.
The ASCII user,
entering data sets from tape, may tell the
system (in either his DDEF command or hi"
label) tc expect a block prefix; he may
specify up to 99 bytes.
Any data in the
block prefix, other than the block lengt.h,
will not be available to him, however.
ASCII Translation and Conversion saves the
value (tbe block length) in the block
descriptor field (the last four bytes of
the block prefix) and then shifts the first
or only record left, overlaying the block
prefix. The end of the record is zeroed
out.
On output. a user may specify only 0
or 4 bytes of block prefix, and then only
if format-D records are specified. When a
4-byt.e block prefix is specified, it will
contain a block descriptor.
The length of the block prefix is specified by the buffer offset. The differences
between American National Standard and
standard IBM label formats are slight; one
difference is the existence of a buffer
offset field in the second header label
(American National Standard).
If the user
specifies or defaults the buffer offset
(BFOFF) parameter in the DDEF command, the
buffer offset field in the label determines
for ASCII Translation and Conversion the
number of bytes of input block prefix to
handle.
The translation and conversion interfaces provided by this routine are illustrated in Figures 10 and 11.
Additional information on label and
record formats, both standard IBM and
American National Standard, for magnetic
tape volumes is contained in Appendix A of
Data Management Facilities. GC28-2056.
_BUFFERING SERVICES
The following four routines are provided
to allocate a pool of buffers and permit
easy access and release of the buffers
within the pool.
G£TPOOL Routine (CZCMa)
The GETPOOL (get a buffer pool) routine
fills the buffer length and the number of
buffers field in the DCB.
(See Chart HA.)

On input, evaluation of block or record format and resultant shifting of
records to overlay any block prefix.

Attributes:
Reentrant, resident in virtual
storage. closed routine, read-only, public.

On output, a block prefix of 4 bytes
if specified by the user.

Entry Point:
CZCMBG equated to SYSMBG -Entered via type-l linkage.

Section 6:

Routines Specifically Designed for BSAM

87

ON

A buffer offset (block prefix length) of 0-99 bytes is supported in all formof1.
The usel specifies the buffer offset in either the tope label or the DOEF com!!lond.

INPUT,

FORMAT F ,ecords-blocked and unblocked (blocked shown here)

FORMAT U record.

Doto (ASCI]

is translated to EBCDIC ond the BSAM user READ,

is Iranslated to EBCDIC and t,e BSAM user READ, ...

Data (EBCDIC)

the QSAM ')Ser GETs ...

the QSAM user GETL ..

[ o o t o (EBCDIC)
(three times)

FORMAT D (vorioble-!ength) records

If the b0ffe, offset is specified as 0..
1mb ~ockeci rshown i ...

blocked or

Doto (ASCIi)

becl.Jmes.

~!_f_OO~~
If

~he

_____D_o_t_O_(_E_BC_D__IC_-i______

~

1"\ of! Format D cases, whatever the
buffer ofk., (0-99) .. _
unblocked,
the BSAM user READs .. _

buffer offset ;'1. spec.ified as 4 ... blocked

not
present

(shown) or unblocked ...

if
buffer
offse!
4 or less
bec:;.mes •••

[LLOO!

t{OO

I

Dota (EBCDIC)

roo I }[J

If the Duffer offset-is specified as olher than 0 or
-4 ..• blccked or unb locked ...

bladed and unblocked,
rhe OSAM user -GETs .. ~

Dolo (EBCDIC)
becomes. , .

However, lLOO wi 11 exist 'in the
sy'Stem buffer for each format D
"nblocked record or block.

Zeroes
"Doe'S not havp to contain ODDO; BSAM colculates and creates correct LlOO.

dddd is- the record (length) descriptor in ASCII format; a 4-byte vo!ue in un-pocked declmol.
froo;s the record (length) desc6ptor in EBCDIC formol; U co a vaiue in binary; 00 ~ Zeroes \unu",d).
DDDD is the block (Iengthi descriptor in ASCII format; a 4-byte volue in unpacked decimal.
llOO is the block (length) descriptor in EBCDIC format; LL ~ a value ;n binary; 00= Zeroes (unused).

Figure 10.
88

Part I:

How TSS/360 Handles ASCII Record Input
Access Method for BSAM, MSAM, TAM and IOREQ

----

ON

For Format. Fond U, no buffer off,et (block prefix) is allowed.

OUTPUT

"I

For Format 0, a buffe, off,et of 0 or 4 may be specified.

Ir

FORMAT F and FORMAT U record, - blocked ond unblocked

I

I

Ooto (EBCDIC)

r

becomes

Dato (ASCII)

------FORrAf,-~

If a buffer offset of 0 is speci lied ...
~~O

I

1

(llorioble -I':.nglh) records - blocked or unblocked

llOO

I

Dolo
(EBCDIC)

floo

--

Dolo
(EBCDIC)

becomes ...

dddd

Data
(ASCII)

dddd

Dolo
(ASCII)

If a buffer offset of 4 is specified, the
EBCDIC block above becomes ..•
DDDC dddd

Data
(ASCII)

dddd

Data
(ASCII)

See Figure 10 for the meaning of dddd, etc.

noo

and specify buffer offset = 4 if he wonts a
Notes: The BSAM user must calculate and supply his own LLOO and
block descriptor on output.
The QSAM user must specify buffer offset = 4 if he wonts a block descriptor even though he does not have
to supply his own LLOO.

Figure 11.

How TSS/360 Handles ASCII Record Output
Error -- ABEND macro instruction.

Input:
The following parameters are
passed:
Register 0:

r--------------------T--------------------,
NN
I
LL
I

IL

__________________ .1. __________________•__ J

o

31

15 16

where NN - number of buffers requested.
LL - length of each buffer in the
request.
Register 1 -- Address of DCB.
Data References:
ChAVPS.
r-r.odul,,~s

Called:

CHADCB, CRADEB, CHAISA,
None.

.Exits:
Normal -- Return to caller.
Section 6:

Operation:
The routine will ABEND if the
DeSID is not valid. The routine also
ABENDs if a buffer pool has been previously
assigned, if the buffer length or block
size exceeds 32,768 bytes, or if the number'
of buffers exceeds 255. GETPOOL inserts
buffer length and number of buffers into
DeBBUF and DCBBUN respectively. The routine sets on bits corresponding to DCBBUF
and DeBBUN in DCBMSK if the DCB is open.
GETBUF Routine (CZCMA)
The GETBUF (get a buffer) routine finds
an available buffer in a buffer pool and
rei:urns a pointer to it. When the GETEUf
routine is entered for the first time, the
buffer page list, which describes the .location of all the buffers for this DCB, lS
built, the buffer pool is allocated, and
the first available buffer is obtained •
(See Chart HB.)
Routines Specifically Designed for BSAM

89

Attributes:
Read-only,
storage, closed routine,
E-lltry"'_poin_t:.:

in virtual
reentrant, public.

re~;ident

CZCMAG equated to SYSMAG -tyl">-! link.HIP.

J:.nt.,rprt

Vld

Inpu!c:

Rpql~t,,-'r

Exits:
Normal -- I rTliiCr"

c,)ll~n'j

program.

i n"tructlon.

conla1n" the addre"s of

the DCB.
Data References:
CHAISA, CHAVPS.

'-0

CHAnCB, CHABPL, CHAnE-B,

Modules Called:
VMA (CZCGA) -- Get virtual storage.
CKCLS (CEAQ4) -- Check protection clas:;.
Exits:
Normal -- Return to calling program.

Operation: The dddcesse~ of buffers in
CHABPL are searched to find a watcr. for the
address passed in register O. When a match
is found, the In-Use flaq for that buffer
is turned off in the CHABPL, and BPLNBF
(numbpr of free buffers) is incrementeJ by
one.
FRI:EBUF exits to ABEND if the DCB identification is not villid, if GETBUF has not
been called, if the buffer to be freed is
not in the pool, or if the buffer to be
freed is already free.

Error -- ABEND macro instruction.
FREEPOOL Routine {CZC'NB)
operation: GETBUF will ABEND if the DCBID
is not valid, or if the DCB is not open.
If this is the first entry to GETBUF, a
Duffer page list must be built. GETBUF
ABENDs if the buffer length is too large or
if buffer length and blocksize are both
zero. When only buffer length is zero, and
access is for other than QSAM, and the
device is direct access, the actual size of
the buffer is computed by GETBUF by adding
the key length to the blocksize.
GETBUF
determines which cutoff constant is to be
used and calculates the total number of
pages needed for the buffers, and the buffer page list.
GETMAIN is used to obtain the needed
pages. GETBUF maintains the count of
available buffers and enters the buffer
addresses into the Buffer Page List.
FREEaUF Routine (CZCNA)
The FREEBUF (free a buffer) routine
makes available a buffer which was previously obtained and made unavailable by
the GETBUF routine.
(See Chart HC.)
Attributes:
Reentrant, resides in virtual
storage, closed routine, read-only, public.
Entry Point: CZCNAF equated to SYSNAF -Entered via type-l linkage.
Input: The following parameters are
passed:

The FREEPOOL (free a buffer pool) routine releases all virtual storage which w~s
assigned to a DCB as a buffer pool.
(See
Chart HD.)
Attributes:
Reentrant, resident in v:trtual
storage, clo3ed rout_inf:, neild-only, public.
Entry Point: CZCNBC equated to SYSNBC -Entered via type-l linkage.
Input:
Register 1 contains t:he address of
the DCB for the data set whiciJ last used
pool.
Data Reference~':
CHAVPS, CHAISA,
Called:
storage.

Modul~

CHADCB, Cru"-.BPL, CH.A.llEB,
VMA

(CZCGA) -- Free virtual

Exitc' :
NormCil -- Return to calling program.
Error -- ABEND macro inst.ruction.
Operation:
FREEPOOL ABENDs if the DCBID is
not valid, or if t_fJP access is QSAM and t.he
DCB is open.
Unless the Buffer Page List pointer is
zero, the number of I~qes in the buff~r
pool is determined from BPLNPG, dnd FRLEMAIN is called tv rpledse thosp ~dg~~.
FREhPOOL z(;ros tne Buffer Pdq" Li:c:t
pointer. and the but f: er length a nd nll!nt;~ r
of buffers fields in the DCB.

Register 0 -- Address of buffer to be
released.
BSAM INTERNAl, CONTROL ROUTINES
Register 1 -- Address of DCB.
Data References:
CHAVPS, CHAISA.
90

Part I:

CHADCB, CHABPL, CHADEB,

The internal control routines include
the message writing, tape positioning, and
volume serial field finding routines.

Access Met_hod for BSAM, MSAM, TAM and IOREQ

Tape Positioning Routine (CZCWP)
The Tape Positioning routine positions a
tape volume to any of three positions.
The
positions are shown in Figure 12.
(See
Chart lA.)
Attributes:
Reentrant, resides in ritual
storage, subroutine. privileged.
Entry Point:
linkage.

CZCWPl -- Entered via type-l

Input:
Register 1 contains the address of
the SAM communication block.
SCBPOS contains the code which indicates ,,'hich tape
posi t.ion is desired.
Data References:
CHATDT.

CHADEB, CHASCB, CHASDA,

Modules Called:
Control (CZCRB) -- Tape positioning.
Nessage Writer (CZOWM) -- ABEND processing.
Build DEB (CZCWB) -- Update DEB after
volume switch.
Bump (CZCAB) -- Mount next volume.
Volume Sequence convert (CZCWV) -- Determine if there is another volume.
Exits:
Normal -- Return to the calling routine.
Error -- call Message Writer to do ABEND
processing.
operation:
Positioning is always relative
to the tape marks on a volume.
It is
assumed that unlabeled volumes contain data
sets separated by single tape marks. and
that labeled volumes contain data sets with
a single tape mark separating header labels
and data, and a single tape mark preceding
trailer labels.
lobe led Tape

Troiler lebe!s

I

Til

G

G

R M R

The l'lUinber of forward or baCkwdl'd 6f'c.ces
to be made must first be calculated.
The
calculation is made from the position cude,
the current tape mark count and the loqi:'aJ
data set sequence number in the JFCB.
The present position on the t.ape voluJ~I,,";
is known from the tape mark count. which
indicates how many tape ffiarks are behind
the preser,t posit-.ion.
For example, in
Figure 13 there are unlabeled data set.", (ill
a tape volume (the current poSitioning is
indicated); the tape mark count at this
position would be two.
Calculating the Position to Which t.he :i'ap~
is to be l'loved:
A temporary data area.
TFN, is St~t to the relative physical
sequence number of the current data set of
the current volume.
This is calculated bv
subtracting the f~rst loqical file (da·tc •
set) sequence number on the mounted volume
(TDTLFN - 1) from the loqical file sequence
number (TDTPSQ) of the data set which the
user requested (TDTFSQ - TDTLFN + 1).
For
example. in Figure 13 the TDTFSQ contains i i
~ if this is the only volume, indicatii1g
that current positioning is somewhere
within the second data set on the volume,
It should be noted now that one tape
mark follows every data set on an unlabeled
tape volume.
Similarly, since there are
three tape marks associated with each data
set on labeled tape, multiplying the physical sequence number of the current data
set (TFN) by three, then subtracting one.
yields the exact number of tape marks pre'ceding the first TM of the current data
set.
Now that the number of tape marks 0.580·clated with the data set on which posi tion-ing is to occur is known, i t only remains
to determine how many tape marks beyond the
previows data set are needed to find the
desired new pOSition in terms of tape
marks.
Looking at Figure 12, it is clear that
for labeled tape:
zero additional tape
marks yields poSition 1. three additional
tape marks yields position 2. or two additional tape marks yields position 3. For
unlabeled tape. zero additional tape marks
yields poSition one, while one additional
tape mark yields pOSition 2.
position 3

POIition 2

...

Ur"Il(JbelPd rope

Direction of Tope movement

Doto

Posi'ion J

Figure 12.

-

Posit~on

2

LOAD POINT

Figure 13.

Tape Positions
Section 6:

Data Positioning

Routines Specifically DeSigned for BSAM

91

cannot be found directly no~ because files
(tape marks delimit files) are being counted in the for~ard tape direction.
A backspace file is necessary to obtain position
3 on nonlabeled tapes after fo~ard space
files are completed.
The appropriate number of additiollal
tape marks is put into a temporary data
area TFA.

Unlabeled tapes - The same procedure is
followed as for labeled tapes. except
only one fo~ard space file is done
after the forward space record.

Since all information necessary to find
ne~ posit.ion is known in terms of ta?e
marks, the calculation can be made:
th,:

labeleJ tape

TFS =

(TFN- U x3+TFA

Multivolum(;! Check - If the JFCB indicates another volume on an end-of-volume
condition, it is mounted, the DEB is
updated, and the tape positioning values
are updated for the newly-mounted
volume.
In addition, the log~cal file
sequence nlmmer is placed in the volume
entry (TDTFSQ) of the TOT.

or
unlabeled tape TFS

=

(TFN-1)+TFA

TFS is a temporary data area ~hich cont.ain3 the desired new position in terms of
number of tape marks from the beginning of
the tape volume.

Forward motion of the tape can only
result in position Z or D becaus~ spacing
by files (delimited by tape marks) causes
the tape to stop in the interrecord gap
after the skipped file. Therefore. to
reach the desired position in F~gur€ 14,
files are skipped forward to reach poSition
Z, and then there is a backwarj skip of one
file position to the desired position.

The difference between TFS, the desired
posit.ion, and SDATAP, the present position,
is determined by subtraction. The result
1.s the number of tiles (delimited by tape
n.arks) to be forward or back~ard spaced.
The direction to go is indicated by the
sign of the above difference.

The Control routine is used to forward
or backward space the required number of
files.

Volume Sequence Convert Routine (CZCWV)
The Volume Sequence convert routine is
called to determine the address of a volume
serial field within the correct job file
control block (JFCB) within the task
definition table, based on a Relative
Volume Sequence Number (RVS) stored in the
SAM co~munication block (CHASCB).
(See
Chart 18.)

The following situation may occur when
skipping files forward or backward.
The
solut.ion is the same for either case.
As
in Figure 14 there is a requirement for
forward spacing.
When forward spacing to the correct
position, the following procedure is followed if Tape positioning was called by
Tape Open:
Labeled tapes - A forward space record
is done to check for a tape mark. which
would indicate the end of the tape.
If
a tape mark is encountered and another
tape is not specified, an ABEND results.
If a tape mark is not encountered. three
fo~ard space files are done to position
to the beginning of the next data set.

~
)

iI

I~

G
' - DMirf!'d P01.it.ion

R M R

G

I

" - Pos.ition Z

• n

Fiqure 14.
92

Part I:

T

G

G

Entry Point:
linkage.

CZCWV1 -- Entered via type-l

Input:
Register 1 contains the address of
the SAM co~~unication block.
Referenc.~:

CHASCB.

o

T I
R M R
I

T I
M R

Attributes:
Reentrant. nonrecursive. resident in virtual storage. privileged.

Data

z
(

This procedure is followed until the
correct file (data set) is reached.
Then another for~ard space record is
done to check for an end-of-tape condition.
If a tape mark is encountered, a
check i:; made for another volume.
If
there i~ not another volume and the user
is open for input and reading forward,
his task is ended via ABEND.
othe~ise,
the tape is poSitioned correctly.

I

f

Modules Called:

i

Exits:
Normal -- Register 15 contains one of the
following return codes:

)

G

'00'

Skipping Files on Tape
Access Method for BSAM. MSAM, TAM and IOREQ

None.

Address of t.he volume serial
field requested is in SCBVCA and
the field is valid.

'04'

SCBVCA contains the address of
a null volume serial field, or
a null chain field.

'OS'

Volume serial field considered
out of range.

Input:
Register 1 contains the address of
CHASCB. The two-byte SCBMSG field of
CHASCB is set as follows:
byte 0

byte 1

r-----------------T-----------------,

Il ___________________
HAMROOOO
I ___________________
NNNNNNNN
.1.
JI

Error -- None.
Operation: The calling progran-. stores the
address of a volume serial field within the
JF'CB in t.he CHASCB, and places a return
code in general register 15 indicating the
result of the search.

o
where

7 8

H

A

The return code setting indicates to the
calling program whether the volume serial
field has been located, and if it has, its
address (stored in CHASCB>. Ot~herwise, the
return code indicates whether the RVS
stored in the CHASCB points to a null
volume serial field and the address of tnis
field is stored in the CHASeB; or whether
the RVS points to a volume serial field
which would begin the next chain of volume
serial entries in the JFCB (in which case
the CHASCB contains a pointer to the null
chain field which will be used to point to
the address of the field requested by the
RVS) • The return code, on the other hand,
may indicate that the RVS stored in the
CHASCB points to a volume serial field
which does not exist in the current JFCB
(in which case a pointer to the terminating
null chain field is stored in the CHASCB),
or the return code may indicate that the
RVS was zero upon entry, and the address of
the volume serial field pointed to by RVS
has been set. to zero.

M

15

o

No header required

1

Message requires header

o

ABEND

1

Prompting message

o

User message

1

Operator message

R ::: 0

1

No response
Response required

and byte 1 is a messaqe ID consisting of
a binary number. There is a unique
number for each messaqe.
The SCBABN field contains the SAM ABEND
code, if the call is for an ABEND
message.
Data References:
CBADEB, CHALB1.

CHASCB, CHATDT, CHASDA,

Modules called:
WTO (CZABQ) -- Write message to operator.

Note: The first volume serial field in the
JFCB is assumed to be 1.

Gate (CZAAB) -- Print message on terminal
or SYSOUT device.

The RVS stored in the CHASeB is not
changed by VOLCVT.

ABEND (CZACP) -- Abnormal termination of a
task.

Message Writer Routine

Exits:
Normal -- Return to caller.

(CZCWM~

The Message Writer provide', for all the
message handling required by -:he SAM Open.
End-Of-Volume, and Close RoutLnes. This
module contains all message tt~xt.
It
selects the proper method of transmitting
the message to the user or to the operator.
Some standard responses are processed and
returned to the calling SAM modules in t.he
form of return codes in general register
15.
The Message Writer also handles all
ABEND processing for BSAM.
(See Chart IC.)

Error -- ABEND.
9peration: This routine uses the message
code placed in the CHASCB as an index to
locate the desired entry in the message
control table (MSGTS). A message is then
formed in a buffer area in the PSECT of
this routine. All messages begin with a
prefix, contain a header if the message is
for a user. and end wi th the mess age text.

Attributes: Reentrant, nonrecursive. resident in virtual storage, privileged.

The prefix is built from information in
the CHASCB.
It contains the module name of
the caller, the abend code, and the message
code. This uniquely identifies each
message.

Entry Point:
linkage.

When the message is for a user, a header
line is added. This provides the DDNAME

CZCWMl -- Entered via type-l

Section 6:

Routines Specifically Designed for BSAM

93

r---------T-------------------------------,
I Pointer to message text if PP I

and DSNAME to identify the data set being
processed.

IDC A(MSG}

The phrase or phrases forming the message text dIP concatenated with the prefix
and header in the buffer area.
If necesc,,;HY, ~ modif ication routine is invokpd to
complet.e va:n .. ble fields in the text.
The
c()mpleted messdge is t.hen transmit.ted <'H3
incli ~;at.ed by flags in t.he message cmr:rol
table.

I (OO=none).
i

ICooe for Response rout.ine

iNumber of entries in Phrase

1

IList.

I

!

(Flay-s.

,

~---------.l.---.---------.--.-,-----------.-----.f

I

01234567

IDo not print header.

0 X X X X X X X

!

jPrint header.

1 X X X X X X X

I
I Abend text.

X 0 X X X X X X

I

l:Prompt.ing Message text.

I

IMessage for User.

!

from the

X 1 X X X X X X

X X 0 X X X X X

operator.

X X 1 X X X X X

INo response required.

X X X 0 X X X X

IMessage

an entry outsi'je the
range of the message control table or
 ['SECT.
The count is then stored in the DCBRDR
field of CHADCB.
iixpd but. not !·,tandarrl, an lORen

This count is a Is a stored in tile DCBRDR
field if an error return of 'No Record
Found' is detected after the lOCAL SVC.

If the lOCAL return shows that the track
was defective, the alternate Seek address
is moved into the lORCB dnd the lOCAL
1ssued again.
Any ot her error return tram lOCAL causes
Find Records per Track to return a code of
X'04' in register 15.
RELFUL Routine (CZCRR)
This routine converts a relative direct
access device addres~; - of the form TTRZ.
to a full address - of the form RMBBCCHH.
where R is the record number, M is the
extent numoer, CC is the cylinder number,
and HH is the head (track) number.
(See
Chart IE.)
Entry Point! CZCRRA (SYSRRA equated) -via type-l linkage.
Input: Register 1 contains the address of
the OCB. DCBRDT contains the relative
address to be converted.
Modules Called:

~ra! io.n:

TIll' "X t <'lit n IIlnlll't (1'1) .t nd r pcord llumbe, ,!!" 11\,;\1,-.1 11\ t /,>11. til<' nEI'. Tilt'
track number 1~, '-OlC1~'lltt'li dlld it it i~; all
the fir~;t cylindvr of til., pxtent., the
cylinder and track (head) are placed
directly int.o the DeB and a return to the
calling modules effpcted.

If the track is not on the first cylinder, the cylinder count is updated until the
track is found, and the cylinder and track
are computed and stored in the DeB.
A
rpturn t.O the calling module is effected.

FOLREL conv"rt:"; d full DA device address
in the form RMBB(,('HH to a relative address
i l! the form TTll.Z.
R is t.he record numbe r ,
M is the ext.ent IlumbpI, BB is the bin numb"r, CC is thp cjlind .. r number, and HH is
tlw head (track) nurnrx;r.
TTRZ represents
the relativE' trdck and record numbers for
the current V01UIl]("'.
(See Chart. IF.)
Entry Point: CZCHSA (SYSRRA equated) -via type-l linkage.
Input: Register 1 contains the address of
the DeB.
Modules Called:

None.

Exits:
Return to the calling routine.
return code.

None.

No

i

Return Code
00

04

Condition
Normal return.
Track number is outside
data set.

Section 6:

Operation: The address is converted to the
TTRZ form where the R of TTRZ is set t.o the
R of RMBBCCHH minus one, the Z is set to
zero, and the track is computed by adding
the number of tracks in the extents. The
remainfng fields of DeBRD are set to zer·o.

Routines Specifically Designed for BSAM

95

PART II
VIRTUAL ACC&SS METHOD (VAM)

SECTION 1:

The data management facility discussed
l.n this section is the virtual dccesS
method (VAM). There are three organizational methods:
virtual sequential. virtual indexed sequential, and virtual partitioned, which are designed for use with
TSS/360.
All incoming and outgoing data
processed by the virtual access methods is
organized in units of pages which are 4096
bytes in length and stored on direct access
devices.
TSS/360 VAM is designed to minimize the
number of virtual storage pages associated
with an open data set. VAM brings into
virtual storage only those data set pages
currently needed for user operation.
In this section, the implementation of
VAM is presented using seven subdivisions:
• A general description of VAM including
its unique characteristics and its special capabilities.
• A description of error recovery techniques used for VAM data sets.
• A description of the volume format and
the manner in which data sets are maintained on such a volume.
• Data set sharing - a detailed discussion on one of VAM'S more important
facilities.
• Open and close processing - that part
of VAM processing common to all the
access methods.
• The virtual sequential access method.
• The virtual indexed sequential access
method.

INTRODUCTION

dpvices.
Each device i~j preforrnatted, 1.n d
manner which will he described later, in
uni ts of t~096 bytes called pages. Although
records i:1 a data set may occupy less than
a page, exactly one page, or more than one
page, the access method deals in terms of
page units.
The general philosophy of the virtual
access methods is closely tied to the concept of relocation exceptions. When a user
issues a request to get or read a record,
the virtual access method merely adds the
page or pages containing the record to the
requesting task's page tables. This operat_ion is performed by the Movepage routine
(CZCOC). That is, the record is read into
the task's virtual storage. When the task
in execution makes a reference to the record, a page relocation hardware interruption
occurs. This interruption causes the resident supervisor to read the referenced page
into main storage by means of its paging
mechanism.
A put or write operation, on the other
hand, results in the actual writing out of
the record as well as the updating of the
page tables. The writing operation is performed by the Movepage routine (CZCOC)
which issues the PGOUT SVC. This SVC is
also serviced by the resident supervisor
and performs the actual writing operation.
Movepage Routine (CZCOC)
Movepage is called by OPENVAM (CZCOA),
CLOSEVAM (CZCOB), VSAM Get (CZCOR), VSAM
Put (CZCOS), SETL (CZCOT), FLUSHBUF
(CZCoT), Getpage (CZCPI), and VISAM Close
(CZCQA) to perform input or output and to
control the use of shared pages by setting
and releasing interlocks.
(See Chart JA.)
Attributes:

Read-only. public, privileged.

• The virtual partitioned access method.
Where practical, indiVidual routines
will be presented immediately following the
particular facility they support. The
first of the above subdivisions, a general
description of the virtual access methods,
will occupy the remainder of this section.

Entry Point: CZCOCl - Entered via type-l
or type-2 linkage.
Input: Register 1 contains a pointer to a
two-word parameter list:
Word 1

Address of DCB.

Word 2

Address of first page of request.

VIRTUAL DATA SET ORGANIZATION
As metioned above, the data sets
accessed by the virtual access methods all
reside on direct access storage devices.
The devices supported by TSS/360 are the
2311 and 2314 direct access disk storage

Field DCBN contains the relative page
number of the first data set page of the
request.
Field DeBM contains the total number of
contiguous pages involved in the request.
Section 1:

Introduction

99

Field DCBOP contains the type of operation requested as follows:
• 80'

Input request.

'20'

Input request with exclu:;ive
read.

• 10'

Output request.

'02'

Release read lock.

• 01'

Release write lock.

• An output operation is requested on
a data set opened for input.
This
is not the case if the output operation is to output the POD of a partitioned data set.
• The request is for input from beyond
the data set limits.
• The operation requested is invalid.
• The DSORG is indexed, and DCBM

*

1.

• An error return is received from
GETNUMBR.
Modules Called:
GE:I'NUMBR (CZcool) -- Converts the pc.ge
number of a partitioned data set relative to a member to the relative page
number with respect to the start of the
data set if part of the member has been
moved to an overflow page.
Interlock (CZCOHl) -- Interlocks the
external page entry of a shared data
page or interlocks the entire RESTBL.
Release Interlock (CZCOI1) -- Releases the
above interlocks.
PGOUT (CEAAl) -- Causes the pages of an
output request to be written to external
storage.
SETXP (CEAH7) -- Adds the pages of an input
request to the task's external page
table so that the supervisor can bring
them into main storage when a reference
to them causes a relocation exception.
RELEXPG {ClCENl} -- Releases pages aSSigned
to the jata set but not in use.
FINDEXPG (CZCEL1) -- Assigns new pages to
the data set.
Exits:
Normal

RETURN macro instruction.

Error -1.

Return with a code of X'04' in general
register 15 if an attempt to perform
an exclusive read failed because the
page was already locked.

2.

ABEND is called under the following
conditions:
• An unrecoverable error occurs during
the PGOUT operation.
• The DCB in the parameter list is not
the same as the one in the DCB
header.
• Illegal data set organization
exists.

100

Part II:

Virtual Access Method (VAM)

• An illegal buffer is passed to Movepage for VI organized data sets.
• The PGOUT buffer is not data or
overflow.
Operation: On entry, registers are saved
and base registers are established in conformance with linkage conventions.
If the
data set is shared, the RESTBL is interlocked.
If the address of the DCB is not
in the DCB header, or if the data set is
not partitioned and the request is for output when the DCB was opened for input only,
a call is made to ABEND. This latter
operation is valid for partitioned data
sets since the request may be from CLOSEVAM
and be a request to write out the POD.
If the data set is partitioned, the
relative page number must be determined.
The user reference is to a relative page
number based on the start of the member;
this relative page number must be converted
to one based on the start of the data set.
Where part of the member has been relocated
to an overflow page, GETNUMBR is called to
make the relative page number determination.
After this calculation or if the data
set was not partitioned, the request is
examined further.
If the request was for
an output operation on a partitioned data
set opened for input, and the request was
not to output the POD, ABEND is called. If
this error condition does not exist, processing continues. The extent of the
requested operation is tested to see if the
pages involved are all within the limits of
the pages currently assiqned to the data
set.
If the data set limits will be
exceeded by the request, ABEND is called.
If all is in order, the processing continues.
From this paint on, the processing
differs according to the type of request.
Output Operation:
In general, the output
of data set pages is accomplished by means
of the PGOUT SVC. The processing in Movepage consists of building a parameter list
and issuing the SVC. The parameter list

fcr PGOUT contains the first page lnvol ved.
the number of pages, and the virtual
storage address of the first external page
f~t_ry.
The page entries must. be converted
from the format used in the RESTBL (re·'.il
ti'v€ volume number-relative external pcLl{'
number), to a format suitable to the R";QUT
p:':-ocessor (symbolic device address-external
page number>.
This conversion is accompJished by directly indexing into the volume
L"ble and appending the SDA t.O the given
e:..:t ~'rnal page number.
This pa.rameter is
then placed in the PGOUT list. This process is repeated, page by page, until all
pages involved have been placed in the
parameter list or until the maximum of 8
entries have been placed in the list. When
either of these conditions is met, the
PGOUT SVC is issued and the transfer of
pages is accomplished. On return from
PGOUT, the data set is tested to see if it
is duplexed (see duplexing .later in this
section). If it is, the same parameter
list is used to write the pages to the
secondary copy of the data set. When both
copies have been written out, the procedure
is :repeated, if necessary, for each succeeding group of 8 pages until the request
has been satisfied.
Once this has been done the exit procedure is entered. This entails the release
of RESTBL and page interlocks set on shared
data set pages and RESTBLs, and a return to
the calling routine.
Non-output Operation: Operations which are
not output may be simple input operations
on a nonshared data set, input from a
shared data set, a read exclusive request
for a shared data set, or a request to
release a read or write interlock on a
shared data set page. If none of these
operations is indicated, a call is made to
ABEND.

If the request is for a simple input
operation on a nonshared data set, the virtual storage address of the first page in
the request is computed and placed in the
parameter list for SETXP. As with the
parameter list constructed for PGOUT, these
page entries must be converted to a form
acceptable to the SETXP processor. The
conversion process is identical. Page
entries are converted one by one and placed
in t_he parameter list until the list maximum of 64 entries is completed or until the
requested page entries are all in the list.
The SETXP SVC is then issued. This action
results in the placement of the pages
involved in the external page table of the
task. Any future reference to the pages
will result in a relocation exception which
can now be processed by the resident supervisor. If there are more than 64 pages
involved in the requests, this process is

repeated until all requested pages have
.been placed in the external page table.
If this input rf'que~;t Wd~ not recei \ltd
from Open, the number of Checked out_ paqt:~c>
is updat ed. Aft "'J: that or if the request
was froIr Open, cont-rol is returned to the
call~ng rout.ine.

The frocess .. ng of ~nput requests for
shared data sets is basically the same as
fOl: nonshared data sets. The only dif-ference is that page level interlocks must
be set and released in ceLtain operations.
If the data set organization is other thaH
VISAM, no interlocks must be set, so the
above input. processing is entered.
The
pardmeter list for the SETXP SVC is estab~
lished and the svc is issued.
If the data
set is VISAM but t.he request is for a directory page the same processing occurs.
When the request is for a data page of a
VISAM data set, one of two interlocks must_
be set on all pages involed in the request.
.For data sets opened for input or for
operations other than read exclusive, a
read interlock is set on all pages; for a
read exclusive request, a write interlock
is set. The significance of these interlocks and the manner in which they are
imposed is discussed in the section on
sharing.
Once the type of interlock has been
determined. the pages are examined to see
if an interlock is already set. This
occurs when an exclusive read request is
made for a page which is already in use.
In such a case, a return is made to the
caller with a return code of '04' to indic-ate that the page is not currently available. If the page is not already locked, d
call is made to Interlock to impose the
proper interlock on all pages. This inter-~
lock is not imposed if the call to Movepage
is for a read request from the dynamic
loader. Following the setting of appropri-'
ate interlocks, the parameter list is built.
and the SETXP SVC is issued as for nonshared input requests.
After the SVC has been processed and
control has returned to Movepage, the numb-'
er of pages checked out is updated for all
requests except those from Open, the RESTBL
interlock is released and control is
returned to the calling routine.
The remaining function performed by
Movepage is the release of the page level
interlOCKS set for input requests on the
data pages of a VIS AM data set. The inter-locks set can be either read or write. The
type of interlock is determined and passed
to the Release Interlock routine as a para-meter. Once the interlOCKS on the pages
have been released, the interlock on the
Section 1:

Introduction

101

R£STBL i,: released by again call1ng Release
Ir;terlocK, and control is returned to the
calling routine.

• To delete all records in an existinq
data set or member·, from il specified
record to the end of tht, data Sf't.
• To retrieve thE' loqic-d 1 n~cord~; ot til<'
data set or member in a sequential
manner.

Associated with each of the organiz~­
methods is an access method by which
the user may access records in his data
E2t.
These access met.hcx.is are:
the virtual sequential access method (VSAM), the
vi.rtual indexed ser.;uential access method
(VISN~). and the virtual partitioned access
illiA.hcd (VPAM).
This last. facility is not
an. access method in the normal sense of the
term. VPAM contains no routines for the
actual reading or writing of records.
A
virtlldl partitioned data set is a collection of other data sets which a user has
comhlnpd for ea~e of reference.
These subsidiary data ~;cts are called members and
€acn rra?mber is itself organized as a virtu-al sequential or virtual indexed sequential
data set..
It.i" by means of the other
dcce;,s roet.hods that the records of a member
are actnally read into the task's virtual
~10nal

stordgf~

..

VPA1'1 provides the additional control to
perform the following functions on members:
..

'20

crec;t<' or add to a virtual partidat.<1 set..

• To update ar existinq record of the
da ta set or member i 11 place.
The virt.ual indexE'd sequential access
roethod provides the means by which a user
can access records in a virtual indexed
sequential data set. Such data sets contain records which are not. sequent:ially
located in virtual storaqe.
Each record is
associated with a key which is contained in
the record in storage.
The lowest record
key in each data page, except the first
data page, of a virtual indexed sequential
data set is also entered in a directory
Which is associated with e~ch such data
set.
By referencing the keys associated
with the records in a sequential manner,
the user may process his data set as a
sequential data set. Optionally he may
access records in a nonsequential manner,
select lng the records he wishes in dny
order by referencing the appropriate keys.
This processing is detailed in the section
on the virtual indexed sequential access
method .

t.~oned

• To prepare any member of a virtual partitioned data set for processing.
.. To add new members to, or delete existlng memben; from an existing data set.
.. To update pxi::,ting members in place.
The virtual sequential access method
provides the user with access to records
that ace locatpd in logically sequential
locations in his virtual storage.
Because
of the nature of the virtual storage concept, these rpcnras lilay or may not. be in
phySically sequential locations in main or
pxt.tcrnaJ storilJje. but they may be conceived
of dS being sequentially organized for pro-·
ceSS.lng purposes.
Tables maint<:tined by the
dat~a management routines and by the resident supervisor make this type of processing possible.
The manner in which this is
done is desc:cibed in detail in the section
on t~i1e v.Lrtual sequential access rnet.hod.

The virtual indexed sequent_ial access
met.hod (VISA-"'Il processes vi rtual indexed
sequential data sets or indexed sequential
members of partitioned data sets.
It can
be used for any of the following functions:

.. To create a virt.ual indexed sequential
data set or member in a sequential
manner.
• 'ro retrieve the logical records of the
data s,et or mell1ber in a sequential or
nonsequential manner.
• To update records in a sequential or
nonsequential manner.
.. To in:::;ert records in logical sequence
wit_hin r.he dat.a set or mernbf'-r.
• To delete selected records from the
da ta set or member.

'rlle virtual sequential access Inethod
processes virtual sequential data
sets and virtUdl sequential members of partitioned data sets.
It can be used for any
of the follOwing functions:

In addition to the restriction that th,'y
reside only on direct access devices, VAM
data sets are characterized by two facili"
ties that they provide for the user.

• To creat.e or extend a virtual sequent.ial data set or virtual sequential
member of a partitioned data set.

The first VAM facility is the sharing )f
data sets.
A user may elect to share his
data set with other users. When he does

(VSfu~)

102

Part II:

Virtual Access Met.hod (VAM)

t.his he is known as the data set owner dnd
any user who shares the data set with him
is known as the sharer.
The extent to
which the sharer may use the data set is
determined by the owner when he permits the
sharing.
He may permit read only access,
read-write access, or unlimited access.
The sharing of data sets necessitates
the use of interlocks which prevent two or
more users from simultaneously accessing
the data set.
These interlocks and their
use, as well as the rules for sharing data
sets and the routines involved in the sharing process. are discussed in the section
on sharing.
The second of these facilities is duplexing. This facility provides t.he user
with an error recovery capability by allowing him to maintain two identical copies of
his data set.
The User specifies this
option by opening his data set with the
DUPOPEN macro instruction rather than with
the OPEN macro instruction. The net effect
of this is to link two identical DeBs
together and to flag his data set RESTBL as
duplexed.
The duplicate copy is updated by
the Movepage routine as previously
described and, other than the DUPOPEN macro
instruction, the user processes his data
set as he normally would and does not concern himself with the duplexing operation.

VAM ERROR RECOVERY TECHNIQUES
Two routines are used by data management
to attempt error recovery, or to allow the
user to make the decision to attempt recovery, rather than cause an ABEND to destroy
the user's task.
The Virtual Memory Input Error Recovery
(VMIER) routine is invoked when an error is
encountered on an input operation taking
taking place on a direct access device.
If
the user has maintained a duplexed data
set, the secondary copy is used to replace
the error page in a newly assigned external
location of the primary data set, and processing continues.
The VAM Data Management Error ProceSSing
(VDMEP) routine is designed to process most
errors occurring while manipulating data
sets.
The data set in question is closed
out, appropriate diagnostics are generated,
and control returned to the user.
VMIER and VDMEP are not to be confused
with VMER (Virtual Memory Error Recording)
and VMSDR (Virtual Memory Statistical Data
Recording); these modules are called by
certain access methods posting routines and
are described in System service Routines,
GY28-2018.

~I£~

Routine

(~~CEI)

The Virtual Memory Input Error Recovery
routine is a public, read-only, privileged.
system routine which is called by the Task
Monitor to attempt recovery from an input
error occuIring on a direct access device.
(See Chart JB.)
Entry Point:
linkage.
Input:

None.

CZCEll - Entered via type-l

The ISA must contain:

ISAORV -- Virtual storage address into
which the error page was to have been
read.
ISAORE
External page address from which
the error page was to have been read.
Modules Called:
SETXP ccurred

device.

is outside the limits

VAM routines, especially OPENVAM, will previollsly have relCK~dted all known error
pages) •
If this is not the case, the page
is examined to determine if it is a DSCE
page or a data page.

For a DSCB page, the entry in the PAT is
NO n'1ct,tchl.119 external page

t~ntry

marked in error and the error page is

is

f0und ia any open ddta sel.

• An error paye

15

copy of
('7

found to be In the
d
exed c,,,ta set.

ei:r(}I.' ~:.::,;,q!~ is fcund. t::o
prevl.cu:::::ly m.al;·ki:~d in e:t.r·or",

Th(3

l1.Ef'f'f.'t

r;ejj.:.fi

A~E~D Gonditions listed a~~
,:ls,~;,tflf:',ing v~ pX'opprly functi-()ning

so>;.

'rtH'~i

snpervishD'21d be t.aker,to ll'.ean bad

paXalIlet:e:!: £;.

t.tI", pro("'lessing

Vt-1.!l':R
"r_he
~<::.~.~~jl :e:.';:j ~?4~;

dat:a se-ts",

f~:f:;.;3_t.uJ:(:

When

3yE;t.€~m to o:Kt.ke use of t.l'~e
i1~ v irt, ual (Erqd11izati()11

~n

input: error occu.rs on

0-

data. pagi2 for su.ch a dat.a set, the
copy of ,,".he dat.,). page is read and
re"fri"tt~n to a
i.H;'~1ign('d [ll':l.m.lIry data
i.J-,~q{~ locat.}.on in ext,,~rnal storage.
when fil:St entered, VMIER saver;; the
and 0stablishes r..ase regis;~_iecs f.::)x' the CSi.~;-T--r PSE{:T, and SDAT..
It.
L,,'At iock;; Ule SDAT by mear.s of the Test.
dad Set i:n::.ltx1!.l(:tion and locates the SDAT
.:) .:: '1fhich the error was ciet.eG-tt::d:,

i:h~;

:s.::;t~,

,;;'L(1 a:\y <,<.ct:ion Lait.en en

t~he

dat~~l

s~t."

At-tel' !::1:andard li.(l,K-'\siill _irr~ed:~dt(~Iy

~:=hcc~~

,'.

If so, tbe

'::\-~:"rlt"e(l"

x~·i:?qi~~-t!p..r:s

count is

recursiv~
r~(~stcr;i?d

f:r'o~~

~~hp

incr~Y-1~C1.1L'-

data set: by this task (Q1(3200 -

RESTH1, l()cK

i!:;j

'if~leas(:\d

c(mnected if nec~~$sary"
ot.he1..' useKs" the RESTn.L

QK3210).

and t:he E.E<_~TbL .ji~~. . ,,-

I f t,hez"" ''lif" ne
d:ce ixeed

pag(~s

CQK3300 - QK3570J.
n'O '':?}jen .DeBs;!,

QK9510},
cpenE-d
3~OO

\INfri },BY,til)

~

d-a"'ca

Q!\t>70t))

It'ltf,"t"'L~'ck

S€t:~3

l.z:,;

;:;.~(}O"s¥!J.

$

Release iii .:aLt""j

rf?:lea~>e

.int'eKle::ks:) a,nd l..f no S"'[¥.:JW Ls
necessu&"y -OK d.ll()",detl, thf2 data ~~:t is
clo~;~~_ ~'it.h t:_ithe!: CWSE ox DUPCl£JE:t;,}
t_h~ lXlfc'>S,;"'g€/!?'xH: phase ,.::,e th." J::Gutin~'

entered IQK3900 - QKqDSO - QK4500 - QK4100

t:.h(' cec,,-~r!:t(:H1 ~rcut,J.ne~
t h -;.' ~ };I-'~;;~-Nr-~,l
1::4 ~c r)t~} i n:t €? :.<~ Y;~" :,~j
.e!.nd ;;(;-e:~ to

,- QK91 (0),

:~:: <2-i~

r;.

If a S'1'OW .ts
on dn

~~h(~

If
}~a'i'l~i)

T':iD~~

I:r(->:~:('~yel'y

ID ";;:, 2'
l.'oUL_i

a.~~c
h~

(H'[~L...f\.I())

-the BU1Jl the U:H'X
Fox

d.

T':":lSk ID ::-:: 1.
AB.kJ:~D

c:r. pre..... loqofi/post.cS z'{;!quix;ed.. after
_I

(QKOQ4 -

l.S prorop1' ·ed toe
\'::,1(4270).

thf~

member name (QK4.250

~..

QM065 .I f t.b", I"S~:.l:' bas hdO t(lur PRiMPTs or

dtlfaults er if the task is
DeBIl) and OCB Heade:;::' checks ('LOSE

the

dat.a

set~

and

enter

the

message/exit. phase of the routine iQK!+500 --

of unopened data. sets is
Shown from (QK301.10 - QK3100).

Q1<91(0) •

If this is the secondary copy of a duplexed data set, the primary copy is found

line) which places the diagnost,ic/messdge

There is a subroutine (also used 111-

and closed (QK3041 -

QK301l~).

If a new data set was being c.t'eated, the
slot and catalog entry are deleted

oseB

(QK3055 1Q6

QK3100).

Part I I :

Virtual Access

~d

(\tNt)

and it.s inserts int.he messa,ge list (QY.9050
- QK9090).
Any messages fer SYSOU'l' that can be
written ---..,.----------··----l

Narue
! Ent.ry Point. i KNTER Code I
1:-------·-----t--«··..·------·~t---·-----·------1
I FIND
I
CZCOJl
j
• 41i·
I
I
!
I
I
! STOW
!
CZroKl
I
• 45'
!
I
I
i
I
I ESE.'TL
I
CZCI'Dl
I
• 41 •
I
I
!
CZCPEl
I
• 40'
I READl'WRITE
!
I
I RELEX
CZCPGl
I
• 42'
I
!
I ______
DELREC .____ .L..
I __________
CZCPHl
I ____________
• 43'
L
JI

I
I
I
I

t

I
I
I C I EBCDIC data.
I
!

I

X'47'
I CZ.CPI1
I
( CZCP!2
X' 4E'
I GETPAGE
X'4F'
! CZCPB
I
I
AOE
! ____________
CZCPLl
I ______________
X'1i6'
lI ____________
.L..
J.
JI

Abbreviations Used in Control
Block Descriptions

• DESCRIPTION - A brief description of
the contents and usage of a field.
FO:i:
code fields, a list of possible vaU~$
Is also given.

I

Control blocks and tables common to al.!
'JAM access methods are described in this
section. Elements which are used only by a
single VAM access method (such as VISAM)
are presented with the discussion of the
appropriate routine.

~

Interruption

Stora~fea

(ISA) -- (CHAISA)

The interruption storage area is locatec
at virtual storage addresses 0 through
4095.
One copy exists for each task.
It

CONTROk

BLOCK~

.lS

Control block descriptions in this PLM
provide ~he following ~nformation to assist
in the understanding of the Virtual Access
Method.
~

SYMBOL - The assembly mnemonic as it
appears inC-he assembly listing. DSECT
listing, or module descriptions in this
manual.

• DATA - A code to indicate the format of
the information stored in a field.
The
possible values are listed in Table 24.
108

Part I I :

Virtual Access Method (VAM)

used as a fixed communication region fo!:

interruption processing between the task
and the task monitor, and between the task
and the resident supervisor (Table 25).
Task Data Definition Table (TDT) --CCHATDT)
The TOT specifies the data set name, and
supplies information about the external
storage of the data set. This control
block is generated p:lior t.o OPEN time by
either a DDEF command or a DOEF macro
instruction.
It is updated at open time i f

necessary (Table 26).

Table 25.

Selected Fields of the Interrupt
Storage Area

r-------T----T----------------------------1
Descript ion
I

I Symbol I Data I

t-------+----+----------------------------~
IISAVMP I A
IVirtual storage [deleing
I
I
I
I origin
I

I

I
I
I
! ISANAS I N !Ne..xt available sf-gment
I
I
I
I
I
I ISATDT*I A ITask Data Definition Table I
I
I
lorigin
I
I
I
i
I
IISASPN I N iShdred Page Table number of I
I
I
I the publlc segment
I
I
I
I
I
IISATDY I A IDynamic Loader Task
I
I
I
1Dictionary
I
I
I
I
!
I ISASDS* \ A iShared Data Set Table (&DS1') I
I
I!
I
IISAVTn I X IAuthority code
I
I
I
I
I
I ISALCR* I L ITask Interruption Inhibit
I
I
I
Ilock: byte
I
I
I
I
I
IISACVP I X Icurrent VPSW
I
t----- __ .1._ - - - ~-- - - - - - - - - - - - - - ----------.--~
'*Used
directly by VAM.
l _________________________________________
JI

Data Control Block (DCB - CHADCB):
16 and Tables 21, 28, 34, and 35).

(Figure

The data control block, generated by a
DCB macro instruction, is used to maintain
information necessary for access method
routines to process a data set.
It con-'
tains data set organization, record format,
current page number, last operation, retrieval address of the current record. and
V-cons and R-cons of the access method routines (macro transfer list) to process the
data set or member.
A DCB is generated at assembly time by
the DCB macro instruction. Subsequently,
both the programmer and the system may
enter information into the data control
block fields.
The process of filling in
the DCB is completed at execution time.
Sources of information for DCB fie1ds
are, the DCB macro instruction in the
source program, the DDEF command or macro
instruction in the job stream (or DDEF
macro instruction executed by the user pro-·
gram), and the DSCB.
These sources are used in that order and
only fields not yet specified can be filled
from each source. For example, if a field
is specified in both the DDEF command or
macro instruction and the DSCB, only information supplied by the DDEF command or
macro instruction is used for the DCB; the

Table 26.

Selected Fields of a JFCB

(-------T----T---------------------------ISymbol IDatal
Description

t-------+----t---------------------------ITDTDDN I C IDDEF name (ddname)

I

I

ITDTDS1,\ C
I TDTDS2\

I

ITDTDSV
I

I
I
I

x
I
I
I

iTDTDSR

I C

I

I

I C
I
I
ITDTOPN I N
i
I
,'rn'fDSM

!TDTVPY I X

I

IData Set name

I
i

(Data Set Organization
X'04' VISAM
X'05' VSAM
X' 06' VPAM

I
I
I

t

!Absolute generation number

I

IMember name

I

INumber of open DCBs

i

!Privilege flag; X'Ol'
I privileged

~

I
I
I
I
ITDTAQL I X
IAccess Qualifier
I
I X'OO' unlimited
1
I
I X'Ol' read/write
I
I
I X'02' r~ad only
I
I
I
I
ITDTSHC I X ISharing qualifier; X'Ol'
I
I shared
I
i
I
I
ITDTDEB I A
IPointer to RESTBL
I
I
I
I
I
\TDTDCB I X IFirst 32 bytes of DCB
I
I
I
I
I
ITDTVFl I X IVolume flaq
I
I
I
I
!
ITDTIDl I C IVolume serial number
i
I
I
I
!
ITDTDSC I A IPointer to format E DSCB
I
I
I
!
i
!TDTDUP I A IPointer to secondary JFCB of:
I
la duplexed set
I
I
!
I
I
ITDTSDl I A ISymbolic Device Allocation
I
I table (SDAT pointer)
i
I
I
I
ITDTID2 I X 12nd and 3rd volumes; same
I
lformat as for TDTVF1.
I
I
ITDTID1, and TDTSDI, above
\
I
I
ITDTAPN I X IChain flag
I
1
I
I A
IChain
to JFCB appendage
lITDTAPP
______ J....
__ -.L
__________________________
.J
I

correspona~ng field in the OSCB is ignored.
The programmer can write routines that
modify any data control block field.

The DCB for VAM is composed of five
parts. The first part. of the DCB is common
to all access methods. The four remaining
parts pertain to VAM only. Their relation'ship is shown i.o Figure 16.
Section 1:

Introduction

109

--r
I

--I

"

Table 27.
(CHADCal

r-------T----T----------------------------,
Description
I

ISymbol IDatal

DC&C~n

~-------+----+----------------------------~

u,,.,j by all ace.,., ", .. thod,

IDCBOSO I X
I
I
I
I
I
I
I OCBDV11
I DCBOV2!
I De BDV3 1
I OCBDV41

I ----------- ----1

120

by' ....

I
Commt1n to all VAM Orgoni;zotion

,

I

I,

Ii

I

---f---r
32

0 •.,"".0';0"

I

-ti [.
I

16
b:i~e:.

,ended

I

,,,,,,,,,,,,,,,,,---1

Work ,r'g Slor09"

I
- l- .-

I

5~'quentTor

]8

Se-quent;ot Work ing

VJ(';fk ing Storage

___ L__ L.______

byte'!.

-'-_St_o_'a_gt!
_ _ _ _---' ___

Figure 16.

l._

DCB Format: for VAM

Relative External Storage Correspondence
(RESTBL)

Table

A control block used exclusively by VAM
is the relative external storage correspondence table (RESTBL). A RESTBL is associated with each open data set using the
virtual access method.
It contains a list
of external pages assigned to t.he data set.
The KESTBL is used to convert page numbers
:relative to the data set, to external
storage addresses.
It also maintains control over data set:. page sharing. The
RESTBL is located in an area of virtual
storage protected from the user. The area
of virtual storage that contains the RESTBL
has a read-only protection key assigned.
In the case of d shareable data set, the
RE~TBL pages are shared by user tasks, VAM
sharing rules are discussed in the section
on sharing.
A RESTBL i:; composed of four subsections
whose funct.ions are described below. The
overall relationship is shown in Figure 17.
The ~ESTBL header contains contl:01
information for using t.he RESTBL.
The second subsection, (Figure 18) < con-·
of a series of external page entries
CEPE}. with the control block identification CHAEPE.
O:U.:..its

One entry exists for each page of the

data set, and contains the relative volume
number and relative external page number,
plus the page status, defined as in use.
not in use, or assigned but not yet
written.
110

Part II:

Selected Fields of the DCB
Common

Virt.ual Access Method (VAM)

I
lCode
IX'71'
iX'72'
I X· 73'

IX'74'
IX'1,)'

DCBDV51

I
I
I
I
I DCRDDN
I

I
I
I",acro
I
.£.aram Access Routines I

IData Set Organizdtlon

!
I
I
I
! C
i

VlSM

VIS
VS
VIP
VSP
VP

VSAM
VIS AM & VPAM
VS~ ~ VPAM
VPAM t

*'

I

I·As determined by member

I organization
I
I DDEF nan... (d:lname)
I

IOCnSyv,j V,RISynchronous E.rror txit

I DCBSYR I
I
I

laddress (SYNAn)

I

IDCBEOV.I V.R!End of Data exit address
i OCBEOR I
I (EODAD)

I

I
I DCBREC I X
I DCBRCFI
I OCBRCVI
I DCBRClJ I
I
I
jDCBLRE I N

I
! Record fornat
I X'SO' Fixed
I X· 40' Variable
i X' CO' Undefined
I
!RtCord length

i

I!
I DCBKEY I N I KEY h>ngt.h
I
i
I
!DCBkKP ! N IRelative key position
I
I
I
IDCBLPA I N IRetrieval address
!
I!
IDCBEX1.1 X
IOCBEX) I

I

!

I
I
I DCBID I
I
I
IDCBDER I
I
I
IDCBLEN I
I
I
I
I
I DCBGTV. I
! DCBGTR I
I
I
I DCBPTV. I
IDCBPTR I
I
I
IDCBOPI

I

X

I
I
i
I
I
I
I
I
!
I
I
I
I
I
I
I
I
I
I
I
!
I
I

jSYNAD codes

I
I

IOPEN options

I

C

IDCB identifier:

C··%.~·

I

A

IPointer to

N

RESTB~

I

ILength of this OCB (in

I doublewords)
I

V R IGET routim,$
I

I
I
V, R I POT routine.
I
I

IDCBPXV.! V,RIPUTX routine.
i DCBPXR I
!

I
I
I
I DCBSLV • I V, R I SETX routine·
jDCBSLR I
I

I

.-------~----~----------------------------f

,.R-cons .-- Pointer to save areas on a
I
It _________________________________________
dynamically allocated page
JI

Table 2B.

-r ------

Description of the Fields Comprising the VAM Organization
Independent Working Storage

r-------T---~----------------------------,

ISymbol IDatai

Description

I

RESTSL Heade,

!

(CHARHD)

r----

~-------t----+----------------------------~
IDCBVNA I A IVMA ot next record in buffer I

I

I

IDCBCPB I N

I
I
I
I
! [)CBDPN! N
I
I
I DCBCBPI N
I
I
I
I
iDCBN
I N
I
I
IDCBM

I

I DCBOP
I

I N
I

I
I

X

I

iCurrent paqe and byt,-;
I defi ned as follows:

I

lcurrent data page number

I

IByte position relative to
I current paqe

I

IFirst page in request

I

INumber of requested pages

I

IVAM General Services
!Operation:

I
I
I DCBOPO I
i
I
I
I
I DCBOP11
I
I

I
I X' 8000' Input., set Read
I interlock
I

t

I
I

I interlock
I

.,

I
I X' 0800' Insert
I

IX'1I000' Loader request

I

I DCBOP2t

I
I
I
I
I
I
\
I
I

iX'2000' Input, set Write

DCBOP31

IX'1000' Output

DCBOPIII

I

DCBOP51

IX'0400' Delete

I

I

DCBOP61

I

IX'0200' Release Read
I interlock

I
I

I

I DCBOP71

IX'0100' Release Write
I i i interlock

1
t
I DCBOP81
\
I
I
I
IDCBhv
I N
I

I

N

IDCBNI

I

I
!
\

IDCBSHC

C

I
I
!
I
I
I
I
I
I
I
I
I
I

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

I

1
I

I

I

I

I

IX'OOBO' Replace blank pages I
I on ani nse r t
I
IHash value of member name (61
Ibits)
i

I

IFirst page in request.
Irelative to data set Icomp~ted by VPAM routine
IGETNU~BR (CZCOO>

I
I

I

I

I

!

I

i

I

ITYPE of search request; see I
iSEARCH (CZCOL}
I

IC'~'

I

Member name

I
I

I

IDCBHD
A i IDCB
header in RESTBL
l _______ I ____
____________________________
JI
~

l

~ize 1'\

262,144

Page En!' i '"
((HAEPE) - - - - -

Available Space
(ZERO byte,)

T

----------~

DCB ond Member
Head.. "

(CHADHD & CHAMHD)

.____ 1_
Figure 17.

RESTBL Fermat

------ 4

Rf!lotive Volumll!' Number

\4 -

Figure lB.

"1

by'''' External Page Number

-·-;I...·~---- 16 ------1

RESTBL External Page Entry CHAEPE

For shared data sets, a 4-byte interlock
word in each EPE controls sharing of the
page. The interlock control word, and
method of updating it, is discussed in
detail in the sections on VAM sharing.
The third and fourth subsections of the
RESTBL"designated as DCB and member headers (CBADHD and CHAMHD), are constructed at
open time.
Address pointers in th(" DCB
header identify associat9d control blocks:
DCB, JFCB, POD, RESTBL heaoer. The DCB
header is linked to the RESTBL header or
the member header (if partitioned organization) Dy DHDLNK.
The DCB header link, and compatible
field design of the R~STBL and member headers. make it pass ible to pl-oces~3 members of
data sets identically.

I

(C'E' Either alias or member I
!name
I

I

I

I
I

I

!C'A' Alias name

::_
E

A RESTBL is created for d data set by
t.he OPENVAM (CZCOA) routine, using information ext ract.ed from the DSCY-·s of the
volumes where the data set resides.
Each
volume contains all lata set control blocks
(DSCBs) for the data sets contained on that
volume.
At open time, the external page
ent ries (EPE) are built from extents found
in the DSCB.
As the data set is generated,
additional extents are obtain(,d dynamically
Section 1:

Introduction

111

by REQPAGE (CZCOE). Once d shared data set
is open. no new RESTBL is generated by any
subsequent OPi!.'N, that is, only one RESTBL
ever exists at a time for a shared data
set.
However, for each DCB opened for a
data set, one DCB header will exist in the
.R~TBL.
If this is a shared. nonf,arti'tioned data set, each user's DCB ",,,'ill have
a DeB header.
Each of these headers, in
turn, is linked to the RESTBL header.

64 words. part of the SOOT header, gives
the address of the first member within each
hash chain.
In addition to the data set
and member chains. two chains of deleted
entries are maintained in order to recover
space for building data set or member
entries. Dcta set and member entries are
linked to tIle appropriate deleteci. chain
when their user count 1eaches zero.

• ORGANIZATION - Sequential or Index
Sequential

The information in the data set and
member entries is used to control access to
a data set, ~nd also to provide a common
location to store the information (shared
page table number and RESTBL address)
necessary for multiple tasks to obtain
access to an existing control block in
shared virtual storage. This control block
is updated by the VAM general services routine Search SDST (CZOQE) ~hich has the following capabilities:

• RECORD FORMAT - Fixed. Variable or
Undefined

• Search the SDST for a specified data
set entry and/or member entry.

• CONTENT - Starting page position in the
RESTBL, number of data, overflow, or
directory pages

• Modify data set or member entries by
incrementing or decrementing the user
count. This capability also provides
for creating or deleting such entries.

Foz:- a partitioned data set, the DeB
headers of each open DCB will be 1.inked to
member headers.
The basic purpose of the RESTB:!.. header
or member header is to document three items
of importance:

The RESTBL header also accounts for
pages assigned to the data set, but not yet
in use, as well as available virtual
storage in the RESTBL.
ClOSing a DCB causes its DCB header to
deleted from the RESTBL. In a partitioned data set, this also causes the member headpx to be deleted provided no other
DeB headers exist for that member. The
RESTBL header and external page entries
will remain in virtual storage until the
last DCB is closed. At that time. the CLOSEVAN (CZCOB) routine will return the contents of the RESTBL to the DSCBs associated
with the data set.
De

Descriptions of fields for the RESTBL
header (CHARHD) and for the DCB header
(CHADHD) are provided in Table 29 and Table
30, respectively_
Shared Data Set Table (SDST)
The SDST, whose address is given in the
interruption storage area (CHAISA) of each
~ask. consists of a header (CHASDS> and a
series of data set (CHASDE) and member
{CHASDM) entries. The SDST format is illustrat.ed in Figure 19. Tables 31, 32, and
33 provide field descriptions of the SDST
header, a member entry and a data set entry. The data set entries are linked by
forward and baCKward chain pointers, with
the pointer to the first data set entry in
the SDST header. Member entries are
organized into 64 hash chains. The hash
chain to which a member is linked is
generated from the member name. A table of
lt2

Part II:

Virtual Access Method (VAM)

The linkages between a user's DCB and
the RESTBL. POD, and JFCB for a member of a
partitioned data set, are shown in Figure
20. DHDLNK is shown as linked to either a
member header or the RESTBL header, since
this field, when the data set is nonpartitioned, will point to the RESTBL header.
If t.his data set were shareable, the
RESTBL and POD would be in shared virtual
storage.

SDST MAINTENANCE
The following routine maintains the
shared data set table (SDST).
Search SDST Routine (CZCQE)
The Search Shared Data Set Table routinE
is called by OPENVAM (CZCOA), CLOSEVAM
(CZCOB). Find (CZCOJ). Stow (CZCOK), and
the dynamic loader, to ada, update or
delete, data set or member entries in the
shared data set table (SOOT), and establish
correspondence to sflared virtual st_orage.
(See Chart JD.)
Entry Point:
linkage.

CZCQEl - Entered via type-l

Input: Register 1 contains the address of
a four-word parameter list:
Word 1

Address of JFCB.

Word 2

Address of DCB.

Table 29.

Field Descriptions for the RESTBL Header -- (CHARHD)

r-------T----~---------------------------,

ISymbol IDatal
Description
I
~-------+----+----------------------------~
I
I
I The first Ii bytes of the
I
IRESTBL form a VAM interlock I
I
I
I
I
lword which is updated by
I
I
I
IINTLK (CZCOH) and RUNTLK
I
I
I
I (CZCOI)
I

I

IRHDI~

I

IRHDI~

I

IRHDINN

I

IRHDINI

I

IRHDNAP

I
I

IRHDNEP

I

IRHDFEP

I

IRHDDIR

I
I
I
I

IRHDDAT

I

lRHDOVF'

I

IRHDRPG

I

IRHDTUD

I
I
I
I
I
I
I

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

L
N
N

L
W
N

w
N

N
N
N

I

I
I
I
I
tRead interlock
I
I
I
ICount of read interlocks set I
I
I
IUpdate interlock
I
I
I
\Write interlock

INext available External Pagel

I Entry (EPE)
I

I
I

I

I

ICount of available EPE

,

IFirst EPE of data set

I

I

I
I
I
I

I

,
I
I
I
I
I
I

ISize (pages) of the Indexed
ISequential Directory or
IPartitioned Organization
(Directory (POD)
IData set size (pages)

I

INumber of overflow pages

I

IRESTBL size (pages)

I

I w ILast header built from

,

I

I
lavailable space. This
I
Ifield, when decremented by
I
I
I
I the s iz e of t:he header to be I
I
Ibuilt (DCB=48, member=32)
I
Igives the address where a
I
I
I
Inew header may be built
I
I
I
I
IRHDFLG I X IData set organization:
I
I
I
I X' 80' Shared
I
I
I
I X'qO' partitioned
I
I
I
I X'20' Index Sequential
I
I
I
I
I X'OS' ISO Integrity
I
I
I
I X' Oq' POD Integrity
I
I
I
I X'02' DSCB Integrity
I ________ J.I _ _ _ L..
I __________________________
X'Ol' Recatalog Flag
L
JI

r-----·--~---,.--------------------------l

ISymbol IDatal
Description
I
~-------+----t----------------------------~
I RUDIN I I L I Lock byte for the next 6
I
Ifields
I
I
I

I
I RHDDCB
I
I RHDODC
I

\RHDADC

I
I

IRHDOMC

I

IRHDAMC

I
I
IRHDPOD

I

I
I N
I
I D
I
I D
I
I
I D
I
I D
I
I
I A
I

IRHDTID I D

I
I
I Number of DCBs t.hat are OPEN I
I
I
I First DCB header
I
I
I
IFirst deleted (available)
I
IDCB header space
I
I
I
IFirst member header
I
I
I
I First deleted (available)
I
lmember header space
I
I
l
I POD
I
I
I

ITask ID which set RESTBL
I
I
I interlock
I
I
I
I
IRHDVTA I A IAddress of the volume table I
I
I
I
I
IRHDSPT I X IPointer to the format E DSCBl
I
I
I
i
IRHDCPO I N IData set cumulative pageout I
I
I
I
I count
I
I
I
I
IRHDSAL I A ISecondary allocation (ESA)
!
I
I
I
I
IRHDRFM I X IRecord format
I
I
I
I
I
IRHDKYL I X IKey length
I
I
I
I
I
IRHDPAD I X IVI pad factor
I
I
I
I
I
IRHDRKP I B IRelative key position
I
I
I
I
I
IRHDRCL I N IRecord length
I
I
I
I
I
IREDDSO I X I DSORG
I
I
I
I
I
IRHDCRD I X IChange/Reference Date flags I
I
I
I
I
IRHDOPC
I ____
X J.\Option
codes
L
_______ J.
__________________________
JI

1
I

Section 1:

Introduction

113

Table 30.

Field Descriptions for the DCB
Header -- (CHADHD) (Part 1 of 2)

r-------T----T----------------------------~

j Symbol I Data,
Description
I
~-------+----+----------------------------~

I DHDL>CH
I
I
I DHD.JFC
!

I
I
I
I
!

A

I
A

jDEuTSK I N
I
I
I DdDiiES I A
I
I
IDHDPOD I A
I
I

A

IDHDLNK

!
i

I
I
!
!Dt-iDOPN I
i
I
I
I
i

I
I
I
I

lDHDINT

IJFCB

(TDT)

for

the dat~

ITask identification

,

I
I
I

!

IPOD address

I
ILinkage to either the RESTBLI
!header or to the membf'r
I
Iheader if this is a
I
i partitioned data set and a I
imember is active (FIND has
I
Ibeen done)
I
!OPEN options jDCBOPI

SdIllt;

as

I
I

I

I
I
I
1'I'he following 4 fields are
I ' used with VSAM organization:
I
j
I A :Buff~r address
I
I
I N IBuffer size (pages)
I
I
I N IFirst data page checked out
I
I to thi s DeB
I
I
I N INumb~r of pages checked out
It.o this DCB
I
I
I
I A IOverflow buffer
I
I
I A IVISAM directory location
I
I
I N lcurrent data page
I
I
I N ICurrent overflow page
I
I
I N IMaximu~ record length
I
I

IDHDNDH.I W
IDHDPDH I

IForward and reverse DeB
Iheader pointers

I

I

I

IDHOF3P

I

IDHDNBP

I

IDHDFDP

I
I

/DHDPCO

I
I
I

I
I
I

I

IProtection class of the
I
Ivirtual storage in which thei
IDCB resides
I
X'03' Read only
X'Ol' Read/Write
X'O}' Private privileged

I

IInterlock summary.
This
Ifield is updated by INTLK
ICCZCOH), RLINTLK (CZCOl).
land VAMABIR (CZCQQ)

~

Part II:

I
I
I
I

i

I

I
I

ISome of the above interlocksl
lindicate eitner a read or a I
Iwrite interlock.
The next 51
!mask values indicate which
I
lof the control blocks are
I
I
I
Iwrite interlocked.
I
l _______ ____ .J..___________________________ J

114

Description
I
~-------t----t----------------------------~
I
I
I X' 0200' SDST data set entry I
I
I
IX'0400' HESTBL header
I
I
I
IX'Oaoo' "'ember descriptor inl
I
I
I
POD
I
I
I
IX'lOOO' POD
I
I
I
IX'2000' External Paqe
I
I
I
i
Entries
I

I
I
IDHDCOP
I

I
I
I
I
I
IThe following reflect
I
linterlocks set in the
I
jindicated control blocks:
I
I
I
IX'OOOl' Data Set Entry in
I
I
SDST
I
IX'0002' RESTBL header
I
IX'0004' Member descriptor in\
I
POD
I
IX'OOOS' POD
I
IX'OOIO' BPF that are checked I
I
out to this DCB
I
!X'0020' Member heaaer in
I
I
RESTBL
I
IX'0040' SDST centrol entry
I
IX'OOSO' ~ESTBL header
I
I
partial interlock
I
I
set (RHDINI)
I
IX'OlOO' SPT number in SDST
I
!
Data Set Entry
I
I
locked
I
I
I

I

r-----~---T--------------------------~

I Symbol IData I

I
I

I
X

I
I
I
set I
I

I
I RESTBL address
i

I

X

I DHDPRO I X
I
I

I
I

I(Jed ds!;ociated with t.his
Iheader

Virtual Access Method (VAt-D

Field Descriptions for the DCB
H•• der -- (CHADHD) (Pa.rt 2 of 2)

Table 30.

jDHDISD
IDHDeDP

I

IDHDNOP

I
IDHDMRL

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
,
I
I

I
I

I
I
I
I
I
f
I
I
I
IDHDDXP I A ICUrrent External Page
I
I
I
I Address
I
I
I,
I
I
IDHDOXP I A IOverflow External Page
I
I _______iI
! ____________________________
Address
L
-___
JI

IDHDDUP I A

IAddress of duplex copy of
I the RESTBL

~

Co""o'

';~~:~:'"

ToO"

I

1 Segment

U I~ ~to_s~_t_an_d_M_em_b_er_-En_t(_i~ ~iT
Iv\ox imum

i

_______

Figure 19.

____(CHA50E, CHASOM)

__

Shared Data Set Table (SDST)
Format

Table 31.

Field Description of the SDST
Header -- (CHASDS)

Table 32.

r------T----T-----------------------------,
\SymbollDatal
Descript~on
I
~------+----t-----------------------------~
ISDSICIT/ L
ISLJc;T interlock byt~e.
If set. I

jaccpss is not ~~rmittpd
I
I
I
j SDSLPNI N
I Last page numb€r dssiqned to I
l i t h e SDST
I
I
I
I
I

I
I

I
!

ISDSSPTI

I
I

N

I
I

!SDSAVAI A

I

I
I
I
I

j

I

t
!
IBDSDE

A

ISDSD1"lEj A

I
I
I
INext byte of available space I
I in the BDST
I
I
I
IFirst deleted Data Set Entry I
I
I
IFirst deleted member entry

j

I

I
I
I

ISDSSDEI A

IFirst Data Set Entry

i
I
! SDSHAS I
I
I
I
I
I
I

I
I First mc-mber ent.ry

A

I

ILast assigned Shared Page
ITable (SPT) numb€r

for each

j

I
I
I
I
ISDSPLKI L IV~A lock on SDSPS~
I
I
I
I
I
IL ______
SDSPSN .LI:~
! ___
public
segment numoers
____ ..L
._________________________
JI
lof the possible 64 hash
I values of member names

ISA

Field Description of a Member

Entry -- (CHASDM)

r------T----T-----------------------------,
ISymbol\Dat,lt
Description
I
~------+----+-----------------------------~
j SDI'lCIN j A
I N,'xt memrH'r pnt r y ill t hio;
I
I
Ihd:;h <111d'; c:ldin
I

!

I

I
I

l
I

I

I

I

1

!SDMNUR! N

IN~mDerof

users

i~

this

I

! mer.lb'3r

!SDMSPTI N

i

I

I

IShared Page Table (SPT)
!number assianed to this
I melT,DEr

I

I

I

I

I
1

I
ISDMNSPI N
INumoer of shared pagt's
I
i
I
I
I
ISD~WSPI N
!Number of the first shared
I
I
I
I page
I
I
I
i
I
ISDl'lLSD I A
I Data Set Entry corresponding !
I
I
I to t.his member
I
I
I
I
I
IL SDMNAl-l
I ____
C
I _____________________________
Merrber na:ne
______ .L
.L
JI

SDST
(e HASDSl

(CHAISA)

IOATDT

((HASDM)

ISASDS

(CHASDE)
( SDES?T,

t

SOEFSP

DC8

RES fBl

,CHAi\HO.
f - - - - - \ C HAfPE;

((HADCS)

f---~~r--.--------------------~~

(( HAMHOl

~ TOT

(TOTODN)

'---- TOTDES

ex: BSP

(CHADHD)

DCSHD
DHDPOD

I--

DCBS(

POD

(CHATDT)
JFCB]

OCBDEB

DHDOC B

DHDlNK

DHORES
DHD.lfC

__

IC HAPOD)

C

(CHAPOf)
~----'------'--l
I
(C HAPOM)2
I-------------.-----j
(CHAPOM)l

~------------

JFCB n

Figure 20.

ICHAPOM'n

Linkage Relationships Among Control Blocks Used with VAM
Section 1:

Introduction

115

Table 33.

Field Description of a Data Set
Entry -- (CHASDE)

r------T----T-------------------------------,
I

!

I

I

\SymbolIData!
Description
I
1--- --- -+ ---+--------- -- --- -------------- --i
!SDECHNI A iNext data set entry
I
I
i
I
I
I
I The next 4 bytes form a \TAM I

I

I

I

!
I

I

I

I
I
I SDEINN I
I
I
\SDEINI I
!
I
!SDENURI

i

I

IWrite interlock

N

iSDESPTI N

I
I

I SPT number

I
I
I

I

I
INumber of shared pages
!
!SDENSPI N
I
I
I
I
lNumber of the first shared
I
!SDl:;FSP I N
I page entry
I
i
!
I
I
I
I
ISDENAMi C
IData S~t name
I
l ______ J. _ _ _ J. _____ ._________________________ J
I

I

I

Word 3 -- Address of 8-byte member name,
zero if no member.
Word 4 -- Address of 1-byte type code:
C -

close

o - open
U -

user count only

lo-JOdules Called:
Interlock (CZOoH1) -- set write (W) interlock on a shared data set ent.ry (SDSE).
Release Interlock (CZCOI1) -- Release write
(W) interlock on an SDSE.
ABEND (CZACP)
task.

Abnormal termination of

Exits:
Normal -- For Open option:

'00'

Entry existed.

'08'

New entry built.

'10'

Data set does not exist.

For Close option:
'00'

116

Error -- ABEND 1,; ,-,Ill,'j Wh"ll <'lit' ,-,t
following conch t ion:; .'Xl ,;t :
•

No pOlntPr

t h.,

to tht, Den.

• The data set is non-YAM.

I

!Number of users

L

D'-Ita set dl','s not .'xist.

I

N

I SDEINH i

'10'

• SDST or shared page tablE' alrf'ady
locked by this task.

L

L

Entry cLospd, no mure users.

linterlock word which is
I
lupdated by INTLK (CZCOH), and!
I RLINTLK 
I

I
I
I
jRead interlock
I
I
I
ICount of read interlocks set I
I
!
I Update interlock
I

jSDEINW!

'04'

Entry closed, users still exist.

Part II:

Virtual Access Method (V AM)

• Current pC'inter is higher than the
"1 d "t P,HT('- poi ntf'r.
•

Ther~'

is insufficient sPdce for the
m('mbE'.1: entry or data set entry.

• An attempt is made to clnse an unknown
member or an unknown dat.l set.
• An attempt is made to access a nonshared data set by two different
tasks.
operation:
OVerall operation of this
module consisits of entry linkage. data set
name search, member name search. analysis
of user requirements, updating of data set
entries and member entries, and either a
normal return, an error return, or an
ABEND.
After completion of linkage and loading
base registers from the parameter list,
this module checks that the DeB code is
present in the field DCBID.
If unequal,
ABEND is invoked.

By use of test and set (TS) and time
slice end (TSEND), execution of this task
will be delayed until the SDST interlock
byte is found in the reset state.
At that
time, this task has exclusive control of
the SDST, and a search through the chain of
data set entries is made beginning with the
SDSE specified in SDSDSE, by comparing the
44 byte data set name in the JFCB with the
data set name in each SDSE in the chain.
If the end of the SDSE chain is reached
before a matching data set name is found,
or i.f no chain exists, an SDSE for that
data set name does not exist--subsequent
action depends on the option requested by
the calling routine in the parameter list.
When a matching name is found, this task
will delay execution until the shared page
table number (SDESPT) is not equal to
X'FFFF' (SPT lock condition).
If the lock
condition is present, and this module was
not called by ABEND for release of interlocks, the portion of the SDSE search for
the specified data set name which follows
interlocking the SDST, will be repeated.
Then if a member name was specified in the

list of input pdrameters, a search for that
name entry will be perforrued.

n~n~er

The 8 byte member name is hashed to 6
bits using the logical operation -exclusive
or". That hash value is used to pick one
of the 64 member entry chains,. and the
selected chain is searched for the specitied member name.
Each member name entry
in the sEelected chain is compdred against
t.he member name specified in the parameter
list.
If equal, the data set name in the
SDSE addressed by the member entry is compared.
If both arf~ equal, the proper member entry has been found and will be processed by this routine.
If no member entry
chain exists or no matching member name is
found or matching member names do not point
back to the SDSE previously found. then no
mE'mber entry exists. Continued processing
de~nds on options specified in the par~­
meter list.
The following describes processing following data set and member name searches.
If the SDSE was not present, and a member name was specified, an error return is
made.
If a member name was not specified,
and the option was CLOSE, an error return
is made. Otherwise, a new SDSE is built,
whether from the chain of deleted SDSEs or
from available storage, and linked to the
active SDSE chain with the user count set
to one. Insufficient storage will cause
ABEND.
For VSAM or VISAM organization,
Interlock (CZCOHl) is called to impose a
write interlock on the SDSE if the OPEN
option is non-Input. A return is then made
to the user with a normal completion code
and the address of the found SDSE in general register 1.
If the SDSE was present and a member
name was not specified, thf' organization
and operation will be cheCKed prior to
updating the SDSE. If thi:; is not a VAM
organization, ABEND occurs.
If this is
either a VSAM or VISAM data set (but not
VPAM) to be opened, for OUTPUT, OUTIN, or
UPDATE, the presence of an SDSE indicates
that this data set has at least one user
and is therefore not availdble to this
task.
If a VSAf-l or VISAM data set is to be
opened for INPUT and a write interlock
exists, the data set is not available.
For

either of thesf' two cases, the interlock on
the SDST will be released, and TSEND will
be used to delay processing of this task
until the other tasks have ceased to process that data set.
Each time the task is
reinitialized. the procedure to search for
the SDSE will he started at the point
(described above) where an interlock on the
SDST is established by use of a TS.
Where a VSAM or a VISAM data set is to
be opened for input and a write interlock
does not presently exist, Interlock is
called to impose a write interlock on the
SDSE if the open option is other than
INPUT.
It is not necessary to impose a
read interlock, since the presence of an
SDST entry without a write interlock
implies a read interlock condition. Thtc,
last operations to be performed are, to
increment the user count, in the SDSE. place
the normal return code in register 15, t,he
address of the SDSE in register 1 and
return to the calling routine.
This is
done for VSAM or VISAM opened for input,
and for any VPAM open.
When the specified operation is CLOSE
and no SDSE exists, the interlock on the
SDST is released, and an error return is
made to the calling program.
When the specified operation is CLOSE
and the SDSE was found and a member name
was specified, the count of users will be
reduced. If this count reached zero, the
member entry will be deleted from the member chain and its space appended to the
deleted member chain. A return will be
made to the user with a normal completion
code.
When the operation is CLOSE, the SDSE
was found and no member name was specified;
if the data set organization is VSAM or
VISAM, Release Interlock is called to
release the interlock that had been set on
the data set-R read or write according to
the OPEN option in the DCB.
Following
that, the user count in the SDSE is reduced
by 1. If the count reaches zero, that SDSE
is deleted from the chain of active SDSEs,
and its space dPpended to the chain of
deleted SDSE. A normal return is then made
to the user.

Section 1:

Introduction

117

All direct access devices (2311 or
2314), on 'Which 'lAM data sets reside, "re

initialized and maint.ained in a st.andax·d
format.
All space on these volumes, w:, t.h
the exception of cylinder 0, track I, ,wd
possibly cylinder 0, track 1, is tr-"atpd in
units of 4096 bytes (one page). As:;ociated
with each volume is a page assignmentt.able
(PAT) which contains entries for all of the
f.• ages on the volume.
The lengt h of the PAT
depends on the type of device and currently
occupies one page on the 2311 volu""", and
two pages on the 2314 volume. This tabl",
i,,; {-,olnted to by a field in the volume
label.
Each pntry in the PAT is 1 byte long.
If the first hit of the entry is zero, the
page represented by the entry is either
available for assignment to a data set or
15 already assignE'd.
The remainirg 7 bits
provide a binary count of the number of
data sets sharing the page. When this
count is zero, the page is available for
assigmnent.
If the first bit of the entry is 1, t.he
lJage it represents is either a oseB page or
an error page.
If the second bit of such
an entry is 0, the entry represents a DSCB
page, that is, the page contains data set
control block~3 (DSCBs).
F.ach DSCB page can
contain up to 16 DSeBs and is, accordingly.
divided into slots.
When only 4 of these
slots remain available on a page, one of
two flag bits is set to one.
This indicates that the page is only to be used for
nsCBs which further describe data sets
already included in that DSCB page. The
second of these flags is set to 1 when all
16 slots on the page are in use. The function and format of the DSCBs will be discussed further below.
The third type of entry which can be
found in the PAT is the error page entry.
This entry represents a page which is
unsuitable for use due to surface errors
discovered by the RESTORE utility and is
.. icat.ed by a 1 in bits 0 and 1. Followill'] }~h€ Fdge entries .in the PAT, t.here are
:0"".I>f this ~;pace are used for relocation
entries. The last word in the table is a
relocation control entry, which maintains a
half-word count of the number of relocation
entries which precede it, and a half word
(X'FFFF') if there are any entries. The
other 96 words may be occupied by relocation entries.
These entries contain the
relative page number of the error page, and
118

Part II:

Virtual Access Method (VAM)

the relative paq"
page.

number of the n location

Associatec. wit:h ('dch data set .s one or
more DSCBs. The first of these centrol
blocks is callec a form"-It-E DSCB; if additional space is required t-.O descr;be the
data set., fonna t-F DSCBs an' buill and
chained to the format-E DSCE.
A data set
and tnf" DSCB!; which describe it mily be on
more t.hun on': volume.
Because of this, the
chaining procedure used qives the relative
volume number and the relative paqe number
on t.hat volume ""here the next DSCR is
located.
Also. sinc p each DSCB ~ige contains up to 16 DSCBs. the slot number of
the DSCB is included.
F.ach format:-E DseR
contains the data set name and properties
and possibly t.-he extf~rnal page entries
which give the location of the ddta set
paqes on external storaqe.
Thes.- entries
contain the relative volume and relative
paqe number on the volume where the data
sM~ paqe is located.
The concept of relative volume numbers,
introduced above, arises from the possibilit.y of a data set occupying more than one
volume.
For public data sets, this relative volume number provides an indexing
factor into the public volume table. This
table consists of a 16 byte header, which
contains a count of tile maximum number of
public volumes allowed. and the count of
public volumes actually in use.
Following
the header is a series of 16 byte entries
representi'ng each volume assigned to public
storage. The entry contains the volume 10,
the device code, and the symbolic device
address of the volume.
This information,
in conjunction with the pathfinding tecution.
During execution, a data set may be
aynamically increased or diminished in size
Section 2:

Insert/DElete Pdge (C2CO[;) -- Effects t.he
addition or deletion of pages in a data
set and performs error checks to determine the validity of the operation.
Insert (CZCOF) -- hdds external page
ent ries represent. ing the new pages to
the task's RESTBL.
Request Page (CZCOE) -- Provides Insert
with a list of available pages for insertion into the RESTBL.
It also marks
t.he pages in use and unavailable for
assignment.
Expand RESTBL (CZCQI> -- Increases the SiZf'
of the RESTBL for nonshared data sets
when the addition of new page entries
causes an overflow conditcion.

DELVAM (CZCFT) _.- Deletes a virtual organization data set by deleting its catalog
entry and freeing the external pages and
DSCB slots which it occupies.
Insert/Delete Page Routine (CZCOD)
The Insert/Delete Page routine is called
(CZCOV), GETPAGE (CZCPI), and
Add Directory Entry (CZCPL) to check and
perform insertion or deletion of pages
wit.hin 'd data set. The validity of the
request is checked, based on the specific
request and on parameters in the DCB and
RESTBL.
(See Chart KA.)
by FLUSHBUF

Entry Points:
CZCOD1 -- Insert pages, entered via type-1
or type-2 linkage.
CZCOD2 -- Delete pages, entered via type-1
or type-2 linkage.
Input: Register 1 contains the address of
the DCB.
Two fields which must be set in
the DCB are:
DCBN -- Page number, relative t.o the data
set or member, at which the operation is
to take place.
DCBM -- Number of pages to oe inserted or
deleted.

VAM Volume Format and Data Set

Maintenanc~

119

Modules Called:
Insert (CZCOF1) -- Insert additional pages
at a specified position within a data
set and move all other active pages
upward.

Initialization and general register
is executed in conformance with
linkage conventions.
Base registers are
declared for the calling program's save
area.
CZCOD CSECT and PSECT, DCB, DCB
header and RESTBL.
storag~

Reclaim (CZCOG1) -- Delete specified pages.
Interlock (CZCOH1) -- Set a write interlock
in the RESTBL external page entry.
Release Interlock (CZCOI1) -- Release write
information on RESTBL.
GETNUMBR (CZCOO1) -- Validate and perform
insertion or deletion on a partitioned
data set.
TSEND (CEAH19) -- Force end of time slice
for this task, to wait for interlocks in
shared pages to be released by the tasK
that had set them_
VOMEP (CZCQR1) -- output a diagnostic message and terminate the function (but not
the task).
Exits:
Normal -- Return to the calling routine
with one of the following return codes:
• 00'

Normal.

'04'

No storage space available.

'OS'

Storage ration exceeded.

'oc'

No secondary storage allocation
specified.

'10'

Shared data set RESTBL cannot be
expanded.

'lU'

Maximum data set/or member size
exceeded.

'1S'

Insertion beyond end of data set.

'lC'

Deletion beyond end of data set.

Error -- VDMEP is called and the function
(not the t.asJd terminated if an invalid
return code is received from Reclaim,
Insert, or GETNUMBR.
Calls to CZCOD are for the loginsert. ion or deletion of data pages
wi 'Chin a data set.
If the routine is
entered at the primary entry pOint
(CZCOD1), the Insert flag in the DCB operation field (OCBOP) is set to insert
(OCBOP4).
If entry is made at the secon-·
dary entry point (CZCOD2) in the case of a
deletion, no indication is set at this
time. The code from these two types of
entries converges to perform module
initialization.

s-~peration:
~cal

120

Part II:

Virtual Access Method (VAM)

Insertions (,r de let ions m"y not b.' .loop
on data sets which are oj.wnt'd t or input
only. If the DCB open option indicates
input, ABEND is called immediately. The
RESTBL is interlocked for shared data sets.
If the data set is partitioned, GETNUMBER (CZCOO) must be called. The requested
operation is tested.
If the Insert flag is
not set as descrbied in the entry procedure, the Delete flag (DCBOPS) is set and
GETNUMBR called. Upon a successful return
from GETNUMBR, control is returned to the
user by the RETURN macro, since GETNUMBR
has already accomplished the desired insertion or deletion.
For nonpartitioned data sets, CZCOD performs a great deal of the consistency and
validity check required for the insertion
or deletion.
The extent of a deletion, that is, the
first page plus the number of pages being
deleted, must be contained within the data
set.
If any of the pages to be deleted
falls outside of the range of the data set,
ABEND is called.
Reclaim (CZCOG) is called to accomplish
the deletion. The return code from Reclaim
is tested for errors.
If general errors
exist or the deletion was requested on
pages of a shared data set that were interlocked, an appropriate return code is set
and control returned to the caller. Upon
successful deletion, control is returned to
the caller by the RETURN macro.
If the
data set is shared, the RESTBL interlock is
released before returning.
An insertion must be made within the
range of the data set or contiguous to the
last page.
If the insertion is requested
outside or not adjacent to the data set, an
appropriate return code is set and control
returned to the caller. The actual insertion of the data page is performed by
Insert (CZCOF).
The return code from
Insert is tested for errors.
If they
exist, VDMEP is called. Control is
returned to the caller by the RETURN macro.
For shared data sets the RESTBL interlock
is released before returning.
Insert Routine (CZCOF)
Insert is called by Insert Page (CZCOD),
Extend POD (CZCOM), and GETNUMBR (CZCOO) to
insert additional -in useR pages in the

RESTBL of
reque~;t.

data set involved 1n the
(See Chdrt KB.)

th~

Attributp~;:

Redd-only.

reentrant.

fJrivileged.
Entry Point:
linkage.
_!nput:
the DCB.

CZCOFl -- Entered via type-l

Register 1 cant a i os t.1"€ address of
Fields used 1n the DCB are:

OCBN -- First page of data set involved in
request (nonpartitioned).
OCBNI -- First page of data set involved in
request (part_it_ioned).
-- Number of pages involved in
request_.

DCB~

Insert may be called to insert pages
between existing pages of the data set or
to simply add pages to the end of the data
set.
In the latter case, Request Page will
have added the new pages at the end of the
list of "in use" pages and no additional
IoIcrk is requiJ:-ed of Insert.
If pages are
being added between existing pages, it is
necessary to create a gap in the list of
Win use" pages in the RESTBL.
For this
purpose, a 64-word work area is provided in
the PSECT.
This area will hold 32 shared
or 64 nonshared external page entries.
The
new entries are moved into this work area
starting from the beginning of the available list.
All l."Urrent -in use" entries
follow1ng the point of insertion are moved
back in the RESTBL an equal number of words
to create a gap.
The new page entries are
then moved from the work area to the gap
thus created. This procedure is repeated
until all new entries have been inserted.

OCBOP -- Type of operation requested.
Modules Called:
Request Page (CZCOE1) -- Flags additional
external page entries "in use" in the
available page chain in the RESTBL.
Request Page will also atte~pt to
increase the number of pages available
to the task. by calling FINDEXPG, when a
SUfficient number of pages is not available to fill the request.
VDMEP (CZCQK1) -- Output a diagnostic message and terminate the function (but not
the task).
Exits:
Normal -- Return to the calling routine.
Error -- A valid error code returned from
REQPAGE is passed back to the calling
routine in register 15.
An invalid
error code returned from REQPAGE results
in VDMEP being called.
Operation:
When Insert is first entered,
registers are saved and base registers
established for the CSECT, PSECT, DCB, DCB
header, and RESTBL header.
Insert then
retrieves the number of the first page to
be inserted and the total number of pages
to be inserted from the DCR.
Next, the
virtual storage addresses of the next
available page and of the location of the
insertion are computed. and a call is made
to Request Page (CZCOE).
Request Page will
flag the requested number of pages -in useby setting the flag in the external page
entries in the RESTBL.
If a sufficient
number of pages are not available to fill
the request, an attempt is made to add
pages to the available list from external
storage.
If Request Page is unable to fill
the request, an error return is made to the
calling routine by the RETURN macro
instruction.
Section 2:

In the case of duplexed data sets, this
process is repeated for the secondary copy.
after which the DSCB integrity bit is set
and a normal return is made to the calling
routine. The setting of the integrity bit
will cause CLOSEVAM to call Write DSCB to
update DSCBs on the volumes.
In this manner, pages dynamically added to the data set
are made unavailable for future allocation.
Note that this routine does not interlock the RESTBL for shared data sets. This
is so because Insert assumes that the calling routine had done so before calling it.
Also, Request Page is responsible for
updating the counts of external pages in
use, available pages, and the relative
location of the first available page.
Expand RESTBL Routine (CZCQI)
Expand Relative External Storage Correspondence Table is called by OPENVAM
(CZCOA). MOVEPAGE (CZCOC), Request page
(CZCOE), and Find (CZCOJ) to increase the
size of the RESTBL by one page. The additional space appears between the external
page entry words. and the DCB and member
header control blocks.
Note that a RESTBL
which resides in shared virtual storage
cannot be expanded.
tOL.1q('

Expand RES'I'BL calls Expand (CZCG4) :Jy
the CALL macro to eX'~and the virtual
stora':je of tne RES'IBL by 1 page.
Afte:c the
expans.lon, the RESTBL pointers, are upjated
1.0 the JFCB if the RESTBL was relocated in
the expansion. RESTBL point.ers (VM
addresses) on thin the DCB dIld member hea ders dre updated if the RESTBL has been
reloc'l.ted.
T':", DCB and member headers are moved on
the new page up to the top header; this
creates space between the external page
entries and headers, for the insertion of
new information.
The relative pointers
within the headers, and the DCB and member
headers are updated by 4096 to reflect
their new position.
\:0

When thf' new virtual memory space has
been obt.dined, and all point.ers and
addresses which need to be adjusted have
been updated, Expand RESTBL returns to the
calling module by th~> RETURN macro.
Not_(:, t.hat a RESTBL which resides in
shared virtual storage cannot be expanded.

Request External Pages is called by
Insert (C'lCOD) and OPENVAM (CZCOA) for the
purpose of assigning available external
pages to a data set.
If sufficient pages
are not available to fill the request, an
attempt is made to increase the size of the
aata set by calling FINDEXPG (CZCEI,).
The
newly assigned pages are added to the
t.dsk·s RESTBL or, in the case of a shared
data set, t.O the shared RESTBL.
If this
addition results in an overflow of the
RESTEL, it. is expanded to accommodate the
extra pages in Lhe case of nonshared data
:''''~:~''
Since a shared RESTBL cannot be
('xpdnded. thi.s condit.ion results in a call
t.O VDlIj':P (CZCQKl).
(See Chart KD.)
Attributes:
privileged.
Entry Point:
linkage.

Read-only, reentrant,
CZCOEI -- Entered via type-l

Input:
Register 1 contains the address of
the DeB.
Fields used in the DCB are:
122

Part II:

Virt_ual Access Method (VA.I<,O

DCBN

Relative number of the first page
affect.ed.

Modules called:
Expand RESTBL (CZCQll)
Increases the
size of tne RESTSI for a nonshared data
set. when the jnclusion of the newly
assigned p.:'g~!s causes overf low of the
c'"Ur:::ent

R~;TBL.

FINDEXPG (CZCEL1) -- ASSigns additional
external pages to the task from the
storage allocated to the task.
(CZCQKl) -- Output a diagnostic message and teruQnate the function (but not
the task).

VD~£P

Exits:
Normal -- RETURN to the calling routine if
successful or if the request is for zero
pages with one of the following return
codes in register 15:
'00'

Normal.

'04'

No external storage available.

'OS'

Storage ration exceeded.

'OC'

No secondary storage allocation.

'10'

Shared data set RESTBL cannot be
expanded.

Error -- VDMEP is called if an invalid
return code is received from FINDEXPG
(CZCELU.
Operation:
Initialization and general
register storage is performed in conformance with standard link.age a:>nventions and
base registers are established for the
CSECT, PS,CT, DCB, DCB header, and the
RESTBL. The number of pages involved in
the request (DeBM) is checked and, if the
request is for no pages. a normal return is
made to the user.
The function of Request Page is to
assign external pages to a task's data Sel:
from external storage which has been previously allocated.
These pages may be
assigned from either the primary or the
secondary allocation if it ie be assigned
from either the primary or the secondary
alocation if it exists.
Additionally. the
page entries in the RESTBL are flagged -in
use- and any pages which have been assigned
are added to the RESTBL.
These operations differ in two ways for
shared or nonshared data sets.
In the case
of shared data sets, two words of RESTBL
space are required for each page entry; the
additional word is occupied by the page

~nterlock required for shared data sets.
The other difference is t.hat the rtESTBL
cannot be expanded for shared data sets.

space allocation is depleted.
In the latter case a call l.S Illdde t.o ABEND.

Following the initidlization process,
the data set is ~xamined to detErmine 1£ i t
l~o shared.
Wit.h th<:> f'xception c·f the aboVE
noted diff~rences. tn~ processing 1S the
same; t.he exception; '.. 111 al~;o be ment.ionec.
in the follo",nnq (je;;cripl~ion.
In each cas.'
the RESTEL is teste,j (RHDNEP) to ciet~ermine
1f suff1cient pages are already assigned.
If they are, the pages are flagged -in use W
in the RESTEL external page entries, and
the count of available pages (RHDNEP) anj
the locat10n of the next available page
(RHDNAP) dre updated 1n the "ESTBL.
A test
le; made to determine if this is a duplexed
oata set dnd if the secondary RESTBL must
0till be processed.
If both dre true,
REQUEST PAGE lODIX; back to the point of the
t.est for "no pages requested", above. and
repeats the procedure.
If the data set is
not duplexed or if the secondary copy has
Deen processed, a normal return is made to
the caller.
If Request Page finds that. there are not
sufficient pages assigned, it attempts to
assign sufficient pages from the secondary
space allocation (the user may have
requested up to 256 pages).
It no such
allocation was made, a call is made to
ABEND.
If such allocation was made, the
RESTBL is examined to see if there is
enough available space in the RESTBL to
hold the new external page entries.
This
space exists in the RESTBL between the
existing entries and the headers which are
at the end of the RESTBL.
If the RESTBL
does not contain enough space and the data
Set is shared, a return is made to the
caller with an error return code.
If the
data set is not shared, a call is made to
the Expand RESTBL routine to provide the
space required.
Following t.his call or if
the RESTBL contained suff icient free space,
a call is made to Find External Page
(CZCEL).
Find External Page will return
t.he addresses of 256 pagE's to be assigned,
or the remainder of the secondary allocation if it is less than 256 pages.
If the
data set is not shared, t:lis list is moved
directly to the RESTBL following the last
previous entry.
If the data set is shared,
the entries are moved, one by one, from the
return area to the RESTBL, and each entry
is preceded by a full word of zeros which
serves as the interlock word for the page.
For both types of data set a switch is set
to indicate that the DSCE should be
updat.ed, and the number of available pages
is updated in the RESTBL (RHDNEP).
Request
Page then returns to check if enough pages
have been assigned.
This procedure is
rE'oeated until enough pages are made availabie to the task or until the secondary
Section 2:

When the request for pagP~; is satisfied,
each page entry i~; flagged" Hi use" and Uv'
next avaL.ablp paqe location (RHDNAP) 15
dd Justed.
Finally. t hfc: check:; for duplexPJ
dd til set. ,nO s"conddry H~,-;TPL update ar..ri:Teated.
If a ~,:pcondary Pr;::TBL Dust l:w
processed, COiH roJ is returnEd to tne ;Joint
of check for no paqes; ot.herwisp, a retllrn
IS made to the call~r w1th a normal return
code.

Reclai~ is called by Delete Page
(CZCOD), GETNUMBR (eZeOO). and Stow (eZect')
to delete external ~age entries from the
"in use- list in t.he RE,sTBL and place them
in the available list.
This has the effec~
of removing the pages from the data set,
but the pages remain allocated to the task
and may be reassigned at some future time.

(See Chart

KE.)

Att.'!"l:putes:
Entry Point:
linkage.
~ut:

the DCB.

Read-only,

public, privileged.

CZCOGl -- Entered v;.C\ type-l

Register 1 contains the address of
Fields used in the DCB are:

DCBNI -- First page to be deleted (par:tioned data set).
DCBN -- First page to De deleted (nonpartitioned data set).
DeBM -- Number of pages to be deleted.
Module called:
ABEND (CZACP1) -- Abnormal
task termination.
Exits: '
Normal -- Return to the calling routine.
Error -- A return code of '04' is set in
register 15 if the request is to delete
shared pages which are interlocked.
ABEND is called if the data set organization is VPAM.
Ql~!~ation:

The operation cf Reclaim is
essentially the same for shared and nonshared data sets.
In the case of duplexed
data sets, the process is repeated for thp
secondary RESTBL .}.n order t.O maintain symmetry between t;he copies.
The funct_ion of Reclaim is t.O mark the
deleted pages not in use and to add them to
the available list. in the RESTBL.
This is
accorr.plished by set:t ing the proper flags in
the ext.ernal page entries in the RESTBL,
and by mOVing the external pages entries
from the chain of ftin use- entries to the

VAM Volume Format and Data Set Maintenance

123

cnain of available entriec.
(~>;(p

:~)

trjf'
~/l

t.il!.lk,

!Hj

H(c'cLn.m

the RESTbL to

2;)~

This creates a

tJ-.e cha i n uf all entr .les

t'as~igned

to

moves the entries up
the gap \:iee Fiqure

CLO'lP

In f'iddition>,

tt)e

.i.:nt.egrity t i l t in !:he

[<:::STBL hedck,;:: 15 set..
Tilis causes CLOSEVAM
(CZCC~)
to call Wrlte osce which w~ites out
·C:{le entr:.e~; fro;;; ttle RESTBL to the DseE on
Lhe volurr~e..
t"rhe effect is to make all
d2ieted pages whiCh a=e not reassigned to
the ta3~, available for allocation to some
othe~ task after the data set is closed.
~~en keclaim is entered, registers are
5:::"'/(:C in conformance wi t.ll 1 inkage comren~lons &nd base registers are established

f 0: t.;.';.e CSECT, l? SECT, DCB, DeB header, aDd
t

;-",2

RESTBL header.

The number of. pages to

0e deleted is checked and,

if zero, control
If there are
to be df,leted, the address of t..'1e
iIS~ external page entry to be deleted is
c~mputed, together with L~e amount and
addl.""ess of unused space in the RESTBL .
:;'3

re"tt.:rned to the user.

./',;:. 't.his point, t.he process~n9" for shared
nonsnared data sets diverges.
The distu;ction arises from the difference in the
size of L~e external page entries (8 bytes
fo: shared, ~ bytes for nonshared). The
2rQc~SS~n9 is log1cally identical for both
and the following description applies to
~~d

The amount of available space in the
is compared to the amount of space
=equired to hold the deleted entries.
If
the space is large enough, the deleted
e::lt.ries are moved from the .. in use" chain
~o that area, the entries are flagged as
r.;:ct: in ·... se, and the entries following the
S&~ left by the deletion are moved up to
close t11e gap.

sha:;:-ed entrles are moved from the "in use"
area, and are flagged
not ~n usc.
The gap ieft by this deletior, ocs cl()sect and th{. deleted entries
are ddQC'd ":0 the end cf ti1e crlain of
avallatle entrlCS.
Th1S process is repeated until all deletlon entrles have
been processed_
chalfl to t..he work

Following the movement and flagging of
entrles, L~e data set is checked to see Lt
it is duplexed and if the secondary RESTBL
remains to be process~d.
If both conditions are ".et, the entire process is
repeated for the secondary RESTBL.
When
all entries for all copies of the data set
h~ve been handled. the DSCB integrity bit
(REDFLG) in the RESTBL header is set, to
cause t..~e updating of the DSCBs on the
volume or volUlnes, and control is returned
to the caller.
DELVfu~

Routine (CZCFT)

Delete a VA."! Data Set is callecl by Erase
(CZAEJ), ADDCAT (CZCFA), and Recreate Public Storage (CZAXX) to delete a VAM data
set by deleting its catalog entry and marking all its DSCB and data page entries
"available" in the page assignment table.
If tlle data set is private, the volume or
volumes on which it resides are demounted.
Optionally, the associated JFCB may be deleted.
(See Chart KF.)

,U~S'l'!';r,

If the amount of available space is not
L .. rge enough, a 64-word work area in the
PSECT is used for intermediate storage of
the entries.
Up to 32 shared or 64 non-

I----l

,}

:;-;'77.'='?! )~1

\n::r."'7'77,..,.,j

\ Available
( Space

~~J

124

J
I

Go P

1----4

Pages

Figure 21.

1""'''""""''"1 )

in use

Pog'"

~~I

1?7J=~,

1----\ '\ AY~;labie

IJ

Available
Poge,

1

Available
Space

?

~="'4J

Deleting Pages from the "In
Use" List in RESTBL

Part II:

Virtual Access Method (VAM)

Attributes:

Read-only, public, privileged.

Entry Points:
CZCFT1 -- Main entry, entered via type-l
linkage.
CZCFT2 -- For generation data groups only,
entered via type-l linkage.
In~ut:
On entry, register 1 contains a
p01nter to a three-word parameter list:

Word ,.-- If entered at CZCFT1, a pointer
to a 3S-character (without userid) data
set name.
If entered at CZCFT2, a
pointer to a Q4-character (includes
userid) data set name.
Word 2 -- A pointer to the JFCB to be
deleted if that option is chosen.
Word 3 -- A pointer to the JFCB deletion
indicator.
This indicator is a one byte
flag which is set to X'OO' if no deletion is to be done or to X'80' if the
JFCB is to be deleted.
Modules Called:
FINDDS (cZAEcl or CZAEC2) -- Locates or
creates a JFCB for the data set when a
pointer to one is not provided by the
calling routine.

LOCFQN (CZCFL2) -- G~t T-block to see if
BULK I/O pending.

• When end-of-DSCBs occurs before endof-volume fields.

SETXP (CEAH7) -- Prepares the eKternal page
tdble to allow a virtual storage page to
be read in.
Search SDST (CZCQEl) -- Provides a count of
users currently sharing the data set.
RELEXPG (CZCENl) -- Called to release all
data pages and DSCB slots used by the
data set and allocates them for future
assignment on the volume.
DELCAT (CZCFDl) --- Deletes the catalog entry for the data set.
FREEMAIN (CZCi-lA3)

-- Frees 1:he space occu··
piea by the private volume table.

RELEASE (CZAFJ3 or CZAFJ6) -- Release the
JFCB when that option has been
specified.
READWRIT (CZCEM)

Read in DSCE page.

DSCBREC (CZCEFl)
Attempt recovery on a
read DSCB error.
WTL (CZABQl) -- Send message to operator
and record it in the system log.

If DELVAM was called by LOGOFF, ,\BEem,
or Close, a call to LOCFQN is made to-::heck
for Bulk I/O pending.
If it is pending,
normal return is immediately made to the
caller.

Exits:
Normal -- Return to the calling routine
with one of the following codes in
register 15:

Next the dat.a set must be tested fo c
sharing. This is determined by a ca~,l to
Search SDST.
If the data set is share:i,
only one user may be currently accessi~g
the data set and the user deleting the dat&
set must be e1ther the owner or a shar'C'r
with unlimited access.
If eit.her of t."!eS2
conditions is not met., an error return is
made to the caller.

'00'

Data set deleted.

'04'

Deletion not made due to open
DCBs.

'OS'

No deletion due to active
sharer.

'oct

No parameter list passed or FQN
not indicated by Word 1.

'10'

Shared dat.a set not owned, not
unlimited access.

'14'

DSORG not VAll..

'lC'

Delete option specified. with
JFCB pointer O.

Error -- Before continuing, a message is
written to the system operator and system log via WTL under any of the following conditions:
• When a good return code is not
received from RELEXPG.
• When an attempt to recover a DSCB with
a bad checksum is unsuccessful.
Section 2:

Qperatio!!: On main or secondary entry,
DELVAM saves input registers and establishes base registers tor the CSECT an'l
PSECT in conformance wi t.h linkage conven'"
tions.
The secondary entry, at CZCr'T2,
allows a gener'ation dat.a group flag to be
turned on, and then joins the main log~c"
The input parameter list is now checked for
the presence of fully qualified name.
If
none is present, an error return is made tn
the calli ng rout.ine.
If the FQN is present, a test 1S made tor the presence of a
JFCB address.
If no such address is given,
a call is made to PINDDS, to find a JFCB or
to create one.
For a generation of a
generation data group data set, FINDDS is
called at a secondary ent.ry point, CZAEC2.
using the userid specifled in the input
parameter list. {)therwise, PINDDS i';
called at CZAECI and task common will De
referenced for the userid. Once the JFCB
has been located or created, tests are made
to determine if only one DCB is open and if
the data set is VAM organization.
If ,'ither test fails an error return is made to
the calling routine.

Once this testing is complete or if tne
data set is not shared, DELVA.."l checks '.0
see If a RESTBL eXlsts.
If one does e <:ist
the data set is still open and it must be
closed. calling Release at CZAFT6.
·~)n·:e
the DCB is closed or if it. was closed ' 0
begin with, a test is made to see if there
l.S d. DSCB.
If none exists, there are ;]0
pages in the data set and processing w,ll
continue with the JFCB release de~,;crih.'d
below.
Gata Set PaGe RelE.·as e:

f

Wl'1en the data :;et

IS deleted,- all external pages occupied by
the data set are freed for future allocation to another task.
If the dat.a set is
private, a private volume table pointer is
st.ored in the caller's PSECT.
A£t.er tnis
or if the data set is on public storage, a
dummy RESTBL 1.5 constructed.
This i,"
necessary since the prio:c close of tn, DCB
caused the deletion of the RESTBL.
Ed~h

YAM Volume Format and Data Set Maintenance

125

DSCB is ther. read in turn. For private
vol~mes there may be several volumes in the
volume list.
These entries are skipped
over not.il the ext.ernal page €ntries are
loun,:).
TheBP external page entries are
UH'fI moved u) a parameter list area in pre[)aration for: a call to RELEXPG.
Whfn the
p,Hdmeter Ih;t is full or when all ('xternal
L)i:i<)e entries have been moved to the list.
;·;'LF.oXPG is called to perform the re:ease.
The pages are marked available for assign".21~t in the page assignment. table.
This
r.;roced:rre i,; repeated until all external
'f',22qes t;2.'Je been released.
If, in the proce~~lS Df releasing pages, an entire uSCB
P2C,<' is cleared of DSCBS, the OSCB page is
also a.dded to the parameter list and it is
·c,:iea.sed.
Any errors encountered in
;:;::::LEXPG result in messages t.O the system
operator and log.
Following the release of
pages, the pointer to the dummy
Then, or i f the data
RE.3TBI, is cleared.
set: had ;-,0 pages, the JFCB deletion indicator is tested.
If no deletion is

126

Part II:

Virtual Access Method (VAM)

requested. proceSSing continues With Catalog Deletion below.
The JFCB is released
by calling Release.
An error return from
that routine results in messages to the
system operator and log.

l2atalo'OL..P~.let:-"oTl:
If the catalog entry ;;'5
to be dele-::ed, a call is made to DEi.CAT to
perform the deletion.
If an error return
is received from DELCAT. the operator is
notified and it is recorded on the system
log via WTL.
The cataloq entry will not be
deleted if t.he data set had no external
pages, if DEl,VAM was ent.erect by the Recreate Public Storage routine, or if t.he data
set is USERCAT or SYSC;'.T.
Followina the
deletion of the ent.ry or if no deletion is
performed, the exit. procedure is entered
This process involves testing to see if the
data set is public or private.
For privat""
data sets. a call is made to FREEMAIN to
release the virtual storage occupied by the
private volwne table.
DELVAM then returns
to the calling routine ~{ means of the
RETURN macro instruction.
<

SECTION 3:

The data set sharing facility provided
in TSS/)60 requires that th~' dat", sets to
be shared be organ~zed for acceSE by one of
the virtual access methods. The coharing
concept also relies on a system cf interlocks which prevent the simultar..eous reading and/or writing of one 1~cord by more
than one authorized user. Two types of
interlock are provided
a read interlock
and a write interlock.
A read interlock prevents a UEer from
writing to a data set, data set member, or
data set page. A read interlock is never
actually placed on a data set. The interlock is implied by the presence of an entry
for the data set in the shared data set
table. When a user attempts to open a data
set, the shared data set table is searched.
If there is an entry in the table for the
data set, the write interlock is tested.
If that interlock is set, no other task may
access the data set. If the write interlock is not set, a read interlock is
assumed and a second task may open the data
set for any operation which would impose a
read interlock. Several users may therefore have simultaneous read access to a
data set but if only one user has write
access to it, no other user's task is
allowed any access. Read interlocks are
set on pages of a shared indexed sequential
data set. This interlock prevents other
users from writing to the interlocked page
but permits them to read from it.
A write interlock prevent.s read or write
access to shared data by any user other
than the one who caused the interlock to be
set.
Only one write interlock can be set
on a given data set at a time and once set,
it precludes the setting of read interlocks
on the data set. Additionally, if a read
interlock is in effect on a unit of data, a
write interlock cannot be set.
Interlocks are maintained in various
tables depending on the data set organization. Regardless of the table which contains the interlock it is maintained in a
four byte field called the interlock word.
This field is aligned on a word boundary
and has this format:
r--T---T~--'

IW I

R

IN II I

l __ J.. ___ J.. __ J.. __ J

W - Write interlock
R - Read interlock

N - Number of

interlnck~

DATA SET

SEARn~G

currently set

A virtual partitJ.oned data ~;i't is intert.he memoer' 1'''1''1. The interlock
word for each rnembe::, of d partitioned data
set is contained ii> t.hc.' member header I!,
the HESTBL (CH.l'l."1'W). The interlock is "et
according l~O the organi zation of the men,ber
and the op1~ion sp"ciried in the OPEN macro
instruction. The interlock is set. when th,>
FIND macro instrurtlon is issued, and
released when the STOW macro instructio~ is
issued or when the dat.a set is closed.
Table 34 11sts the open options, and the
type of interlock which is set for each.
Shared access for members depends on the
organization of thp lnember as dlscussed
below.
lockl?:d at

Virtual sequent ial data set.s are intE:'rlocked at the data set level. The interlock word for these data sets is ~~cated in
the data set entry of the shared data set
Lable (CHASDE). The type of interlock
imposed depends on the option specified in
the OPEN macro instruct.ion. Table 35 lists
these options and the applicable interlock.
'I'he data set is interlocked when it is
opened and the interlock is relf'ased when
the data set is closed. Since :c:everal
users may have simultaneous read access to
a data set, a count is maintained of the
number of users currently accessing the
data set,. As each user op,~ns the data set,
the count of users is incremented. As each
user issues the CLOSE macro instruction,
t.he count is decremented and only when it
reaches zero is write access permitted.
A virtual indexed sequential data set or
member is interlocked at the page level as
well as at the data set level. T~at is to
say, while one user is reading from one
page of a data set, other users are
restricted in their access to that page,
but may access other pages in the data set
as:o;uming that the type of access attemptfcd
does not violate the data set or member
level interlock. The paqe level interlock
words for virtual index sequential data
sets are contained in the external page
entries (CHAEPE) in the RESTBL. One word
of interlocks exists for each page of the
data set and the locks are set and reset by
the Movepage routine (CZCOC). Table 36
lists the effects of various open options
on page level interlocks.
A page level read interlock is placed on
a page when a GET or type-KY READ macro
Section 3:

Data Set Sharing

127

Tdble :i4.

LtreCL of OPEN Uption on Member
interlock~;

in M,emner Header

r------------r-----------------------------,

references ii paqe ot.her than the one in
which the write interlock is set.

I

lOPEN Optioni IntE'rlock Type (Set by FIND)

----------+-----------------------------~
rr.;PUT
! READ
I

CONTROL TABLE INTERLOCKS

--M--------t---------------------- ----- --~
!OUTPUT

i

!WRITE

~-----------t-----------------------------i
i r NC.;?
I WRITE (VSAA me..rnber)
I

; CUTIN
(UP;)ATE

L_.M __________

Table 35.

I
I

; READ (VrSAM member)
;

i. ____________________________ J

Effect of OPEN Options c'n Datd.
Set Interlocks in SDST

The SDST interlock is a one byte field
at the beginning of the SDST control entry.
~hile that lock is set, no other task may
access the SDST.
Within t:he SDST, data set
and merr,ber ent r ies are made t.O record the
allocation of shared storage. The Search
SDST routine, which makes the SDST entry,
does not allocate the shared storage, but
simply reserves space in the SDST for the
allocation to be recorded.
The reserved
space must be interlocked to prevent system
usage of the SDST entry before the allocation is actually completed.
This is done
by setting the SPT number to X'FFFF', which
is an invalid SPT number. After allocation
of shared storage. the routine obtaining
the shared virtual storage will store the
actual SPT number in the SDST, thus releasing the pseudo-lock.

r---------------r-------------T---··----------,

i O"EN Option I vs~

I VISAM

i

~-----------+------------t-------------~

IIm!Jlied READllmphed READ!

ilNPUT

r-------------+------------+-------------1

! OlTPUT
I WRITE
! WR ITE
I
~------------+------------t------------~

I
I
I Implied READ I
!~D~E
I
I
I
------·-------·l.------------J.------------i
: t\'ote:
No interlocks are set on VPAM I
,INOUT

!"lUTE

.OU'fIN

~

. __________________________________
datci sets at OPEN time.
I
J

Cable 36.

Ef feet of OPEN option of VISAM
page Level Interlock

r-----------T---------y------------------,

[Interlockl
iOPEN Optionj
Type
I

When Set

I
I

.-----------+---------+------------------f

I READ
t When page is read i
~-----------+---------t------------------~
jUPDATE
!WRITE
JREAD Exclusive,
I
t
I
IWrite by new key, I
; INOUT!
IWRITE replace by
I
i
I
I key, DELRAC
I
\ OUTIN
i READ
tREAD by key and
I
lall other operaI
I
Itions causing a
I
I
I
Ipage to be read
I
t-----------t---------t------------------~
Il OUTPUT
___________ I None
_________ LI __________________ JI
I INPUT

~

l.nstruction is issued. A page level wirte
interlock is set by the type-KX READ macro
instruction which also releases a page
level read interlock set by that task.
Other macro instructions which release a
page level read interlock when issued by
t.he task which set it are WRITE, ESETL,
DELREC, RELEX or CLOSE.
If the task issues
any macro instruction which references
an~t.her page, t.he read interlock: is
released.
A page level write interlock is
released by the GET, type-KY READ, RELEX,
WRITE, DELREC, or CLOSE macro instruction
or by any macro instruction which
128

Part II:

VAM has t~o control tables which reside
in shared virtual storage - the RESTBL and
the SDST.
Rcutines which manipulate these
tables must interlock t_hemto prevent them
from being changed while in use.
These
interlocks do not have the (~nventional VAM
interlock word format.

Virtual Access Method (VAM)

The RESTBL interlock must be set by
those routines manipulating the RESTBL of
shared data sets. This includes most of
the VAM modules.
The RESTBL interlock i:3
the first byte of the RESTBL header, and
has the same effect as a conventional write
interlock.
Most VAM routines can be called
at a variety of levels; that is, when a
routine is called that may manipulate t:he
RESTBL, the interlock mayor may not already be set.
For this reason, each routine
attempts to set the lock.
If the lock is
already set, the tasks must wait until it
is reset, unless it was set by the current
task against the current DeB.
This information is in the RESTBL.
The ID of the
task imposing the RESTBL lock is recorded
in the RESTBL header (RHDTID), and the
interlocks charged against a DeB are recorded in the DeB header.
As with setting the RESTBL lock, each
routine which attempted to set the lock
must attempt to reset it, but only the routine which actually set the lock will
effect its release. This is accomplished
by storing, in the RESTBL header, the PSECT
location of the routine which caused the
lock to be set.
When backing out of a nest
of calls, each routine will attempt to
reset the RESTHL lock, but if it did Dot
set it, a return is made to the next higher
level with the interlock still in force.

ShaIln<] ot viLt Ud l organi zatiOJl data
c;ets is dppendent_ urx)n the owner pennitting
the sharing hy means of the PERMIT command
and the user declaring his intention to
share thp ddt.a set by means of th.> SHARE
eommanri.
The command syst.em rout.lnes and
ccltalog serviC('~ routines set. indi':ators in
the owner"s catalog which indicate his willingness to share t.he data :,et. the users
with whom he is willing to share ~t, and
the access to the data set he wishes each
to have.
These routines also set indicators in the user's catalog which associate
the data set name he is using with the
owner's data set.
Three routines in the acce~;s methods
provide the additional proces~;ing required
to facilitate the sharing of data sets.
The first two of these routines, Interlock
(CZCOH) and Release Interlock (CZCOI),
maintain interlocks in various tables ir.
the system. These interlocks prevent two
users from simultaneously updating a data
set.
The third of these routines is the
Search SDST routine (CZCQE).
This routine
searches the shared data set table in an
effort to locate the name of a shared data
set or member of a shared partitioned data
set. This table consists of a group of
chained data set or member entries, which
correlate opened data sets or roembers with
their respective shared page tables. These
shared page tables, in turn, specify the
location of each page of the data set in
main storage. and are followed by the
external shared page tables, which list the
external storage addresses of the data set
pages.
If a data set is not already listed,
this routine will create an entry for it;
if the data set is listed, the count of
users sharing it is incremented. This routine is also used to delete entries or
decrement the count of users sharing the
data set, as each user closes his DCB associated with the data set. A description of
Search SDST is included in the preceding
section.
Interlock Routine (CZCOH)
Interlock is called by other system routines to impose read (R) or write (W)
interlocks on an interlock control word.
The type of interlock set depends upon the
OPEN option. Tables 34, 35, and 36 summarize the effects of these options on the
operation of Interlock. The interlock control words are used to control shared
access to the POD, RESTBL (header or
external page entries), member headers, and
SDST data set entries. When a write interlock is imposed, no additional read interlocks may be set.
If a read interlock is

set, the task attempting to set a writ.e
interlock will wait unt.il all read interlocks have been removed by the tasks that
set them. No additional read interlOCKS
will be set duri ng this wai t .
(See Cha rt
LA. )
Restrict ions:
It is impossible to imPOl'"
more tha.n 255 read interlocks with this
routine.
Attributes:
Read-only, reenterable, privileged. public, system.
Entry Point:
linkage.

czeOHl -- Entered via type-l

Input: Register 1 contains the address of
the following parameter list:
Word 1 -- Address of the interlock control
word.
Word 2
Address of the type code specifying the interlock to be set.
Word 3 -- Address of the DCB associated
with the data set on which the lock is
being imposed.
The type code pointed to by word 2 is a
2-byte field described as follows:
Byte 1 specifies the type of interlock to
be reset:
C'R'
C'W'

= Read

= Write

Byte 2 specifies the table in which the
interlock is to be reset:

X'OO· = SDST
X· 04' = RESTBL
X'OS' == POD
x'oe'
Member Header
X'10' '" External Page
The DCB address normally specified in
word 3 may be set to zero if it is not
known. However, during the time that an
interlock remains imposed after no DeB
address was specified, it must be assured
that the system will not ABEND.
Modules Called:
TSEND (CEAP9) -- End this task's time slice
while waiting for a lock to be reset by
another task.
SYSER

lling routine

Wl h the specified interlock set.
cornpletion code i~; given.

No

by an additional lock oyte within t.he
interlock word it.sPlf.
Tht' writ.,. lC'C-K i"
reset, the re.:id lOC-K is Accounted tor In
the DeB header, and cont rol i tI 1 t't \l[ 00',1 t ,\
thf' caller by th(' Rr:'1"llHN """(-lll im;t lllct H'll.

Errccs -- Th" tYl-"~ cndes supplied art
checked fin validity dnd a SYSER c.nd

ABEND dre given if either is invalid.

S:.:.Ep:cat ion:
Initiali zat.ion and gener,.l
register storage is executed in conformance
';.Ii th linkage conventions.
Base registers
aLe declared for the CSECT and PSECT, pararreter list, DCB, DCB header, interlock word
and type codes.

Release Int'~rlock (RLINTLK) is called by
system routines to release read (R) and
write (W) interlocks on an interlock control word.
(See eha rt LB.)
Attributes:
Read-only. reenterable, privileged, public, system.

The interlock type and the table type
Wh-eT e t.he interlock is to be imposed are

tested for validity.

The write interlock byte of the interloci< word is tested to determine if a write

inttrlock is already in force.
If the
write interlock is on and the request is
not. for d RESTBL lock, time slice end is
forced by calling TSEND. This allows other
tasks to continue processing and eventually
H"lease the intl?rlock that the current task
was attempting to set.
The RESTBL lock is handled slightly different from other interlOCKS.
Each routine
which manipulates the RESTBL attempts to
set a write interlock on the RESTBL. which
i:-~ accounted for 00 a OCB wi. thin task
uasis.
A call tothtO interlock routine may
De execut.ed for a RESTBL interlock and the
i{ESTBL may already bt: locked.
If t.his condition occurs and the same task which set
the initial lock is attempting to set
another against the same DCB, control is
returned to the caller, as if the lock had
just be61 set. Otherwise, TSEND is called.

If the write interlock byte of the
interlock is not set, interlocks may be set
as desired. The locks will be recorded in
the interlock summary word of the associated DCB header.
In addition, if the
lock is set on the RESTBL, the virtual
storage address of the PSECT of the calling
routine is saved in the interlOCK word, and
is used in the interlock reset process.
The interlock to be set is either read
write.
The write lock which is already
set is recorded in the DCB header. and control is returned to the caller by the
RETURN macro instruction if no read locks
are currently set.
Otherwise, TSEND is
called to wait for the read locks to be
released.

Entry Point:
linkage.

CZCOIl -- Entered via type-l

Input: Register 1 contains the address of
a 3-word parameter list as follows:
Word 1

Address of interlock word.

Word 2

Address of the type interlock.

Word 3

Address of DCB being processed.

The type of interlOCk pointed to by word
2 of the parameter list is a 2-byte field
described as follows:
Byte 1 specifies the type of interlock to
be reset.
C'R'
Read
C'W' == Write
Byte 2 specifies the table in which the
interlock is to be reset:
X'OO'
SOOT
X'04'
RESTBL
X'OS" == POD
x 'oct =I Member Header
X'lO'
External Page
The DCB address normally specified in
word 3 of the parameter list may be set to
zero, if it is not known.
It should be
known, if it was known at the time the lock
was set.
If it is not specified the interlock summary bits in the DCB header will
not be reset.

01:

Read locks are set cumulatively.
The
read interlock is set and the read interlock counter is incremented to indicate the
presence of one or more read interlocks.
This read interlock process is controlled
130

Part II:

Virtual Access Method (VAM)

Modules called:
TSEND (CEAP9) -- End time slice while wait.ing for a lock to be reset by another
task.
SYSER (CEAlS2)

Invalid input to CZCOI.

ABEND (CZACP1)
SYSER.

Terminate task after

VDMEP (CZCQK) -- When desired lock to be
set is not set.

Exits:
Normal -- Exit is to the calling routine by
the RETURN macro instruction.
No completion code is given.
Error -- The type codes are checked for
validi ty and SYSER and ABEND are called
if either is invalid.
VDMEP is called if an attempt is made to
release a lock that is not set.
Operation:
Initialization and general
register storage is executed in conformance
with linkage conventions.
Base registers
are declared for CSECT and PSECT, parameter
list, DeB, DeB header, interlock word and
type codes.
If the table type code specified is
invalid, SYSER is called. Also. if the DeB
is specified, and the summary bit in the
DeB header corresponding to the interlock
intended to be released does not indicate
that the lock is on, VDMEP is called.
A release request may be for a read or a
write interlock. A special case of this is
the RESTB!. interlock. The RESTBL interlock
must be set and must be released by the

same routine that set it. The PSECT
address of the routine requesting reset l~;
compared to the PSECT address ,~tored in the
interlock word.
If they are the sam.", the
lock is reset and control is returned to
the caller by the return macro instruction.
Otherwise the lock is not reset before
returning.
A request to release a write interlock
will cause the interlock to be reset.
If
the DeB is specified and the summary dces
not indicate that the requestea lock is
set, SYSER is called.
If the summary does
include the requested lock, the bit is
cleared and control is returned to the
caller by the RETURN macro instruction.
Read interlocks arp releaspd by decrpmenting the read interlock counter. When
the count_er goes to zero, the physical and
read interlock is cleared.
The manipulation of the read interlock
and the read interlock counter are controlled by an additional lock in the interlock word.
The control lock is reset and
the summary bits are reset if a DeB was
specified.

Section 3:

Data Set Sharing

131

SECTION 4:

OPEN AND CLOSE PROCESSING

This section describes the routines
which prepare d ddt.d set and its related
control blocks for processlng (OPEN) dnd
.y-out ioes ....hi ch remove d task's refe! ences
1:0 d data set. and release unneeded ~. pace
whpn a task no longer wishes to reference
;hc: (ldtca set (CLO:;E:).
The routines in this
section can be enter~d as a result of one
at seven macro instructions being issued:

1.."

OPEN -- a user wishes to aeces!; or
create a data set.

OPENVAM Routine (CZCOA)
OPENVAM ~s called by Open Common (C2CLA)
to perform DCII and aata set initialization
common to all of the virtual access
methods.
(See Chart MA.)
Att ributes:

closed, reentrant, privileged.

:?nt ry Point:
linkage.

CZCOAl -- Entered via type-l

Input: Register 1 contains a pointer to
four word parameter list as follows:

il

2.

DUPOPEN -- a user wishes to access or
create a duplexed data set.

Word 1

Address of the DCB.

3.

-- a user wishes to access a
me~~er of a partitioned data set.

Word 2

Address of the JFCB.

/{.

CLOSE -- a user has finished using a
data Set.

Word 3
area.

Address of -Fence Straddler R save

S.

DUPCLCSE -- a user has finished using
a duplexed data set.

Word 4 -- Address of the public or private
volume table (PVT).

6.

STOW --3 use:: has finished using a
member of a partitioned data set.

Modules Called:
Connect (CZCG7) -- Connect task to shared
RESTBL

7.

ABEND -- a task is being abnormally
terminat.ed and its data sets must be

FI~~

closed.

ESA Lock (CZCEJ1) -- Lock PAT.
Unlock PAT.

(CZCEJ2) --

Figures 22 and 23 depict the interaction
among the various modules involved in open),;-1<; and closing a data set.
1'he routines
Open Common (CZCLA) and Close Common
(CZCLB) contain the initial point of linkage from the OPEN and CLOSE macro instructions for d.l ... access methods and have been
described earlier in this manual.

REQPAGh (CZCOE1) -- Assign directory page

Also included in this section is a
description of the Vl~ ABEND Interlock
Release routine.
When a task is abnormally
terminated because of some error condition,
the close processing is performed to close
any data sets that the task may have been
using.
The V,~ ABEND Interlock Release
routine is called to locate and t.o release
any interlOCKS which were set when the
ABEND was issued.

Search SDST (CZCQE1) -- Creates a shared
data set table entry for a newly opened
data set or increments the count of
users for the data set if i t is already
open.

(VPAM) •

RELEXPG (CZCEN1) -- Release pages.
DELCAT (CZCFD1) -- Release catalog entry.
FREEMAIN (CZCGA3) -- Free virtual storage.

Interlock (CZCOH1) -- Interlocks the RESTBL
of a shared data set when the routine is
operating on it.
Release Interlock (CZCOI1) -- Releases the
RESTBL interlocks placed on shared
RESTBLs.

OPEN PROCESSING

OSCB READ/WRIT (CZCEM1) -- Request a PAT
write.

The routines associated with Open processing include CPENVAM, DUPOPEN. VSAM
Open, and VISAM Open.
132

Part II:

Virt.ual Access Method (VAM)

VDMEP (CZCQK1) -- Issue diagnostic message
and terminate function but not task.

)

FIND

(

)

OPEN

f

Common

find

fo-----

()peo

(CZCO])

DUPOPEt-J
(CZCEy)

(CZCLA)

\

I

OPENVAM
(CZCOA)

~
Open
Sequential
(CZCOP)

Figure 22.

STOW

STO':,'
(CZCOK)

~

Open
Indexed
Sequential
(CZCrZ)

Module Interaction in VAM Open Processing

(

ABEND

CLOSE

)

DUPCLOSE

Common

ABEND
(CZAC?)

DUPCLOSE
(CZCEZ)

Clo,e
(CZCLB)

ch

~

ClOSEVAM
(CZCOB)

~~
Clase
Sequential
(CZCOO)

Close
Indexed
Sequential·
(CZCOK)

I
Figure 23.

Module Interaction in VAM C10se Processing
Section 4: Open and Close Processing

133

[)..::-;c£:,

HECOV:;~:":".'i

V(:1'"

from t~l~~\

-- Atte.::.·;pts to recoer:.:or when tht- DSCd is read4t

{C::t~LI~'lj

GETKAIN \CZCG2:, -- Ok;tdins virtual storage
:for nonsnarh1 ;o,ES'l'BLs and for required
direct.ory page": for ncnshared data sets.

• Attempt to
read-only.
•

T~

data

o~>n ne~

data set for

active users using private shared
fiet,

• Unrecovf':1able DSCB ,'reor.
Gi':Tsr-t\IN

(CZCG6}

-"- Obtains shared virtual

• OSCB does not contdin
of ext_ent ~ .

storage for shared RESTBLs.

CO{x.'ct

nlulIb,·[

Flc~DF:'{,PG

(CZCELl) --- Assigns ext,ernal
storage space to a new data set.

WRI'~'DSCB

(CZCEW1)

-- WI' i tes out updated

DSCBs to the volume.
CKCLS (CEAH24) -- Obtains t.he protection
class of the t,ask_
XTRCT ICEAH03) -- Obtains the ID of the
task"

Operation: On entry, OPE'NVA!'se (CZCQA>
Performs close fUnction-s unique t_o indexed sequentially
organized data sets.

The Close routines consist ()f CLOSEVAl'i,
DUPCLOSE. VSAM Close, VISAM Close, and VAM
ABEND Interlock Release.

Stow (CZCOK) -- Stows a member of a partitioned data set and calls the appropriate access dependent close routine.

CLOSEVAM Routine (CZCOB)

MOVEPAGE (CZCOC) -- Writes out the POD when
rf'quired.

CLOSEVAM is called by Close Common or by
OOPCLOSE to perform close processing for a
given DCB. It may also be called by ABEND
to close the DeB for a task which is being
abnormally terminated or by VDMEP if a
function (but not the task) is being terminated.
The major functions of CLOSEVAM
are to:
• Delete only the DCB header for data
sets which have other DeBs open.
• Release assigned but not used external
pages of the data set by calling
RELEXPG. This step is omitted if the
HOLD option has been specified.
• Update the DSCBs on the volume by calling WRITDSCB.
• On the close of the last DCB open for
the data set, the RESTBL and, if the
data is partitioned, the POD are
deleted by calling FREEMAIN.
• Delete the data set, its catalog entry,
and its JFCB if Wdelete at close- is
specified. This is accomplished by
calling DELVAM.
• If the data set resides on a private
volume and the last open DCB is being
closed, the volume table is deleted by
calling FREEMAIN.
(See Chart ME.)
Restrictions: CLOSEVAM may not be called
if the specified DCB is not open.
Entry Points:
CZCOBl
Normal entry via type-l linkage.
CZCOB2

Direct entry from close command.

Search SDST (CZCQE) -- Deletes the shared
data set table entry for the task closing the DCB.

RELEXPG (CZC~~) -- Releases unused data set
pages when the data set is closed.
DSCB READ/WRIT (CZCEM)
out a format-E DSCB.
ESA

I~CK

Read in and write

(CZCEJ) -- Lock and unlock the

PAT.
DELVAM (CZCFT) -- Deletes a data set, its
catalog entry, and the associated JFCB
when the Wdelete at close- option is
specified and the DCB being closed is
the last one open for the data set.
WRITDSCB (CZCEW) -- Updates the DSCBs on
the volume when required.
FREEMAIN (CZCGA) -- Releases virtual
storage occupied by the RESTBL, directory pages, and buffer pages.
Release Interlock (CZCOI) -- Releases the
interlock on the RESTBL for shared data
sets which still have DeBs open against
them.
(CZCG8l -- Disconnects the task
from the shared RESTBL.

Di~;connect

SYSER (CEAIS) -- Declares system errors as
listed under -Exits·,
ABEND (CZACP) -- Abnormally terminates a
task under the same error conditions as
for SYSER.
Exits:
Normal -- Return t.o the calling rout.ine.
Error -- SYSER, then ABEND is called under
any of t.he following conditions:

Input:
Register 1 contains the address of
the DCB being closed.

• Search SDST cannot find data set
entry.

Modules Called:
Interlock (CZCOH) -- Interlocks the RESTBL
for shared data sets.

• Data set being closed is neither
sequential, indexed sequential, nor
partitioned.
Section 4: Open and Close Processing

139

•

Erro~

return from stow.

~

MOVEPAGE unable to write out updated
POD.

• DELVAM unable t.o delete a data set and
its catalog entry.
~

DSCB Read/Writ unable to read or write

DseB.
S.)l2~~F~!ion:
For entry .It CZCOB1:
On entry,
CLOSEVAM saves the input registers and
establishes base regi,st.ers for the CSEC'l',
PSEC?, JFCB. DeB, RESTBL, DeB header, and
!l1einb€r header.
I f the da ta set is shared.
t~he RESTBL is interlocked by calling
Interlock.

When CLOSe (TYPE "" or) is specif ied for a
VAM data set, only data pages, directory
pages and DSCES, where requized, are writtpn to external storage.
The data set will
rer.ain open and in the same condition as
would follow a normal OPEN.
Nonpartitioned data sets are positioned
(SETL) according to the original OPEN
option and data set organization prior to
thE completion of the CLOSE (TYPE = T).
When partitioned data sets are processed, a
STOW-R is issued against the Checked out
memL~rs. as during a normal CLOSE.
A FIND
must be issued by the user if the member is
to be reprocessed.
If not a TYPE = T. when the data set is
sequential or index sequential, the corresponding access dependent close routine is
calle-d. If the data set is partitioned and
the:ce is a member still checked out. a call
is made to STOW to update the POD and to
close the member by calling the appropriate
access dependent close routine.
If an
error return is received from STOW. SYSER
and ABEND are called.
Following the above processing or if the
data set is partitioned but has no members
checked out, a test is conducted to determine if 'the POD must be written out.
Four
conditions must exist for this to occur:
1.

The data set must be partitioned.

2.

There must be directory pages to
output.

3.

Either the DSCB integrity bit or the
POD integrity bit must be set.

4.

The DeB being closed must not represent the secondary copy of a duplexed
data set.

If all these conditions are met, a call
is made to MOVEPAGE to output the directory.
During the testing for these condi-

140

Part II:

Virtual Access Method (VAM)

tions, a further error test is conducted •
If the data set do~s not prove to be
sequential. indexed sequential, or part~­
tioned, SYSER and ABEND are called.
This
same error exit is taken if MOVEPAGE is not
successful.
Closing the l.ast Q~DC13:
Followinq a
s\~ccessful cdll to p..,QVEPAGE or if no ca.ll
is required, i t is determined if this is
the last DeB open for the data set.
For
nonshared data sets this is indicated by a
zero count of open DeBs in the JFCB.
For
shared data sets this same count must be
zero and. also, the count of open DCBs for
all tasks must be zero.
If one of these
conditions is met (that is. this is the
last open DeB for the data set) j,1:. may be
necessary to delete the data set or to free
unused space.
If there are available
unused pages and the HOLD option has not
been specified, a call is made to RELEXPG
to release the pages.
The parameter list
to RELEXPG includes the RESTBL external
page entries representing the unused pages.
For a shared data set the interlock words
must be removed from the RESTBL before the
parameter list can be built.•

Following the call to RELEXPG or if no
release is performed, the DseB integrity
bit is checked to see if the DSCBs must b0
updated.
If so, a call is made to WRITDSCB
to perform the update.
After a successful
call to WRITDSCB or if the DSCBs were not
updated, buffer space area may be freed as
described below.
Final Close Processing:
In this case, t.he
closing of the last DeB for a data set, the
final close processing involves the release
of any buffer or overflow pages and the
release of directory or POD pages.
These
releases are accomplished by calls to FREEMAIN.
FREEMAIN is also called to release
any existing RESTBL pages.
Lastly. the
RES T BJ. pointer is cleared from the JFCB,
the DeB and DeB header are unchained, the
macro transfer list is cleared from the
DeB, and then a check of last close for a
DELVAM call is performed.
If the Delete pt ion of the s ha red j::age ta bl e n Ulnber
interloc~.
The OCR header will reflect the
conditl0n of this interlock ana it will be
released as requiCE'o.
The DHDDIT fieL.1 in
the DCB header contains the interlock summary shown in Figure 2Q.

Exiu:;:

Normal -- The calling frog ram receives control by use of the RE'lURN macro, with
the T opt.ion set and no special return
code.
Error -- May ABEND if unable to release the
SDST interlocks.

If an interlock is recorded in the DCB
header interlock summary as being imposed
on the SDST control, all other interlocks
within the SD3T are released before releasing the SDST control interlock.
If no
interlock on SDST control byte is recorded
in the interlock summary, and if such '"
lock is found to be in effect, either the
int~erlock was set by the task which invoke~
ABEND dnd is recorded in a DCB header
interlock summary that has not yet been
examined, or the interlock was set by
another task.
Since it is not known at a
given moment which case exists, the first
case is assumed, and t_he DCB headers are
scanned for that particular lock.
On
release of the SDST control lock all other
interlocks are released.
While the scan is
being executed, the SDST control byte is
repeatedly checked for release.
If release
occurs (the second case is indicated) the
scan is discont_inued and the general
release process is executed.

Operation:
The normal release crocess consists of analyzing the DCBHEADER interlock
surrsnarie:3 (Figure 24) onf' at a time, and
releasing the approprlate interlocks by
calling the existent Search SDST, Interlock, and Release Interlock routines.
The
DCBHEADER interlock summaries d.re updated
to indicate such release.
Examining DCBhEADERs:
VA."" ABEND Interlock
Release examines the task ID in each DCB
neader to determine if the data set is used
by the task that has invoked ABEND.
On
finding a DCB header pertinent to the task,
the interlock summary is checked and pertinent interlocks are released as stated
below.
If the comparison between the task
ID in the DCB header and that invoking
ABEND is unequal, a link is made to the
next_ DCBrlEADER within the chain, and the
comparison on task ID repeated.
When the

Fullword

]

DHDINT

__ -

Bit 0

-> 16

"--

if brf is 1 ~ Write- interlock 't;;_'T1Po~ed
If bit i, 0, Read interlock ;, imposed

'-

If bit 1S 1. c('rresponrling interlock i~ set
If b;t IS 0, ir'tedock :" not set

-;------------""-.---------.~

r""'::::..--.----.----.,.I---,..'----,.---1"",----.---r----r----r---""T--'--rl- - · - ,
I SDST
I·,Extemal,lv,emberi"
POD IRESTBL,

Not

Not

t~ot

I Page

! Header

Used

Used

Used

jEntr y

:

:

I

Ii,'
I

I
Bit

16

I

'

1

'Entry

IIMemberl1 Pi'D
~

I
iO.F<;T.Bl
___

!

Date

~et

Entry
With."

SDST

I

27

17

DHDINT

DHDINT

Figure 24.

Pag"

28

30

31

+,

DCBHEADER Interlock Summary
Section 4: Open and Close Processing

143

VI- --H'['IJI\L
CiE0~;

Activate/deactivate access
to a data set.

3ETL

Cont. rol Blocks
RESTBL

beqin dnd pnd ,·"1 [',1'1" t.....'tlnd,lI 1<',:.
T" ["'n-·
trol th~" p1Cu.. "t';::;1Ihj l't !",'I'm .. f.t-V tt~~·,'I!'!:·I.t
Ipnqth ('on!' •. >\ t \,' Li \" 1>1 .1<','<1 I t\ til<' t \ I :,1
t CUL Dyt t_-'~~ i.~1 t ~H< r ('\"\)1,1 t',y t ht' \L~t'l"
Th .. '

DCBLOl

DCBL05

N

X

I

I
DCBL06 I
I
I
I DCBPRL
I N.X
I

I Number of pages to

I

I out. put

I

I
!
I
I

I

ILast Operation flag

I

IX·O)' SETL

I

IX'OC' PUTX

I
I X 'CC· GET - move
I
IX'C3' GET -

locate

I

IX'3e' PUT - move

I

IX'33' PUT -

locate

I

iPreviolls record length

I!

!

Il __________
DCBBP
j ______
A
buffer position!
.L
.LIcurrent
______________________
._J

VSAM organizes
data set records like this

The USER
specifies.

1----· PogeRECFM

~

Page ---- ----_ _.-

·1"

F

-~

I

Page ----

-----"4

Page

~---...-.---

i

LRECL -

~--- Record

I
I

1

-+-

j

!
Record 2

.-.--J..--- Record 3--- --.-~-------

In this example, LRECL

r-----

u

RECFM
\.RECL

"'1"'·>---- Page

Poge -

I

i

I.ss than 4096.

Page---.----;----Pog.---~

l----------- Record 1 - - -- .----.-.--.--....+..----.

Record

'2

In this exomple, LRECL

f4------Poge - - - - l + - - -

LRECL

!

I
.~

Record 4

L._..--..J--_---L--i_
I

RECFM

00

"I"

--...

!

I

I

.

Page - - - ·--0..'11....- - - - Page -

·---·----7·-·--.- Page

--.~

V
Record 2

Record 1

0

Record 4

and ,upplies a 4-byte field
precedi ng each record in which
he places the record length.

o
The user '''pptie, leoding ___<--1
record length de.criptor. -_wr----'

0
1-3

Byte 0

VSAM odds troi ling record
length descriptor, which
include. this control field.

I

o

A

Sit 0

o

o

o

4-7

1-3

Reserved for other use.
Alignment> the nurnoer of bytes left
at the end of a poge (1 to 7) if it h
necessary to s.kip to next page (if both

e

3 and t4 would not fit on ,,,me page
following record 3).
Thi. flag bit is set to 1 if record 3 is complete on

Figure 25.

0

single poge.

VSAM Data Record and Page Formats
Section <",:

Virtual sequential Access Method (VSAM)

145

At t:;:- ityJ'C'-s:
ReaG-only,
nonprlvIIeged, syst.em.
E.YLI.Y_ ,)oin~:
CZCORl
type-llinkiH1P.

reE2ntrant, public,

-- Ct't is called by

lTiuut:
Parameters are passed in genEral
registers as follows:
~egister

0 -- If move mode, address cf the

users area.

being processed.
called.

If 1t does not AHENDis

The last operation field (DCBLOF) is
test_ed to !~ee if the last operation was a
PUT.
If tne last operation was a PUT, it
means that the data set is positioned at
end of data and the current Get would cause
an End of Data condition.
The End of Data
exit in the DCB is taken if the user supplied one; if not ABEND is called.

Register 1 -- Address of the DCB.
vhthin the vCE, the macro code fh·ld
~DCBi·1CD) has been set to indicate move or
Ioca te mode.

1'1odul es Ca 11 ed:
MOVEPAGE (CZCOcl)

Perform page input.

FLUSHBUF (CZCOVl)
Purge buffer of data
remaining in the buffer since the last
operation.
Exits:
Nonnal
Exit is made t_o the user via the
RETllRN macro.

Error -- ABEND is called under the following conditions:

If the last operation was a Get, a call
is made to FLUSHBUF (CZCOV) to clear the
I/O buffer bef:>re reading in the next
record.
The following is common to all other
previous operation conditions (SETL, PUTX,
Get-move mode Get-locate mode where not
more than one buffer page was retained) and
to the preceding:
If the current record
position (page and byte) is beyond the end
of data defined in the RESTBL (or member)
header. call the user's EODAD routine as
described above for PUT.
The retrieval address of the current
record and its successor are generated.
FollOWing this one of three procedures is
executed depending on the record format.

• The DCB header does not pOint back to
the DCB.
• Record length zero.
• Record length longer than maximum.
• End of data set and missing EODAD.
.. Format U record not multip1.e of a page
in length.
e

User area not same protection class as
the DCB.

OperatioE:
Initialization and general
register storage is executed in conformance
with linkage conventions.
Base registers
are declared for VSAM Get CSECT. DCB, SAVE
area, DCB header, RESTBL, and ISA.
VSA.'l' Get is a "f ence sitter" and has no
:2SECT.
It is always called by type-l link2..(~e and assumes 'the same privilege as the
c.o.lleT.
The VSJ\.M Get save area is obtained
dyr.am.icaily by Open ConID10n on a oeD basis.
Get has to access the interruption storage
area fISAj to determine its c~rrent privilege s'cate before ca 11ing privileged rout1. x;.t.,s (Mo-,V'S'PAGE, ABEND and FLUSHBUF).
Get
will execute type-lor tYp€-2 CAlif; depend;;.ng on its privilege state.
Tne DeB point er in the DCB head~~r is
tested to insure that it points to the DCB
146

Part II:

Virtual Access Method (VAM)

Undefined Record Format (U): ABEND will be
executed if the requested record is too
large, or if it would not end on a page
boundary.
The user's EODAD routine will be
executed if the end of the record is beyond
the end of the data set.
In this case
ABEND may be executed if no EODAe was
specified •
The number of pages to input is computed.
If in move mode and the users area
begins on a page boundary, MOVEPAGE
(CZCOC1) is called to input the record
directly into the user area.
The last
operation is set to GET-move mode.
The
current relative position is updated and a
return is made to the caller.
If in locate mode, or move mode where
the user area does not begin on a page
boundary, MOVEPAGE (CZCOCl) is ca1led to
read the record into the buffE'r assigned to
the DCB. The number of pages in use is set
equal to the number of pages input, and the
Hold Last Buffer flag is set off.
If in
locate mode, the buffer address is placed
in general register 1, the Last Operation
flag is set to GET-locate mode, and a
RETURN is made to the caller.
If in move
mode, the contents of the buffer are moved
to the user specified area and the Last
Operation flag is set to GET-move mode and
a return is made to the caller.

Fixed F'ormat (F):
A computation is made to
determine if the next. record is completely
within the buffer.
If (~ZCOCl) is called
to input enough pages to complete the record, starting at the page following the last
fJage in use. The remainder of::>rocessing
of fixed format records is comm::>n to both
fixed and variable and is described below,
under "Fixed or Variable Format (Common
Processin']) ...
Variable Format IV):
If the buEfer is
empty, MOVEPAGE (CZCOCl) is called to read
the next page of the data set into the
buffer. The number of buffer pages in use
is set t.O one.
The record length of the record in the
buffer is checked to determine if the preSEnt contents of the buffer cor.tain the
record.
If not, MOVEPAGE  to
terminate an outstanding locate-mode
PUT.
CZCOS3 -- Entered via Lype-2 linkage to
permit privileged table storage. PUT
enters itself to "jump the fence",
become privileged, and update the
RESTBL.
Input:
For CZCOS1, register 0 contains the user
buffer area (move-mode r(~quc:st).
Register 1 contains the address of the
DCB.
For

CZCO~j2, register 1 contains the addres:';
of the DCB.

For CZCOS3 -- None.
Modules Called: Calls as follows:
VDMEP (CZCQK1) -- Output a diagnostic message and terminate the function without
terminating the task.
FLUSHBUF (CZCOVl) -- Purqe data remaining
from a previous operation, from the
buffer.
Exits:
Normal -- Return to the calling rout_ine.
Error -- VDMEP is called under the following conditions:
• User has READONLY access to data set..
• DCB specified by caller is not
addressed by DCB header.
• Record length greater than maximum
specified in DCB header (note that
this error will not be detected until
the following operation is performed
when it is caused by a locate mode
PUT) •
• Undefined (U) format record whose
length is not in page multiples.

VSAM PUT is called by the user through
the DCB or by CLOSESEQ (CZCOQ), or SETL
(CZCOT) to concatenate a record onto the
data set and define a new end of data set.
When called by the user, the function may
De to obtain the address of some buffer
space into which the user may construct a
record. Any subsequent operation on that
data set will result in a call to the
secondary entry of this module (CZCOS2) to
complete the operation.
(See Chart NB.)
Attributes: Read-only, reentrant, public,
nonprivileged, system.
Entry Points:
CZCOSl -- Entered via type-l linkage.
Normal entry point.
Section 5:

• Variable format logical record length
is too small (less than 4 bytes).
This module's operation can be
summarized as entry; initialization; completing processing of the previous operation; establishing the buffer position for
the current operation; if move mode,
transferring the data from the user's area
to the buffer area; and writing the data on
external storage if more than one buffer
page is left in use.

~ration:

At entry C'ZCOS1, t..he ent.ry indicator (',,))
is set to zero; at entry CZCOS2, ~ is set
to one. Initialization and general register storage is executed in conformance 'Kith
Virtual Sequential Access Method (VSAM)

147

llnkdcJf> cOnV si ttA'r- dnd ha~; no
PSEcT.
It i~; always called by typ\:'- I linkage and aSSUlDes the same privilege il3 the
cal:.er.
The PUTX save area is obtained
dyn,'mically by Open Comroon on d DCB uasis.
PUT:: accesses the interruption storcqe ared
(IS;\) to det.ermine its current privi lege
stal e before calling a privileged rcutine.
PUT:{ will execute type-lor type-2 CALLs
dep.:nding on j.ts privilege state.

Part II:

Virtual Access Method (VAM)

Read-only, reentrant.

public,

Input:
Register 1 contains the address of
the OCB.
Modules Called:
MOVEPAGE (CZOOC1) -- Force buffer contents
to be written on external storage.

Insert/Delete Pdg€ (CZCODl) -- Assign
external storage to data pages in the
buffer.
VDMEP (CZCQKl) -- Output d diagn.ostic message and terminate the function (without
terminating the task).
:t.xits:
NOrmal -- Return to the calling routine.
Error -- VDMEP is called under the following conditions;
• Invalid return code from Insert/Delete
Page (CZCODl).
• No external storage space available.
• Storage ration exceeded.
• No secondary storage space specified.
• Attempt to expand RESTBL for shared
data set.

depends on tests made of the Hold Last
Buffer flag (HLB), number of pages to output (NPO>, and buffer paqes in use (BPU),
and affects the number of pages checked out
as illustrated in Table 38.
After the operation indicated for ca,;es
1, 2, and 3, in Table 38 are performed, if
no pages are checked out, the current p'Jsition is set to indicate the beginning of
the buffer, the number of buffer pages in
use is reset to zero, and an exit is made
to the caller. If pages are checked out
and the Hold Last Buffer flag is off, all
buffer pages checked out will be relea~led.
The number of pages is reduced by the
number of pages that has been checked out.
At this time if a page is still checked
out, it is moved to the beginning of the
buffer area and addresses and counters in
the DCB are adjusted to indicate that the
current record is in the first buffer page
and that one page is in use. This routine
then returns to the caller.

• Maximum data set or member size
exceeded.
Table 38.
• Insertion beyond end of data set.
• Deletion beyond end of data set.
Operation: FLUSHBUF stores general registers in conformance with linkage conventions and establishes base registers for
the DCB, DCB header, and RESTBL or member
header.
If the number of pages to output is nonzero, and greater than the number checked
out, Insert/Delete Page (CZeOD1) is called
to assign enough pages to complete the
request.
The insertion is made at the page
following the last page checked out. The
number of pages checked out is increased by
the number inserted. Subsequent processing

section 5:

FLUSHBUF Decisions to control
Buffer Allocations

r-------T---T---T---------------------------T-----------,
i
I
I
I Resulting I

I

I
i

I

HLn
Hdq

I

I

INPOlbPUI

~---T---T---~

INPOIBPUlpcOI

Act"lon

~-------+---t---+---------------------------+---+---+---~
1(1)

OFF I

I

I Ca 11 MOVEPAGE (CZCOCll

G I

$!

I

i

I OUtPU~ all page,; in the

I

I

I

I

Irequest

I

\

!

I
I

I
I (2)

I
ON

i

i (3)
I
I (4)

ON
ON

I
I

I
I
I
I
I
I

I
I

to

I

I
I
I
I
I
I 1 I i ·I
I
I
I
I
I
1 I 1 I Sa me as (1)
I
I· I
I
I
I
I
1 I 1 Icall MOVEPAGE (CZCOCll to
I 0 I 1 I 1
I
I

tout pu t a l l pag~s €'xcept: the I
Ilast,
Move last buffe~
I
I peg€' to tne f iICst buffer
I

I
I

I

!

I
i
I
I
I
I
I
I pa'F and RETURN.
\
I
I
t-------~---~---~---------------------------~---~---~---I
j4TE'x-minat..inq
dction \.1eserib~d in text.
L
_____ _________________________________________________
1!
~

Virtual Sequential Access Method {VSAM}

151

~!"~cnON _~_'{:rRTUAL

INDEXED SEQUENTIAL ACCESS METHOD (VISAM)

v I::l\M OVERVIEW

Table 39.

VISAM is designed to give the user
',,"quential ox: nonsequential access to a
record within the data (member> by searchID] for the user specified key.
The key is
" field located at a uniform position
wi thln each rpcord of a dat.a set.
The £01Jowl.ng contribute to \lI5AM:

r------T---"-' ----------------------------·1

User Coded Macros
DeB
supply parameter to define data
set structure.
Request access or specify
creation of records within VISAM
data set. Also generates a DECB
(parameter list).

KL~D

WRITE

5~TL

Request location of a specified
record.

~SETL

Specify release of a record that
located.

WlaS

RELEX

specify release exclusive control
of a page.

DELREC

Specify deletion of a VISAM data
record.

GET

Request. a record.

Description of DCB Working
storage Used by VISAM Routines

ISymboll Data "

i
I

I
I

iDCBOPCI

I
I
N

I
I

Specify generation of a record.
Note:
Records must be generated
in sequence when using this
macro.

Control Blocks
Data control block -- Extended
OCB
index sequentia 1 worki ng storage.

I
I

I
I

I

I

I

I
I
I
I
I

I
I
I
I
I

lon-page

Data event control block used to
control a READ or WRITE
operation.

Icurrent VISAM locator
I position relative to page

I
I

lDCBCCLIX.A iContents of current locator
IX'OOOO'

through X'OFFY' ::::

!

IX'1000' through X'FFFF'

IDCBIOSI X

I

I
IDCBPT I X
I
I
i
I
j
i
I
I
I
I
I DCBCRS I X
I
I
I DCBRES I X
I
I

I off-page
I

IInput, Output switch
iPage type

I

IX' FFI overflow page
!X'OO' data page
I

!CUrrent record length

I

ICUrrent record switch

I

IRead exclusive switch

I

IDCBPLMI X

IPUT locate mode only

I

I

IDCBPMMI X

IPUT move mode only

I

I

I

I

I

I

IDCBOLMI X

=

I

I

IDCBASYI X

DECB

IOverflow page counter

I
I
IDCBCL I A
I
I
j
I
I
I

IDCBCRLI N
PUT

I

Description

r------+----i------------------------------1
I DCBPCCI N ,Data page call counter

IOutstanding locate mode GET
IAsynchronous switch

I

I
I
IDCBRK I A
IRecord key area for previous
lI ______ I ____ lrecord
_____________________________ JI
~

~

Relative external storage correspondence t.able.
POD

Partitioned organization directory (if partitioned).

Tables 39 and 40 show fields of the DCB
DEeB control blocks used by VISAM
routines.

SETL

Search VISAM data set for a record.
Set current key location of
a VISAM data set record.

ESETL
RELEX

Release a page.

READ

Nonsequential generation or
retrieval of a VISAM data set.

~nd

General VISAI'! Routines
Sequentially generate o~ truncate
Put
records of a VISAM data set.

VISAM

VISAM

Get
152

Sequentially obtain records of a
VISAM data set.
Part II:

Virtual Access

Met~od

(VAM)

WRITE
DELREC

Remove a record from a VISAM data
set.

Add Directory
Entry
AJd dlrectory entry.
VH~AM key din'ctory.

Table 40.

Fields and codes of the DECB
Referenced by VISAM Routines
(CHADEB)

Update

f'- - - - - - -T - - - -T - - - - --_.- - - - - - - - - - - - - - - - - - - - - -

1~;ymboJ

Illata I

I

I

-------- - - ,

Description

I

I;ETPAGF

wit h VAM Gf-'nelal Services to control paqp 1/0.

i- -- ,- - --+-- --+---. -----------------------------------~
In':CEcn i X
'Opf'r"'t~t)n ("olDl'letion code..
I

VISAM

op. n and close ddt
dependent).

I \)IXECOI
I
I
IlJECTYI' I X

Open
VISAM
Close
VISAM

Int('rt.1CP~;

J

~

"t

(access

I

i

I DECTYlt

~

1
~aqe

Formats
DEC40

I

The following types of page constitute a
VISAM data set (member).
(Also see Table
41.)
Data and overf low pages com,ist of data
records and locators. The data records are
placed on a page starting at the top (lowest numbered bytes) and are added towards
the bottom (increasing byte locations).
Locators, on the other hand, begin at the
end of the page and extend toward beginning
(highest numbered bytes to lowest).
The locators are a series of 2-byte
fields which, when examined in sequence,
give the location of records in ascending
sequence by key, regardless of arrangement
of records on that page or any number of
overflow pages. There are 2 types of
locators:
• Onpage locators whose values range from
X'OOOA' to X'OFFS' and specify the
starting byte of the corresponding
record. The values X'OOO' througo
X'009' and X'OFF9' through X'OFFF' are
unattainable.
• Offpage locators whose values range
from X'lOOO' to X'FFFF',
The first
byte of an offpage locator specifies
the page number of the overflow page
incremented by 16, on which the data
record may be found.
The second byte
specifies the relative poBition of a
locator on the overflow ~lge which will
in turn specify the startlng byte location of the proper record,
Keys on directory pages which are writeprotected from the user, are automatically
placed there as each, except t:he first,
data page is generated.
The lowest key associated with a data
page is the one which appears in the directory position corresponding t<) that page.
If a record is added to a pag''!, and this
record has a lower key than any other key
associated with that data pag~. the directory is updated to ref lect th,'! new value.
An inserted record on a page may cause
locators to be displaced to subsequent
pc:ges
this case also causes the directory to be updated.

i
I
I
I

DEC43!

I

DECQ4 I

I

DECUS!

I
IX'Oo' \
I
I
jcontaining data records t
I
I
I

14-5

I
I
I

• Search directory for the largest Key
Which is smaller than or equal to the
one supplied by the user.

I unused spaces
I

jEHDDIRiEnd of space accounting!
larea (bytes 0-9) in
!
Ithis page valU€ is
I

16-7

i
I
I
I

I
I
I
I

!X'0009'

!

I

I

I
I

I
I
I
I

I
I

I
I

IRECSPAIRecoverable space.
I
I
INumber of bytes deleted I
I
I from the data area
I

18-9

i
I
i

IIO-ENDDAT

I
I

IData records and
I recoverable space

I
I
I
I
i (ENDDAT+1) I
I to (EOS-l) I
i
I

I Unused space

I

I
I

I each)

I
I

i

I

I

I

IEOS-4093

A READ or SETL by key will cause the
following:

VISAM Page Formats -- Data or
Overflow

ILocators (halfword

I

I£OS
lEnd of available space I
I
I
IrelativE' to start of
I
i
I
I page. Points to start
Il __________ LI ______ Llof
locators
_______________________
JI
14094-4095

• Access the indicated data page.
Table 44.
• Using the locators on that page, search
for the desired record. Note that this
may cause overflow records to be read.

r------~------T--------------------------,

! Bytes iSymboll

The formats of data and overflow pages
are shown in Table 43.
The format of directory pages is shown in Table 44.

The VISAM processing for VISAM Put,
VISAM Get, SETL, READ/WRITE DELREC, GETPAGE, and Add Directory Entry is described
below.
154

Part II:

I
I

12-3

I
I
j

I
I
I
I
14-5

I

16-7

Virtual Access Method (VAM)

!

IPAGNUMITotal number of directory t
I
I pages (starts from one).
I

I

I

I
I
I

!

I

IDIRPG INumber of pages in
I
I
I directory, used for
!
I
I maintenance of the virtual I
I
I memory length of the
I
I
Idirectory buffer aft.er thel
I
I directory is read into the I
I
I buffer.
I
I

I

IX'OOOO'

I

I
I

tENDDIR\£nd of directory relative
I
Ito pointer to the
I
Ibeginning of last data
I
lpage.

18-9

I
I
I

I
I

VISAM ROUTINES

Contents

~-----t-----t------------------------·--_l

10-1
The relationship between locators and
records, data pages and overflow paqes is
depicted in Figure 26.
This diagram ill ustrat.es variable length records. overflow
records. available space and recoverable
space.
To summarize, "the sequence of records is determined not by their sequence on
a page, but by the order of the locators
which address the records.

VISAM Page Formats -- Directory

I

I

IX·OOOO·

I

IKeys.
Note that keys may
I _______ LI ______ LI ________
span pages.
L
_________________ JI

110-40951

~

- - - - - - - - - - - - - - - - - ----- - - - - - - - - - - - - -------------

_______-.-LC,--_-_-------~-----------------,--

f-~-,-------------------;L-.J..-I::----~--~:-p~J~~~~~~-.r.--

r-

I

1_ _ -_ _ _

_ _J

--+----

I

---J~ -~---.----------

___________________________________.--1

---1.-~-----..J
I'i--I
I '
i I
~

I

A

I

l_ ___________ -_-_-_-_-__-_______
R,

D

,

thf;J

R_-.
til

Off!

f I rhf'..1 '87

I

I '1,

?

!
____________________________________________________3

dolCl 'I'(O'di

O(P

D

D

________ .___ __ S L

.-.----"-~-~--------.--.----~-~-------------.~

-------- - - -

!(

1,-. ----I:~- ~ . -

length 1~ .. ld~

D

X i~ recoverable lPOCf'

D

A

i~ 0 .... 0

]

D

i lobi\!, \pocoe-

""Note:
There _I

All record$. of

0

j'

be ::

cOt"respor;jing lacotol

EOS 1\ e>"d of spo<'4l'.
doto 1~1 or me-mb-er will be of

on the dcto p:::lge,
m $-hown fc( recor-a ?

0 ul~ifo",.,

format wit"" regord to Kf"Y I~nglh. location of key, vorioblt'
or fi)led; :i fixC'd, all wiil be of the \oeme length.

Figure 26.

VISAM Record rtelationship

VISAM Put Routine (CZCPA)
VISAM Put is called by the user (through
the DCB) to concatenate a record in the
user's area onto the data set, or to provide the user with a buffer area into which
to construct a record. This module may
also be called by GET (CZCPB), GETPAGE
(CZCPI), SETL (CZCPC), READ/WRITE/DELREC
(CZCPE), or VISAM Close (CZC~A) to complete
processing of a preceding locate mode PUT.
(See Chart OA.)

Input.:
For CZCPAl, register 0 contains the address
of user area (move-mode only). Register
1 contains the address of the DCB. The
macro code field of the DCB is set as
follo\ols:
'0000'

Locate mode.

'0004'

Move mode.

• 0008'

Move mode complete •

Attributes:
Read-only, reenterable, privilegea, public.

For CZCPA2
Register 1 contains tne
address of the DCB.

l:.ntry Points:
CZCPAI -- Normal entry from expansion of
PUT macro instruction.
Entered via
type-l linkage.

~odules Called:
GETPAGE {CZCPI} -- Perform input and/or
output of pages.

CZCPA2 -- Entered to complete previous
locate-mode PUT.

Ada Di rectory Entry (CZCPL1) -- Updat'~
index sequential directory.

Section 6: Virtual Indexed

sequ~ntial

Access Method

(VISA~}

t lV"

15~

VDMLP (CZCQK1) -- Terminate the function if
read-only access is indicated.

1. -- Cant: 1:01 is passed back to the
Cd 11er by ll.se of the RETURN In1!.cro.
General register 1 will always contain the
ddd.r.~ss of t.he record.

[,DC,le;

"ITc>r -... Dependl ng on the erl:or condition.
t!,
('xi t ma y be made via ABEND or VOMER
.')[, -""here provided, to a user's SYNAD

have been opf'npd
OUTPUT option.

t

('I

t h~'

dd t.l !'f"t

'"

i t h t h<'

If the prE'viow~ operation was a PUT. an
internal SUb~()\ltlne, ·Complete Previous
PUT" is executed.
Processin'1 continues to
find space for a npw record.
If any pagES exist beyond this page, the
number is computed and GETPAGE (CZCPI3) is
called to delet.e them.
If this is not the
first data page, Add Directory Entry
(CZCPL1) is called to update the directory •

routine.
"BEND occurs if:

- The record length exceeds 4000 bytes.

" The record length exceeds the maximum
stated in the DCB (when completing a
previous PUT).
condition is encountered during completion of a final PUT.

If any records exist on this page beyond
the current poSition, they are deleted one
by one until the locator indicated by the
end-ot-space field is reached.
Each record
deleted causes the data space to be
increased by 2 bytes. and recoverable space
to be incremented by the length of the
record.

o A SYNAn

VDl>1Lt< occurs

if:

• The user has read-only access.
• The DCB is not open for output.
G

Two or more DCBs are open with OUTPUT

specified for a nonshared data set.
.. An unexpected return code is received

from GETPAGE.
Conditions for which the user may provide a SYNAn routine and the codes which
PUT will provide in DCBEX2 are:
K~ys

equal (sequence error)

KEc'YS out of sequence

Record length exceeds that specified in DCB

X'04'
• OC'
'lC'

VISAM Put is a -fence sitter,and has no PSECT.
It is always called by
type-l linkage, and assumes the same privil~e as t.he caller.
The Put save area is
ob'airlf>d dynamically by Open Common on a
OCB ba~'lS.
Put has to access the Interrupt ion st.oraqe area USA) to determine its
currer.t privilege state before calling privileged routines. Put will execute type-1
·:;r type-2 calls depending on its privilege
state.

2~ration:

~;.:LJ'ormaJ: En_~:

In). tialization and general register storage is executed in conformance with linkage conventions. Base
registers are declared for the CSECT. DCB,
DeB h€adfx, RESTBL and data page.
Initial1y, VDMEf' is (,.d lIed via the VOMER macro
in,;truction if the user has read-only
access tc, the data set, if the data set is
not_ open for output, or if two or more DCBs

156

Part II:

Virtual Access Method (VAM)

Find Space for New Record: The last operation switch is set to PUT.
If a page is
assigned, and either more than 4000 bytes
are available, or padding space, plus a
locator, plus record lenqth is not greater
than data space, then a page is not
required.
I t a page is not aSSigned or
insufficient space exists, GETPAGE (CZCPI1)
is called to insert a new page. The current locator address is set to 4092, the
new page switch is set on and the addresses
of the current locator and buffer position
are generated.
If move mode, the record is moved from
the user area to the dat.a page after check:ing that the record length exceeds neither
4000 (ABEND>. nor the value stated in the
DCB as a maximum (SYNAn).
The current buffer address is placed in
register 1.
If the operation being performed is not a PUT-move mode complete,
control is returned to the caller.
If the
operation was PUT-move mode complete, the
previous PUT is completed. Control then is
returned to the caller.
pUT Secondary ~ntry:
Base registers are
established as above, SKIP is turned on and
the internal subroutine ·Complete Previous
PUT- is executed. GETPAGE (CZCPI3) is
called to output the data page. A RETURN
is executed.
Complete Prevl.OUS PUT: The .key in the current record is compared against the key of
the previous record.
If out of sequence or
equal, SYNAD exits are executed.
If this
is a new page, Add Directory Entry (CZCPLl)
is executed to update the director.y.
If
format-V, ABEND is executed if user
exceeded the record length limit in the
DCB.

End ddtd .ttri bute;s;
Read-only, reenterable, public, privileq(c'd.
Entry Point:
CZCPBl
Expansion of the
GET macro generates linkage to this module.
Input:

Parameters are passl·d as follows:

Register 0

Address of user area.

Register 1

Address of OCB.

The macro code in the OCB (OCBMCD) is
set to indicate move or locate m~le.
X'OOOO'

Locate mode.

X'0004'

Move mode.

Modules Called:
PUT (CZCPA2) -- Complete
operation.
GETPAGE (CZCPI2)
data set.

outstand~ng

PUT

-- Input n€!xt paqe of the

Exi t~:
Normal -- General register 1 will contain
the address cf the record.
EODAD

Position is at end of data set.

Error

ABEND EODAD is unresolved.

Operation:
Initialization and general
register storage is executed in conformance
with linkage conventions.
Base registers
are declared for DCB, GET save area, CSECT,
and ISA.
Base registers for DCB header,
data page, and RESTBL are declared as
needed.
VISAM Get is a 8fence sitter,· and has
no PSECT.
It i~; always called by type-l
linkaqe and assumes the same privilege as
the caller.
The Get save area is obtained
dynamically by Open Common on a DCB basis.
GET has to access the interruption storage
area (ISA) to determine its current privilege state before calling privileged routines.
GET will execute type-lor type-2
calls depending on its privileged state.
The DCB (DCBPLM) is tested to determine
if the last operation was a PUT. The

sec:onddry pnt ry point or PlJ'r (CZCI'A/)
entered to t ermlnCltp any out:;t m
the found record.
If a move mode GET was requested, the
record is moved to the user supplied area.
Control is then returned to the caller by
the RETURN macro.

If the Current Record switch """as not on,
the locator of the next logical .!:ecord mu~;t
be obtained.
If the current loc;ltor is not
at the end of the locators on th,> current
page, the location of the locato) is
updated to the next logical record and pr()cessing continues as if the Current Record
switch were on.
If the current locator was the last on'~
on that page. the page number is incremented and the next page obtained by calling GETPAGE (CZCPI).
I f the call to GE'T"'
PAGE caused an end-of-file condition, the
user-supplied (in the DCB> EODAD exit is
taken, if it exists.
If the user did not
provide an EODAD, VDMEP is called.
For a
non-end of data condition, the locator
pointers are initialized and processing
continues as if T,he CUrrent Data switch
were on.
SETL Routine (CZcPc>
SET LOCATION (SETL) is called by the
user or by READ/WRITE to locate :1 specifi.~
record within a VISAM data set or member.
(See Chart OC.)
,Attributes:
Read-only,
ie, privileged.

reenterable, publ-·

Restrictions: May not SETL by retrieval
address for a shared data set.
Entry Points:
CZCPCl -- Entered via type-l linkage
through expansion of the SETL macro
instruction.

Section 6: Virtual Indexed sequential Access Method (VISAM)

1 ')7

C~CPC2

--

Ent~rtd

vld type-l linkaqe from

other VISAM routinps.

ABEND is executed T

0 contAins the ac,dress
rtddrens.
RegiEter 1
c0nt"'linu l~h<, ",ddr<:'~i'; of t,he OCB.
The
!liaCrO code f i t"ld of the DeB ..,ill b<, set
C":1.(:PCl.

(,f

XIi!y

rAqi~;t.~r

(;';

H-t rievill

to one of the following:

• Invalid code in macro code field at
D(:B.

• A1'.tempted ;,ETL by retrieval address
f'.Jr shared data set..

'00'

SE'TL operation to beginning.

VDMEP is called if:

'OS'

By key.

'oct

• SYNAD address in OCB had not been
resolved.

By retrieval address.

'14'

To previous.

'18'

To next.

'130'

To end.

For CZCPC2, register 1 contains the address
0.' a t . ..,o-..,ord parameter list:
word 1

Address of DeB.

word 2
Address of key or retrieval
address.
The macro code field of the DeB has the
same permissible values as for entry point
CZCPC1.
Modules Called:
PUT (CZCPA2) -- Complete previous PUT.
GETPAGE (CZCPI2) -- Read data or overflow
page without outputting old page.
Interlock (CZCOH1) -- Lock RE;STBL for
shared data set.
Release Interlock (CZCOll) -- Unlock
RESTBL.

Exits:
Normal -,- Return is to the calling program
via HETu.RN macro and with a completion
code in general register 15.

E-rror --

SYNAD:
EXTor return to the user is by
using SYNAD exit in the DCB for any of
the following conditions:
• Invalid retrieval address.
• Operation was SETL to next, and at end
of data set. (member>.
• Operation was SETI. to previous, and at
beginning of data set (member).
• Key not found.
158

Part II:

Virtual Access Method (VAM)

Operation:
Ini.tialization and general
register storage is executed in conformance
with linkage conventions. Base registers
are declared for the SETL save area and
CSECT, DCB, DCB header. RESTBL, and data
page buffer.
SETL is a "fence sitter,- and has no
PSECT.
It is always called by type-l linkage and assumes the same privilege as the
caller. The SETL save area is obtained
dynamically by Open Common on a DCB basis.
SETL has to access the interruption storage
area (ISA) to determine its current privilege state before calling privileged routines.
SETL will execute type-lor type-2
calls depending on its privilege state.
The RESTBL is interlocked for shared data
sets. The lock will be l'."eleased prior to
any r.kurn.
If a PUT was in progress, it is completed by calling PUT (CZCPA2). For SETL
to next, the Current Record switch is
turned on and the page is read into the
buffer. The current locator is stepped
down by 2 bytes.
If the current locator is
equal to end of space (EOS>. the next page
must be read. The current locator is then
set to X'FFC' (4092). This process is
repeated until a data record is found.
For SETL to previous, the current locator is stepped up by 2.
If this value
reaches X' FFC' (40C}2> the previous page
must be obtained by calling GETPAGE
(CZCPI2). The current locator is then set
to tbe value in IDS. This process repeatE
until a data record is found.
Set SETL to beginning, the first data
page is read in, the current locator is set
to X'FFC' (4092) and a procedure as in
·SETL to next- is followed.
For each of the above. the locator is
examined; if necessary the specified overflow page will be read into the overflow
buffer, and the locator (on page or from
the overflow page) is used to set up the
retrieval address in the OCB.

For SETL by retrieval address. the spec1fied record is read in and the program
exits.

VDMEP (CZCQK1) -- Output a diagnostic message and terminate the funcLion (but not
the task).

For SETL by key. a binary search of tne
directory is performed. I f d di rectory h;
not present, the first page is dS0umed to
contain the specified record. Wnen the
required page is read in, a binary search
against t.he keys associated with that page
15 performed using tne locators found
there. Overflow pages may be read to perform this search. When the desired record
1S found, the retrieval address is set as
above and the program exits to the caller.

Exits:
Normal

Return to the callinq routine.

Error ._1.

Return to the calling rou1_ine with a
return corle of X'04' in 9 p neral
register 15, followed by " call to the
user SYNAD routine, under any of the
follOWing conditions:
• READ, WRITE, or REPLACE key not
found

Read/Write, DELREC Routine (CZCPE)
• Equal keys found on a weite new key

Read/Write is used for nonsequent.ial
access to a VISAM data set by either key or
by retrieval address.
DELREC is used to
delete a record by the same criteria.
(See
Chart 00.)

• Too many overflow pages
• Attempt to EXPAND shared data set.
2.

Attributes: Read-only, reenterable, public. privileged.

VDMEP is called if:
• No SYNAD address.

xestrictions: Cannot expand RESTBL for
shared data set. Shared data sets cannot
be read by retrieval address.

• Update with read-only access.
• Nonprivileged caller/data set
privileged.

Entry Points:
CZCPEl -- Entered via type-lor type-2
linkage through expansion of the READ or
WRITE macro instruction.

• Input key does not match the key in
the record for a write opeLation.
• Unexpected return code from CZCPI.

CZCPHl -- Entered via type-lor type-2
linkage through expansion of the DELREC
macro instruction.
Input:
For CZCPE1, register 1 contains the address
of the DECB. The operation will be cont.rolled by specifications stored in the
DECB (Table 40).
For CZCPH1, register 1 contains the address
of the DCB.
Modules Called:
PUT {CZCPA2} -- Complete previous PUT.
SETL (CZCPC2) -- Locate proper record
position.
Add Dir ect ory Ent ry ( CZCP L1)
VISAM directory.

Update

VMA (CZCGA) -- Get (free) a page buffer in
order to reclaim needed space from a
data overflow page.
GETPAGE (CZCPI)
page.

Input or output of a

MOVEPAGE (CZCOC) -- Release read interlock
on data page.

3.

ABEND is issued if the DeB header does
not point to the DCB, or if the record
length exceeds maximum.

Operation: Initialization and general
register storage is executed in conformance
with linkage conventions. Base registers
are declared for the CSECT and PSECT, DECB,
DCB, DCB header, RESTBL and data page
buffer.
Upon entry to CZCPEl or CZCPH1, the
SYNAD indicator in the DeB (DeBEX1) is set
to either READ/WRITE or DELREC.
The RESTBL
is interlocked for shared data sets. The
lock will be released prior to any return.
If the last operation was a PUT. a test is
made to see if the data set is shared. If
shared, PUT is called at CZCPA2 to complete
the previous PUT.
If the data set is not
shared, and the operation is not WRITE New
Key, PUT is called at CZCPA2.
If WRITE New
Key and the key is not greater than the
previous key, CZCPA2 is called. However,
if the new key is greater than the previous
key, PUT is called at CZCPAl to place the
new record with a move mode PUT.
The type of the requested operation (by
key or by retrieval address) is determined,

Section 6: Virtual Indexed Sequential Access Method (VISAM)

159

dna U1P apl'J:opridtP code ~5 set ~ n the OCB
:"1cro code riE'ld (DeBMeD) prlor to calling
:;ETL.
A checK for read-onJ.y access is
nldde; .if ~O. VDMEP is called.
SETL
I\ZC~C2) is then called to locate th~
l<'c;lrcd record.

It y"s.
If nn't.
conteol
sharf>d,
rele iS€'
paqt'

<

control is returned to the caller.
dnd t.he dat.a set is not shared,
1S returned to the caller.
If
MOVF.PAGE (C2C'OC) is callpd to
the READ inter lock on th(: data
Cant. rol is then returned to the

caller.
:.:E'.:'L return:> Pither

Got found,

it

"f*'Z"dt.lon

15

found or not found.

the key did not exist 3nd the
assumed to be

d

WRITE Ne .... Key.

,'It tiii:: point for operations other than
WRITE New Key, SYNAD is called with 3 not
1. OU!Hj condi t lon..
For a. n€"I'W WRITE. not
i~sicloned to the end of the data set. a
.loc,-ltor lS inserted in the appropricte
F,lace, U"',e control information govelning
,.;!.,acCc· is updated to reflect the insE,rtion,
dnd the data record is moved.
GETPJ\GE
(C2CrO .is called to output the page cont61ninq the new record, and control is
.Let urned to the ca ller by the RETURN macro.
If the operat.ion is IORITE New Key. posit,ianed to end of data set, and shared, PUT
~ s ccd.led at. CZCPAl with the PUT option set
,.0 Viove Mode Coroplet e (OCBMCD = X' 0008' ) •
if the dat.a set is lilY\: shared, the PUT
opt.10:' is set to Move Mode {OCBMCl ==
);' OOOi,') •
Upon return fram PUT, control is
(·,ctu:cnea directly t.C the caller if t:he data
~~,t_ is not. shared; if shared. GETPAGE
(CZCPIU is called to output. the paqe contairnng trw nt~W record prior to returning
to the caller.

If S.!:..'TL returned a found condition, the
operation to be performed is one of the
f ollowi ng :

" DEI..REC

" "',UTE Replace by Retrieval Address
~

~RrTE

WRI'I~l;:_ Hepl_a_~by Retrieval Address and
WRITE Repldce !2Y..Ja9'" , -ehe overflow page is written out
;jY cdlling GETPAGE (CZCPIl>. in addition to
c~, lL.ng G:E:TPJ\GE to olltput the data page.
T;,,,, locator on the data page is cleared
f;r~or to outputting the page.
Control is
returned to l.he caller by the RETURN macro.

GETPAGE is used by VISAM routines RF~D/
(CZCPE). SETL (CZCPc>. VISAM Get
(CZCPB), and VISAM Put (CZCPA). to control
page I/O of a data set or member.
It is
used to bring data or overflow pages of a
data set into a buffer (or locate them),
delete existing pages, add new pages, or
update existing pages.
GETPAGE calls r indicated interlocks.
Centrol then returns to the caller.
If the last operat.ion was not a PUT.

Gc;-,ttol is passE'd just beyond the CZCPIl
ilT;Q C'ZCPI2 entry points.
TlH~ resulting
calls to MOVEPAG.f~ will reset t_he indicated
L'1terlocKs.
GE"l'PAGE will. upon

to input a page. test if
that page is a data page or an overflow
L,.)i,lge.
For an overf low page. it 1Iiiill input
U",e page, since overflow pages are not
i7lterlocked,
For a data page. GETPAGE will
check if there isa data page interlock
imposed. If so, it will deter-

mine it a read or write lock is set, and
call MOVEPAGE with the appropriate option
to release the lock. It will then input
the requested page.. If MOVEPAGE returns to
GETPAGE with a return cooe stating that the
f-age was locked and could not be input..
GETPAGE will set a return code, and exit,
indicating the page was not input.

Modules Called:
GETMAIN (CZCG2) -- Obtain one page of virtual storage for initial directory
entry.
Expand (CZCG4) -- Increase space assigned
to the directory area.
Insert/Dl!lete Page (CZCODU -- Insert added
directory paguCs) into RESTBL.
(CZCOD2)
-- Delete pAge(s) no longer needed in
directory.
VDMEP (cZCQRl) -- output a diagnostic message and terminate the function (but not
the task}.
Exits:
Normal -- Return is to calling progr.u:.

using the RETURN macro.
Error -- ABEND is called for the follOWing
conditions;
It

Current page number greater than nu:;nber given in DeB.

.. Number of directory keys not properly
cOGIputed.

VDMEP is called (the function is terminated) under any of the follOWing
conditions :
.. Maximu.m directory size exceeded.
.. No external storage space

avail~ble.

.. Storage ration exceeded.
Add

Dir~ctory

.. No secondary storage allocation
specified.

Entry Routine (CZCI'L)

Add Directory Entry is used to change
contents of a VISAM directory due to added
or deleted pages, which may cause the size
of the directory to change. It also
c~anges the key value when a change is made
~o a record that does not cause t.he number
of data set pages to change.
(See Chart

.. Expanding directory of sbared data
set.

OF. )

'"
Read-only,

!:~~enterable.

puhl-

~estri£tion~:

The directory of a shared
data set may not be expanded.

CZCPLl --- Entry t.O Add Direcs by type-l (privileged to privileged). or type-2 (nonprivileged to privileged) linkage.

Input: Register 1 contains the address of
the DeB for tbe member whose directory is
to be updated.
162

Part II:

Virtual Access Method (VAN)

'" Insertion beyond end of data set.
.. Oeletion beyond end of data set.
Maxi~

data set size exceeded.

" Invalid return code from CZCOD.
Operation: Initialization and general
register storage is executed in conformdnc,>
""ith linkage conventions. Base I'egister~3
are declared for the CSECT and PSECT. DCB,
RESTBL and DeB header.
If one or no data pages exist, no keys
are placed in the directory and control is
returned to the caller by the RETURN macro.
If keys are to be taken out of the directory as a result of the deletion of data

pages, the keys are removed; if any directory pages are vacated due to key rpmoval.
they are deleted from the data set by calling Insert/Delete Page at CZCOD2.
The
number of directory pages is updated and
control is returned to the caller by the
RETURN macro.
If a data key is to be added to the directory, and no directory pages exist, virtual storage space is obtained by calling
GETMAIN. The directory page is logically
inserted into the data set by calling
Insert/Delete Page at CZCOD1. The newly
obtained directory page is initialized.
The number of keys in the directory is
cowputed. The number of keys in the directory must be equal to or less than the current data page number minus 1, which means
that the call is to change a key. If the
current data page number minus 1 is greater
than the number of keys, ABEND is called.
since an attempt is being made to add data
beyond the end of the data set.
If a new key is being added, the last
directory page is checked to see if enough

room exists to hold the key.
If no space
is available. dnd no assigned but unused
directory pages pxist, the dirfctory is
expanded (CZCGII> providing tht' data set is
nonshated.
If shared, VDMEP 1: called.
For the nonHhared data s~t, a ('heck is made
to determine 1f more than one ['CB has been
op 0 ned for the data set; if so, all dre
linked to the same ISO dlld SIS[i buffer
Pdqe. The new directory page ~s initialized and logically inserted into the ddt"
set hy callinq Insert/Delete P'1ge at
CZCOD1.
Processing continues '1S if a new
key were being inserted or a key being
changed. The key is moved to the directory.
If a new key is being added, a new end
of directory is computed.
'I'he ISD Integrity flaq in t.he RESTBL i:;
set; this indicates to VSAM CLOSE (CZCQA)
that it should write the ISD to external
storage.
Control is returned to the caller by the
CALL macro.

Section 6: Virtual Indexed sequential Access Methorl (VISAM)

163

Vl'A~i

---

GETNllMBFi

OVERVIE;';
--- ----- ..

;h., p"rtit lun,'d 'dAM datd sets into d single data set
a serips of logical partitions.
To deal
wIth the complexitles associated with this
dcee:;,; HlPthccl, J'SS/360 ll~,ec; a partitioned
orqanization directory (POD) and relative
F8qe/f'xterna 1 paq,o corn,s[londence table
i "ESTEL).
Th., ,em dnd the associated data
control block (DeE} aLP used t,o relate a
member, or it:; alias name~"to the relat,ive
;-:os,ltion of i'he member wit,hin the data ~,et.
TI"-itf: }(E.s~rBI~ is used to dptennine the actual
ext,rnal devi ce addre:;s of t,h.> requested

c;ives paqe nnmbf'r of

described below.
Partitioned Organization Direct,ory (POQ!.

The POD, which consists of paqe{s) at
the beginning of a VP,l\M data :cet is placed
in the user's vi.rtual storage by OPENVAM at
data set OPEN time.
The POD page(s) are
provided and maintained by \~j~ for each
partitioned data set.
Its function is to
document member names with th.~ir relative
locations within the data set and their
attributes (data set organizat:ion, number
of pages, user data field).
The POD also
documents all aliases assi",ned to the
various members of the dat,a, s.~t.

User COdf;d Macros

'i:x'::ij------S-uppl:i'es parameters

to define

member ,;tructure dnd at.tributes.

FIND

ReqtH'~,;t~~ dccess to d member
descriptor from the POD.

STa.J

Specifies updating of a member
and/or alias descriptors in the
POD.

Control Flocks
DeB
D"ta control block oganization-independent working

The rr,aximum size of a partltioned data
set is 65.535 pages; the maximum size of
all members or even a single member is 65,
534 pages.
When the data set is shareable,
the POD is placed into shared virtual
storaqe and protected from the user.
The directory. F'igure 27, is divided
int,Q four parts; each POD part provides a
particular function. The four parts are as
follows:

1.

An interlock control entry.

2.

A space control entry.

3.

A directory block hashing table.

4.

Directory block entries linked into 64
chains.

s'orage.
RESTBL

Rf,>},ative external storage correspondence table.

Partitioned organization
directory.

F·)[:

Gencral V PAl', Hout,l,nes
..Locat{-~s ID€mbf:r Jescriptor in POD.
Find
----.-----------'--------.---~-

Stow

Update:; member and/or al ias

descrlptors in POD.
earTh

Searches POD for member or alias
rneceases size of POD.

peD

Relocate
l';eITth.,,~c;

164

llpdates t,he POD to acconnt for
in size of the POD or any mf'.mber
cf the data set,.

Part U:

(----------------------------------·-------'1

I

Virtual Access Method (VAM)

Interlock Control

(If

bytes)

I

~---------------·--------------------·--·-i

I

nareE'.
Extend

The int erIoel< word and the procedures tel
update same are described in the modul.e

Space Control (8 bytes)

!

t-----------------------------------------~

I Hashing Table (256 bytes)
I
~---------------------------------------~
I -______________________________________
Linked Block Entries 

fur VM'J gen8rdl services rou(CZCOH), and Release Inter-

VPAM ROU,!'INES

tine!.; Intt-rlock

lock. (CZCOI).

Descriptions of Find, Stow, Search,
POD, Relocate Members, and GETNUMBR
follow.
Ext~nd

Th", ~;PdCt' cunt r 01 entr y (POOSPA) indicates t he number of pages in the POD and
the nurnbf'I" of pdqf'S in the data set (Tdble
45),

The ha!';hing tabltc: (l'ODi-lT) conT.ains 64
pointers {edch four bytes in length to the
member and alias descriptors. The hashing
value of a member name or alias causes
select.ion of one of the 6!1 painters, which
in turn contains the byte address relative
to the POD. of the linked block entry
corresponding to the first name having that
nashing value. This block entry then
points to the word address relative to the
POD, of the second name having that hashing
value, etc.
Linked block entries are of two types:
member descriptor entry and alias descriptor entry. A member descriptor entry is
defined in Table 46.

Find !;earches t.he POD in order to locate
the memb.~r descriptor.
The member information including the starting page number and
RESTBL header offset is transmitted to the
member header and the associated DCB.
(See
Chart PA.)
Attributes:
Read-only, reenterable, privileged. public, system.
Rest.rictions:
A DeB can refer to only one
member at a time. STOW must be issued to
change user data in the POD prior to issuing a FIND. The OCB must be opened before
FIND is executed.
Entry Point:
2 linkage.

CZCOJl -- Via type-lor type-

An alias descriptor is defined in Table

Input: On entry, general register 1 contains the address of the following fourword parameter list:

47.
Use of Member Headers in RESTBL
For partitioned data sets only, a field
(DHDLNK) in the DCB header (DSECT name:
CHADHP, Table 48) of the RESTBL, points to
the member header (CHAMHO) rather than to
the RESTBL header. The RESTBL member header gives additional data needed to locate
pages within a member.
Table 45.

POD Format

r-----T------T----------------------------,
IBytes I Symbol I
contents
I
~-----+------+----------------------------~
IPODW
IWrite interlock
I

10
I
11
I
12
I
13
I
I

I
I POOR
I

I

I
tRead interlock
I
I
I
IPODRC tRead interlock counter
I
I
I
I
IPODIC IControl bytes for POOR and
I
I
IPODRC
I
I
!
I
14-5
IPODPG INumber of pages in POD
I
I
I
I
I
j6-7
IPODNDPINumber of pages in data set, I
I
I
I including POD pages
I
I
I
I
I
18-B
IPODLBPILinked block pointer,
I
lpointer (relative to POD) ofl
I
I
I
I
Inext available byte in POD I
I
I
j
I
IC-l0BIPODHT I Hashing Value Table 256
I
Il _____ LI ______ LIbytes
____________________________JI

Word 1

Address of DeB.

Word 2

Address of member name or alias.

Word 3
Address of area where user data
is to be placed.
Word 4 -- Address of member of bytes of
user data.
Modules Called:
Stow (CZCOK1) -- Stow member already
cheCked out to his DeB.
CKCLASS (CKCLS) -- Check protection class
of user area and DeB for compatibility.
VDMEP (CZCQK1) -- Process error occurring
while trying to access locked member
header.
Search (CZCOL1) -- Locate member or alias
descriptor in POD.
VSAM Open (CZCOP1) -- Initialize for
sequential organization.
VISAM Open (CZCPZ1) -- Initialize for index
sequential organization.
Interlock (CZCOH1) -- Impose interlocks on
RESTBL for shared data sets.
Release Interlock (CZeOI1) -- Release
interlocks on RESTBL for shared data
sets.

Section 7: Virtual Partitioned Access Method (VPAM)

165

Table t\6.

POD M',~r
(Part 1 of

rr--- --r--- -T - ISymboliOdtdl

- -

-- - -

Td hie 4 f;.

~;<'~;criptot:
-

~

/o'iEld

~-

.----- -

-~----~-.~--

- -"1

I

l"'f~nitl')O

\------,-t----t - - --.- -- -- --- - - ----- ---~--- -~--~
I POMNAMI C
I Thp fT1t>mt" r l"lm.~"
!
I
Ileft-' IN

!sequential paq.'s.

Maximl,",

~vctll\e

lS

50.

!

INumber of directory pages,
sequential merr.ber, or

I~ndex

r

I
I

I
I

!POMh I)IN

I
I
I

I

I
!
I
I
I
i

I r,wr,ber of um,sed bytes in thel
llast .'lata page for a
I
I sequential member.
I

I

I

pllurrtber of bytes of user data

j

I C-ont-_d tned in next field; this I
jiield and following field
i
Iwill be absp.nt i f bit 1 of
I

I

IPOMFLG is O.

I

!

I

!

IPOMU3E!X

iOptional data to be supplied i
I by the USeI.'. Length of this I
I field is L,pecified by POMEU. I

I
I
I
I
I
!
I For object~ program modules, I
I
I
(this field describes the
i
I
I
! relative (to the member)
!
!
I
11ocation.c: of the internal
I
I
I symbol dictionary. The next
!
I
Idescript~or will begin at a
I
I
I word txmnddry regardless of
Il ______ iI ____ I _____________________________
the length of this field.
jI
~

I

! First pagE" of this member
!relative to data set.

I
I
INumber of data pages in this I
I member.
I
I
I
Isequential member - record
I
jlength (actual or maximum>
I
I
!
I Length in bytes of the keys !

!

Ifor an lndex sequential

I

I member.

I

I

I Bits 0-11 - length

I

of

jlogical records for,

the

I

member I

Iwith fixed length loc,ical

I

I records, the maximum logical
!record length for an index
I 

I within the RESTBL by multiplying by 8
i _________________________________________
(left shift 3 bits).
L
J

FIND calls VDMEP if:
1.

While waiting to access locked member
headers, an Attention is received.

2.

While waiting to access locked member
headers, 100 TSENDs are completed.

3.

The DCB is found to be closed or
invalid.

4.

The DSORG is invalid.

Section 7: Virtual Partitioned Access Method (VPAM)

167

--Af'-rJ-hJ Wl .t l
df·I.'ct i fl', .,ny "f

bf f'Xt'cut~'d upon
t ~ I'- f () 1 1 f ) lAl 1 n q

,[',['-'l

f'(,nd

--I

rf,.~uir'e:'}

;1.1ta Sf'1

,!t~l 1. Vf~

dn~')io!l.

alrpady 1n use t'l .,nather DeB.
If t.he merob"r i,; "Ct.lVE' d '"cc;t is made to see if it
j!~ l.ni' e-intf,rlocKed.
This ffid V1.il T:;EN:1.
lI,t
trl

while it
..

"

Th(~

cld:::~·~i'';~;

fJ('otect Lon

\IS(~l

d,r~>d

VPA,"l

Incrdk'l'

dc't i ve

DCt~

of

tne

ileader

locKed,

witt,

riC)

i f the melr:)Cr was not dcti ve,

d(J j<.1E.:"I' ..
1

IGvalld me~ber or alias ndmc
'_) r>: ci f i f-'

Hi'I!.;e
C~;;:';t'T

rcgi~';~-C'rs

end PSECT.

l11emher rH'ader and

Dell. neaclf'r doe::;
J\BEND 1.<::'; called ..
till:

w~lte-lnterlocked

nr,t'

for

:;pt,,;,,

T['.p DeB i:o. Lec,tel l0 det.ermine i f i t is
currenr.ly j.,n u:,:.e..
Ii" a n:ember had bpen
toun:j }~'r!:v}on:~ly ..:i.n,j was ~3till checked out
t.o t~.hf' 0C£:'"
F'ind {~dl1::-j, ~,":tow (R) to c]()!~t'j
ihe ",ember:.
If t.he DCi' is in U~,f> tor

member, the call to Find R0y
ha~
been done erroneously. A return is
qiVfJ, r , ) t·h., caller Indicating that t.he DCB
crea~ins

->-..

0

ll~-;f;

i n

tflr

cr~~at l nq

memt:er..

it

a member
It can be built in
the dUIT,n;y header space provided by OPENVAt'l;,
ill availablp (deleted header) space, or it.
C<.ln be built in unused RES'I'BL.
A dummy
header will exist if this is the first call
to Find since OPf:tNk"'l was t:xecut ed.
If a
FIND was ~one and th~ DCB header ~as linked
to dll active mem:_,er'1Eader. the dununy header :;pace W.t~_; relea~,ed.
Subsequent FINDs
will U5€ the deleted header space, if
dvailable. or unused RESTBL space.
If
unused RESTHL space is required and l_tler(,;
is not enough sPdce remaining to accommOGate d l1'cmber header, the RESTBL is €,xpClnd.?d
ty calling ~xpand RESTBL (CZCQl) (non,;hdrf'd daTd ,.;et onl:,).

unnamed.
T

~ t-~i:;

L:(~:-~

;.,~

~'l:'·t~

in

USt-~,

the

POD is

givPfJ tc F.ind..
If
t_ne l~d:;ne Cafiflot bt" locat(:-'.j In tht:.; POD, a
~n()t
rour,(j" [<'turn ic' made t:o ttle caller.
tc)r

ni~mp

tne

It the found

naIll<' wa~~

cG!n,"pondinq membE'r :JamE'

User

Ja~d

set'.
"tht:)

ha~,

to be built.

Aft"c UIC member header is built, data
p i:; cdllFd.
The RESTBL H,tYT'lock i:; rf'l fa::;e<:! for
shared dat21 sets, and control i::; rf't.1Jrn"d
to the caller by t_h·c RETURN mriCco.

3tow Routin"

ut~:<;:
Re.ld-only, reenterable, priviYeged; publ~c. system.

FREEMAIN (CZCG3) -- Release virtual
storage.

Restrictions:
Each member and alias name
within a VPAM data set must be unique.

Expand (CZCG4) -- Obtain additional contiguous storage for the alias list.

The DeB used to control opelations on a
member must be open prior to i~;suing a
STOW.

Disconnect (CZCGA) -- Loqically disconnect
a task from an area of virtual storage.

I f a type-N STOW or type-R STOW is given

for a member, subsequent references to the
same member must be preceded by a FIND. A
FIND must be issued before attempting a
STOW (R). (0), or (D).
If new aliases are being added to an
existing data set, no duplicates are
allowed within the input list of new
aliases.

VDMEP (CZCQK1)
output a diagnostic message and terminate the function (but not
the task).
Find CCZCOJ1) -- Search POD to locate a
member descriptor.
Exits:
Normal -- Return with one of the following
codes in register 15:
'00'

STOW successful.

'04'

New name, or replacement for old
name, a.lready in use (N, NA, C,
CAl, or old alii:ts does not belong
to member specified.

Register 0 -- Address of the user supplied
data area.
The formats will be interpreted, depending on the type of STOW
issued. They are described with the
STOW macro format.

·os·

Member name not in POD.

• 10'

Old member name not in POD (C),
or alias name not in POD (CA,
DA) .

Register 1 -- Address of the DCB. Note
that the macro code field in the DCB
will be preset to one of the values
(hex) discussed with STOW macro format.

• 14'

Illegal STOW type requested

Entry Point: CZCOKl -- Called by either
type-l (privileged to privileged), or type2 (nonprivileged to privileged) linkage.
Input:
Parameters are passed to Stow in
general registers as follows:

- Macro code out of range.
- Name specified is all FFs.
- Input area not on FW boundary.
- STOW eNA) and alias count=O.

Modules Called:
CLOSEVAM (CZCOB1) -- Close member header if
open on a STOW type-D.
Search (CZCOL1) -- Search POD for a member
or alias name.
Search SDST (CZCQE1) -- Search shared data
set table.
Interlock (CZCOHl) -- Impose read or write
interlocks on POD and RESTBL.

'lS'

User data exceeds maximum length.

'20'

Attempt to expand POD for system
catalog.

Error -- When any of the following errors
are detected, the ABEND procedure is
executed to terminate the task:
• DCB header does not point to DCB.

Release Interlock (CZCOI1) -- Release read
or write interlock on POD and RESTBL.
Reclaim (CZCOG1) -- Release external pages.
Relocate Members (CZCON1) -- Updates POD
after call to RECLAIM.
Extend POD (CZCOM1)

Expand POD by page.

VSAM Close (CZCOQ1)

Close VSAM member.

• DSORG in DCB is not VIP or VSP.
• Type-R STOW. member name not found,
and not called by ABEND.
• DCB already opened for another member.
• A call to Search SDST gave an error
return.
• Member checked out by another DCB.

VISAM Close (CZCQA1) --

Clos~

VISAM member.
• DCB not linked to specific member.

GET MAIN (CZCG2) -- Obtain storage for the
alias list.

• Member in use; cannot delete it.

Section 7: Virtual partitioned Access Method (VPAM)

169

>'1'[,;'r;

,-j

rjf..·'lf'Ct

fly

(~i

(1(1

d

funrt i()o

t tlt"

~ {

":IlML!

tr,();

LnWl tlq

,';

~d!.:;k)

tht'

• (.

~.Or'i

PX<'Cllt.Pc!
~:,

'j.{'.~

,ln,l

•

~h'

t-.~~rrrjnd~p,~:;

TYf"'- NA
N<>w " lla~;ps n';dy be added to
,In ('xic;t in<, mf>lPber.
The pe'D is
:;t"drch":j f()r ear:h alias beino added.

If thp

are unique, an alias
is rredted for each alias
beinq added.
These new al.las descriptors cir~ llnked tr the appropriate memher ;'iescrirtor, and control is returned
to th[ caller hy thp RETU&N macro.
dlja~cs

~~scriptor

• No secondary allncaLion.
•

Attempt~

t

~"',

c~xp:-i~-,d

RE~~TRL

•
for:

sh~re(~

data Set.

TYFf'-R -'- ;;T,lhi \ iTt-' h i;~ (",d 1 Pc:! tc
replace' U:;fr ']at d, rlnd c:luC'e the m..'m1'('r.
If user dlPi> wa~, specified, the

user data is stored in the POD.
This
C2 use t.tw IN'
contain~>d USPt" datd, ~)r thf:: new user
data requires ~dditional space.
If the
member descriptor is moved, the hash
painters and the ali3s links are
upJat"d.
I f th," llser ('ount in the mem'"
bpr h"'ader is 'Zr'TO, the member header
i ,; clos,,'d, rthilt. 1:;, the member header
1.S dnded to th(' delf'ted member header
chain, the P('R hE'dder link is cleared,
and the membpi name is set to
BXL1'FF' I.
Thf POD is updated, and
cont_roll"; p'tiJ['rlcd to t.he caLler by
thf~ RETUE=;N JTtG,C co.
'11;:.:D.

The: val idi t Y
1:.hf·· STOW t.Y:t?t--ti and t~hc
val.idit,y of p<:rtlcu"',l.r t'.ypes of ::3TOH witn
the existing UPEN opt,ions, are verified.
AEEND is callfd if any error~.O or 5.nconsistcncips are f( ~lnd->
Thp RESTB.L i:3 i E"t' r:~ ~ 10(":' KPO .f ·:')"t :'::';1)~'i r~·,]
(J.ata sets...
T;~e .loch. will .of" relea~3ed prior
to dny RETURl',
VSI,M CLOSE (CZCOQ) or VISAM
CLOSE (CZCCA) au' called If requirf-:d.

;:h., PClu
descriptor..

l~;

'iedrcllPQ to locatf! the member
f th+_~ membE1r name is not

lL ~he
~D. a member d2scriptor ~s
buU.t: for a t_ 'pe-N STOW.
'rfJr POD and
RESTEL pd~1E' C :'untF,'IS are Updd"'(~d t_Ci reflect
the addi t lon )f t.he new member a nd to
reflect change'S to a.ll. CfU,pd Ifl",rrbc'r,;.
If
the POD has b';en updatej, by STCJ\o.i, t.be POD
Integrity fla} in the RESTBL is set; this
Cduse~-; CLOSEV AM (CZCOB) to write the POD to
external stoT'lge.
ControJ. is returnpd to
t~he caller by the RETURN macro.
~ouna

If the merrher name is found in the POD,
rrocessing continues for the particular
::;TO'''' typp:
.. Type-N -- It a name was found on a type
N (new mtmber), no further processing
is done, and return is made with d
return cede signifying that the new
name .... as not unique.

170

Type--'U - - TYPf:-iJ STOW accomplishes the
same thing as type-R, except that the
rnembfT headpt is not closed.
It

Part II:

Virtual Access Method (VAM)

"

(delete) cause:·,
the data pc.ge" as~;ociated with a merrber
to bf' delet_€d 'rYy calling Reclaim
{CZCOG} •
The memb"r dnd alias descript.or~; an': deleted from the POD.
The DCB
ie, :initialized for reuse, and control
is CFt urned t.O the call er hy the RETURN

TYf,"-D-'- STOW type-D

llkl.Cro.

.. Tvp<.-DA -- I'\i.iase:' mc.y be deleted fro:;:,
"ll Exi~;tins JT>pn,ber.
The POD is
searched for th~' a lias being deleted.
If found. the alia3 descriptor is
deleted trom the POD.
This process is
done for e~cn allas being deleted.
.. 'Typ:"-C and Type-CA -- Type-C and -CA
;,1'OW are name changes of members or

aliases.
The POD is searched for the
ni'\we being chanqed.
When found, the
new name member or alias replaces the
old name accordingly.
.. Type-NAIl -- Ni'W aliases may be added to
an existing member as in ;; type-~IA STOW
but if any new aliases dUf-lieate existing aliases or names, nom:· arE' stowed
and a list of these duplicates is supp-

lied ~o the caller.
Stow does a GETMAIN for ~A of list, passes VMA in
register 0 and will not FREEMAIN this
ayea.
It there are duplicate aliases
within an input list of new aliases.

some aliases may be stowed and,
although a return code of '04' will be
set, no duplicate names will be supplied the caller (see Restrictions).
Search Routine (CZCOL)
Search is called by F'ind, Stow, and GE'T'NUMBR to locate d member descriptor in thp
POD for a given member name or al1ds.
MOSEARCH, entered at Search's second entry
point, may be used to search past the first
matching entry in the POD for additional
entries with the same name.
(See Chart
PC. )
Attributes:
Read-only, reenterable, pri vileged, public, system.
Restriction:
If MOSEARCH is called, Search
must have been called first, and the
results of that search left undisturbed.
Entry Points:
CZCOLl -- Entered via type-l linkage to
locate first matching member descriptor.
CZCOL2 -- Entered via type-l linkage to
search past first matching entry in the
POD, seeking additional entries with the
same name.
Input:
General register 1 contains the
address of a two-word parameter list:
Word 1 -- Address of the DeB associated
with the POD to be searched.

Error -- None.
Operation:
Initialization and general
register· storage is execut.ed in conformance
with linkage conventions.
Base registers
are declared for the CSECT. DCB, DCB header, POD, and POD member descriptor.
The OCB i~~ modified
~:;earch

Den
§.ymha!
DCBHV

DescriEtion
Hash value of member or alias.

DeESC

Relative location within POD of
found descriptor.

DCBSP

Relative location within POD
descriptor of preceding found
descriptor in same hash chain.

Search has two entry points.
CZCOLl is
the entry point for the ~nit.ial call to
Search.
CZCOL2 l.S t.he entry point for continuing Search (MOSEARCH), after Search has
initially been called.
A switch (DCBS·d'I')
is set to indicatet.hat the current entry
was to Search (C2COL1). This switch is
tested on every entry; if on, the member
name is hashed; if off, the name is not
hashed, since it was hashed on the initial
entry and the value still exists in the rCB
(DCBIN) .
The hash value is used to obtain the
hash chain pointers from the POD.
If th.
pointer is zero, the return code is set to
"no hash chain
and control is returned to
t.he user by t.he RETURN macro.
R

Word 2 -- Address of an a-character field
containing the member name or alias to
be used as a search key_
The search code field in the DCB will
contain a code to indicate the type of
search being requested:
M

Member

A

Alias

E

Either

Modules Called:

None.

Exits:
Normal
Register 15 contains one of the
following return codes:
• 00'

Successful.

• 04'

Entry with matching name and type
not found -- no hashing chain for
hash value.

'OS'

Entry with matching name and type
not found -- hashing chain exists
for hash value.

per results of

or MOS.l'.:ARCH:

,

If the hash chain pointer exists, the
descriptor is obtained.
The name input to
Search is compared t.o the descriptor namf'.
If the names do not compare, the rest of
the chain is searched in the same manne:r
until the name is found or the end of the
chain is reached.
If the end of the cha).n
is reached and the name is not found, th"
return code is set "not found" and contrc-l
is returned to the caller by the RETURN
wacrc.
If d descriptor name is found that
corres!:-,onds to the Search input nam,', th·,
search t.ypE' (m(>mber, alias, or either) i·;
t.ested to det.ermine if the found descrip-t.o!
is the correct type.
If the search type
was "E" (either), t.he search was success··
ful, and the return code is set to .. foun,L"
The location of the last two descriptors
are saved (for MOSEARCH) and control is
returned to the caller by the RETURN mac:o.
If t.he search type was "M" (member), dnd
t.he found descriptor is a member descrirtor, a "found- exit is made as descrlbed
above.
If the search type was "M" and tje

Section 7: Virtual Partitioned Access Method (VPAM)

l71

found descriptor is an alias, the search of
Lhe hash chain is continued.

Error -- VD~P is called if an invalid
return code is received from Insert.

If the search type was eA- (alias) and
che found descriptor is an alias, a • foundexit is taken as described above; otherwise, the hash chain search is continued.

Operatio~~

Extend POD is called by Stow t.o expand
U;e POD by one page, both in virtual
storage and on the external storage device.
~'

4,L:!i-.

i ..r~~ ,'.>cu~t,,;: ~,.d

,;.~

lL·')riL",Jct~)i-: ....

t)t-(:~'(~£{.m

',{,_:d IJAtI;:, .. ,f

th-l?: n~,lr

t,~)

i!.

OH~

'ji"::c,ct:..-

G.:l. ia:·~,~,-2

!:.mftel,Jcc:h tor dat(]. Bets ;:,:Vi.'l:C·,j
for Ul.x'late, '~j'vj when ;H.'l'r. (S'I
'!(!'liJElst£~O

~:.:,l?-·i

;: ,;:1::"

~~I.>~r::<:~

~;'5.:r<~-t:\J"

Q:~),\til

<;~_:·~_{t'':''{1S

\

,51"2;~

a}so

.I:.;"JL~,·::'t;;.!·i. ~,i.l~;

it

j-:!e(:dUGt~.
_f. ,,:;qtiij:~~3

~ !,~;l~

f"'.lrCf,;'::i.de~

~jR-;~~{;£

.:J

,,;;

z::q'l.li .

.),

:t,;.::;

~:\

'fc;,~'

l-k

J''fi,~

i:m:ft2I'S €«<;b fen: ,,11 ,.::<-11('( ("""til

Sf~Y_':i

"

th~~s

blJ.ft,,;:t" a:r.·(~d.S

QS;;'H's buftering T.0Ch;,i'.:Jue:;; 'nL!. b,':' TtE
further in Pa.rt II of th.is s!3,.tio!L

,:~,ssee.

:~!SAt\1

'l,'}'je "WI'I( .;.J"ea pro,F.i.. uc-d 1:0I: O8.\[>'i :i;~ known
t,h;.:.' QivX \-vv)!: k i5i.rE:~a ~ or ~~;-WKAB,..
I J_.::

"it,l.'1t'E~),~3,~ is t)lci . :t:c~ in. t.tte j)t:P~\~K f5.c ,t.r::l uf
the d:ita e'-'ntxo! t·lcdc, by S./lJ-1 ul?'t:!n"
All

1i-r;:).(1;f: \J),7:J:d...n 1:J.~.'=.: riW.K 1#()£k d't'ea" ej':,c(:'i-:'(·
t~h()f~t-:; lti,;:'):!'ds re~ :eA:'\) E:d ri.H:' oa;."t>il. f::'v~~nt". Ct/nt,!';7:1

blocks.
Q~Ji\,

a~e

rsi~rred

to with d pKsfix of

Q~T}\J.LR

(~'. . if,~:-i1!5Ls-

1)£ ~

AXi

g·-·~wj':d

·";cr';ilf~

i';i..(C-'&

,~a;:_L

D<,l.i.:..a. Cont.r:cl Block (OCB):
The XB :;.s
~5SAM'spriinary
information a ix-.;;' I:
dJ€ ,!iJ:td set"
It: 1.s defined by tiH: lme( at;
a~,8"'-dbly tinli! t.l:n:ough tl'1"=' lX:B macro
inst.v.1ct_io£l, and n.ay be filled in or mr)(H'
fi.:,! at. OPEN t:,imc or during exec:u.Litm"
i\PF€.i":'UX '8 C"Hltains a lis,,:: of t.h'2 ", of Q'SAM

ti.elij,' of t.be DCB used exclusively
with a brief description of "';ach"

QSI',!1

Qi§7Kr-;R.f1""{2~-t'K~~~H? j ~

!.J ,.

u--· ~~'J.)K ('!, ~:;' d'~(e ;;. i:. €"3 tf.; r
t,ex '\.>C:'r..C,,;~xft~s wJaen El~~DAD

.:'~lJl~;tJ"~(:·R"

s.?f\i"il.lg

\~(-<;9i~;

Dr ::rtNA,l)

l$'

:i,wJ'o.l<.ed

KLn·c./LhE:l:

.1 ~~~

<1iIi",::;;~:

d

u~;-ed

1:. ()

s(-}\ V{~

t.ypi~

d.:rt:!·-)i t (,,1.'
2 lin}(:tzJ·e,

,l:ef ~.!l' to

r.fi~:K.Ait

E"'~nt.

Contxol

BlocltW~B):

'UH! DE',:D

nec:€:ssary- fu.(tr;€

i.:.cn-

operdttion and refie,:ts t.b0'
std~.US r~f t_Rl.~ comple.ted operation.
QSMJ,
L . l. '(.:tal i zes the DEeB before I/O xc<."(~uests
d r.:e pctssed to BSAM, and the 135M'1 Posting
l:',(,'utine complete~; the control blod.;>,
t \hol of each 1.10

[QwKWKi-QWKWln3},

':::€fji..s·tet':}. it~ a

'"'b,"!"lie ,:'")SEC'l!

[u'C;;(

'p.~0-;~ide;--[nfm:=mati(m

s!.tVi ng

{:::Hl

be

f{j4md. in Appendiw ;;..
I;, addit:ic,n
,,,

11=DCH addrt:ss

i

I :l.'''fKB
!
11=C~B

I
!
,
I
I
I

i

",ddnss

address

!
I

i
I
I

iREAD/WRITE, CHECK, GETIO

11=DC3 address

i

11=DCB dddl:ess

i

I
il=error type code
I
IO==DECB addr£'ss
I
i
I
I
I
!1=DECB address
I
~ HEAD/WRIT!:: I
j
i
I
I
J
11=DCB address
I SYNAn
ICNTRL
IO=action code and value
I
I
I
I
I ESP
3
Il=OCB address
I
I
I
I
I POHlT
3
11=DCB addr.Ess
I SYNAD
I
IO=pointer to 'l"l'RZ or ZZCC·
I
I
I
I
IOh.: i(
t;
P=DECB addn3ss
I SYNAn
I
i
i
'P~"I,U::;H
I
4
11 "'DCB address
I CHECK
I
1-.-.... ,-,---.... -.. "•.1. .......----..--.1. .. ---.--------... -------·-··---------.1.------------------·---"~· ..-·1
I "'The t .. e~tms TTRZ and ZZCC refer to the relative form of the retrieval address of any
i
! (·.. lock ",ithin it data set on snagnatic tape or direct access devices. This address is
!
I
I obtained, in h:s relative form, by BSAM NOTE (CZCRN). Tl'RZ refers to data sets on
I ... magnetic
and ZZCC refers to data sets ___
on ...
direct
I.
_•._________tape,
• ___,_.___________________________
_ _ _ _ _access
_ _ _ _ _ devices.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _.Ji
~

180

Part III:

Queued Sequential Access Method (QSAM)

Table 51.
rabl"," IJ 1.

Parameters and Return Codes of
BSM Modules

f\drJrcif>t ('r~;

dnd kpt urn cojes of

BSAM Point (CZCRM) -- Entry at CZCRMA.
Reposition a data set.

BSAM Modules

r------T---------------------T--------------------------,
PdramPter'.
1
Return Codes
I
f------+---------------------+--------------------------i
ICZc"RA IGRlouU:ll addre,"s
I None
I

BSAM Control (CZCRB) -- Entry at CZCRBS.
Reposition a data set.

I

I

I

I

BSAM Backspace (CZCRG) -- Entry at CZCRGA.
Backspace.

!~Dduipi

1'~ZCiC]u,:st flag
jtuDAD fldq in DCB
IGRO=DECIl dddr!'s,"

"ddr!',;s

I

INormal <<'turn, GR1S~O

lJl'" dddn"'s

to TTRZ

or ZZCC

I

G~l~DCB

I
I
I

IError return,

GR1S=~

IUnrecoveraole error
lin DEB

I
ICZCRll

I

in DECBI

I

I

IlRO=dctlon cod., dnd
numb .. r value

Il::rror
I

I

I

GR1S=O
return, GR1S#O

I

I
I
I
I
I

I
I
I
I Enor
I
I
I
I
I
:CZCRN
IGKloDCB
ddClr<'sc;
I(;RI=TTRZ
or
ZZCC
address
l ______ 4 ____________ ________ ________________________ __ JI
ICZCRG

IGH1=DCB addres-i

~

INormal return,

GRIS=O
r<'turn, GR1S"O

~

CZCSAB -- Entered upon issuance of the
first PUT on a data set, the first PUT
following a SETL type-E or -B, or the
first PUT following a FEOV.
CZCSAG -- Entered upon issuance of all GETS
except those listed under CZCSAA.
CZCSAW -- Entered upon issuance of all PUTs
except those listed under CZCSAB.
CZCSAX

E.ntered upon issuance of a PUTX.

CZCSAT

Entered upon issuance of a TRUNC.

CZCSAR

Entered upon issuance of a RELSE.

CZCSAV
FEOV.

Entered only by SAM Close or

CZCSAS -- Entered upon issuanCE: of a SETL.
Input: The following parameters are
passed:
Register 0 -- Address of work area (if any)
for entries CZCSAA. CZCSAB, CZCSAG, and
CZCSAW.
Register 0 -- Address of input DCB for
CZCSAX when an output-mode PUTX is
issued.
Register 1 -- Address of DCB for all entry
points.
Data References:
CHAISA, QWKAR.

BSAM Note (CZCRN) -- Entry at CZCRNA.
Identify last record read or written.

I

flag

l!'lonMl return,

dcldrps,;

I
I
I
I
I

Exits:
Normal -- Return to the calling routine.
Error -- ABEND termination under the following conditions:
a. During processing of a GET macro
instruction, when the computed sum of
the logical record lengths (11) of
variable length records does not
equal the specified block size (LL).

b. During processing of a PUT macro
instruction, when the user attempts
to PUT a logical record longer than
the specified maximum block size.
c. During processing of a PUT macro
instruction, when the user specifies
a value in the lenqth control bytes
(11) of a variable record larger than
the logical record length previously
estimated in the DCB.
d. During processing of a PUTX macro
instruction, when the previous macro
instruction was not a locate-mode
GET.
e. During processing of an output-mode
PUTX macro instruction, issued on an
output DCB whose address is in
register 1, when the associated DCB,
whose address is in register 0, has
been opened for Output.
f. During construction of a block of
fixed format records, if the user
causes an incorrect length output
block to be created by changing the
value of the logical record length.
g. When a PUT macro instruction is
issued on an update, input, or readback data set, or when a GET macro
instruction is issued on an output
data set.

CHADCB, CHADEC, CHADEB,
h. When a SETL is issued, but there is
no (S) in the DCB MACRF.

Modules Called:
BSAM Read/Write (CZCRA) -- Entry at CZCRAS.
For data transfer.
BSAM CheCK (CZCRC) -- Entry at CZCRCS.
Test 1/0 results.
Section 2:

Otherwise, exit to user's SYNAD or EODAD
routine.
operation: The subroutine functions are
shown in Table 52.
Interface Rules and Module Description

181

Tl>ble !>2.

Sul:n:out.ine Function:;

I

i

r---------- --- -T--------------- ----'--7----' ,- '-'1' - ,- - - - - - NaIll€

Entry (8)

----, - -----------, - - - - - - - - - - - - - - - - - - - - - - - - )

I Chart I

Function

I

~,-,-----------,-t----,-------------+-----+------------------------------------------------1

iGE',C

leZCAS7

I OM

IDeblocks logical records

I

1

I

I

!1'RUNC

!

i
i eZCSA3
!

ITREOV

ICZCSA9

I PlY!'
I
I P(JTX

I CZCSA8
I
I eZCSA2

jRELSE

I

!CZeSA4

I

I

!SerLR

!CZCSAL

i

I
I
I

iSETLP

I

iSETLe
I

!CZeSAZ

t
! !
ISETLEB

ICZCSAH

I
I

I
I

I

IINITIO

1

I ON I Blocks logical records
I
I
I DO I Returns logical records retrieved by a locat,~-mode
I
iGET to an UPDATE or OUTPUT data set
I
I
I DP i Truncates current block (output or update)
I
I
I
I DQ IReleases current block (input, update, or readback}!
I!
I
I OR ICompletes or purges outstanding I/O requests
I
I
I
I
I OS IPositions data set at specified retrieval address I
I
i
DT IPositions data set at previous loqical record
I
I
I
OU ,Obtains retrieval address (TTRZ or ZZCC) of current I
DV

I

LIF"LUSH
_________

182

Ilogical record

1

I

I
I
I
I

IPositions data set at beginning or end of current

I~l~e

I

I

!
I OW
I

IInitializes buffer addresses, block size, etc., andl
I constructs DECBs
I

I

I

I

ICZCSA6

I
I
I
I
I
I
I
I CZCSAI
I
I
I (Entry from PUTX) I
I
I
I
\PUTIO
ICZCSAU
I
I
I
I
!PUTXIO
ICZCSAJ
I
I
I
I
ICOMIO
\CZCSAM
I OX
I
I
I
ISYNAD
!CZCSAN
I
I
I
I
I
I
I
IREAD/WRITEICZCSAD
I
I
! (Entry frolll GETIO) I
I
I
i
!CZCSAE
I
I
I
I (Entry from Pln'IO) I
I
I
I
ICNTRL
ICZCSAC
I
I
I
I
IBSP
ICZCSAY
I
I
I
I
I POINT
ICZCSAP
1
I
I
I
I CHECK
I CZCSAK
I
jGETIO

I

!CZCSA5
I (Entry frolll GET)

I

I

ICZCSAF
__________________ I

~

Part III:

~

____

IPerforms buffering for input operations

I
I
I
I
I

IPerfo~~

buffering for output operations

I

IPerforms buffering for update data sets

I

IInitializes for a new buffer

I

(Transfers control to user's SYNAD routine and

I performs checks on error options
I

tIssues an I/O request for data transfer
I

I
I
,
I

IRequests repositioning of data set

I

IRequests backspacing of one block

I

!Requests repositioning of data set

I
I Requests a check on results of an I/O operation
I

IPurges
___________________________________________________
I/O activity from OECB queue
JI

~

Queued Sequential Access Method (QSAM)

Blocking Logical Records: The user
issues a PUT macro instruction for each
logical record he wishes to include in
thf: output data set. The PUT subroutine
adds the logical record to the block if
it will fit within the current buffer.
Otherwise, the block is considered complete, and the record for which t.hc PUT
was issued will be treat0d as the first
record of a new block. The user can
cause a block to be regarded as complete
prematurely by issuing a TRUNC macro
ins truction.
Deblocking Logical Records: The GET
subroutine returns to the user a single
logical record each time he issues a GET
macro instruction. When a block of
records has been read and checked, the
buffer address. of the first logical
record is returned to the user if the
GET macro instruction was in locate
modei or, if it was in move mode, the
first logical record is moved to his
work area.
When the current block is
completely processed, the next GET
issued causes the buffer to either be
refilled if the data set was opened for
Input or Rdhack, or to be written hack,
if required, to an update data set and
then refilled. At any time, the user
can cause processing on a buffer to be
regarded as complete by issuing a RELSE'
macro instruction.

Once a buffer has been either filled or
wr i tten out, and checkt~Ll. it i:' available
for processing. and V~;AM will begin returning logical records from it to the uspr, or
adding logical records to it as they are
supplied by the user. When this current
buffer is completply ~rocesspd, VSAM is~ues
f'

i t h ._" r

d r . '(j d

r f.'qlF'!; t

t"

r·' t i. 1 l

1

t,

\H

,i

write request to wr.l~' It uu'. Th.,[, the
previous read or write op~rdtion is
checked, and that buffer oecomes available
for processing.
Buffering is performed for
input or reddb~ck, output, dnd update data
set_s by the GETIO, 1'1];:·10, dna PUTXIO subroutines, respectively.
Under some circufnstances, it is necessdry to perform only sinqie buffering; that
i'. only one buffer is used. In this case,
tlH' fJointers to tjoo two DECBs are both set
to point to the first DECB, so all operations will be performed on the same DECB
regardless of the switching of pointers.
The decision to use double or single
buffering is based on the OPEN option of
the data set, or on t.he combination of
device type and macro option specified in
the DCB.
Double buffering will be done i;
all. cases except the following:
1.

When the data set is opened for
UPDATE.

2.

When the DCB MACRF requests a SETL
(S> •

Buffering Blocks of Data: The normal
buffering facility of QSAM is known as
double buffering. This involves the use
of two buffers, one of which will be
currently in use while I/O activity is
being performed on the other. Thus, on
a normal input or readback data set,
while logical records from one buffer
are being supplied to the user, the
other buffer is being refilled. On a
normal output data set, QSAM will continue adding logical records to one
buffer while the other is being written
out.
Each buffer is assigned to one of the
first two OECBs contained in QSAM's QWK
work area.
Pointers to these OECBs are
contained in the DCB (DCBOEl and DCBDE2).
To achieve the alternating of buffers, all
read or write operations are performed on
the DECB painted to by DCBDE2, and all
checki ng operations are performed on the
DECB pointed to by DCBDE1.
Following each
checking operation, the two pointers are
switched so that, when the next I/O is
initiated, the read or write performed on
the DECB previously pointed to by DCBDE2
ciDd now pointed to by DCBDEl will be
checked, and the buffer belonging to the
DECB now pointed to by DCBDE2 will be either refilled or written out.
section 2:

Single buffering must be done on an update data set to allow the user to update
one block of records at a time. No readi,g
ahead can be done until it is determined
whether or not the current block of recorjs
must be updated, since an updat~ write can
only return the las~. block read.
With double-buttering faciliti~s, QSAM
requests two writes before requesting a
check on the first write.
Examples of Double Buffering:
1.
Double buffering involvinG an outr ut
data set.

Phd Se I
DCBDEl
''';

DECDl

I

V
DECB2

I

V

V

Buffer I

DCBDE2

i

\

(em~ty)

ruffer II (available
for processing)

QSAM bui lds tr.'C! first block of t· he
user's data set in Buffer II by adding to
the buffer each logical record for which a
Interface Rules and Module Description

183

PUT l.S :;,ss\led, ur.til the buffer is full.
Then a write request is issued for Buffer
II, a check request is issued on Buffer I
i. since DECBl is initialized by QSAH to indicate normal completion, this check constitut.es a dummy request>, and the DECB
pointers are switched.

primed, an initial read is requested on
Buffer I.
(This varies from the normal
procedure of reGuesti~g reads only on the
DECB pointed to bj- OCBDE2.) Then another
read is requested to fill Buffer II, a
check is requested on Buffer I. and the
DECB pointers are switched.
Phase II

OCBDE2

OCBDEl

I

OCBDEl

I

V

V

V

V

DECal

DECB2

DECBl

DECB2

!

I

I

V

V

Buffer I (available
for processing)

Buffer I I (written
out, unchecked)

QSAM now builds the second block of
I'ecords in Buffer I.
When it is complete,
d write request is issued for Buffer I. a
check request is issued for Buffer II, and
the DECB pointers are switched.
Phase I I I
OCBDEl

I

V

V

DECBl

DECB2

I

I

Buffer I (written
out. unchecked)

Buffer II {written
out, checked. now
available for
processing>

Buffer I I is again available for processing.
The third block of the data set is
built in Buffer II, and when complete, a
write request is issued for Buffer II, a
check request is issued for Buffer I, and
the DECB pointers are again switched.
Thus
the processing operation continues. alternating the buffers used, W1til the user has
placed the last logical record of his data
set in the buffer, at which time he may
CLOSE the data set, causing the last hlock
of records to be written out and checked
immediately.

II.

Double buffering involving an input
data set.
Phase I

i

DCBDE2

I

V

V

DECBl

DECB2

I

V

Buffer I (read,
Unchecked)

I

V

Buffer II (empty)

Since on the first I/O request of an
input data set, both buffers must be
Part III:

I

V

Buf f er I (read,
Buffer II (read,
checked, and availunchecked)
able for processing)
Each of the logical records in Buffer I
is returned to the user when he issues a
GET macro instruction. When all the records in Buffer I have been returned to him,
a read request is issued to refill Buffer
I, a check request is issued on Buffer II,
and the DECB pointers are switched.
Phase I I I
DeBDEl

I

V

V

DeBDEl

V

DCBDE2

I

184

DCBDE2

I

I

DCBDE2

I

V

V

DECBl

DECB2

I

V

Buffer I (read,
unchecked)

I

V

Buffer I I (read,
checked, and available for processing)

Buffer II is now the current buffer in
use, and each of the logical records in it
is returned to the user until there are
none left, at which point Buffer II will be
refilled, Buffer I will be checked, and the
DECB pointers will be switched again. Processing continues in this manner until an
end of data set is encountered.
At that
point, the user's EODAD routine gains
control.
III. Double buffering on a readback
data set.
Double buffering on a readback data set
of fixed or undefined length records is
handled in the same manner as that on an
input data set, except that blocks of records are read beginning with the last blOCK
of the data set.
However. if a data set
opened for Rdback specifies variable-format
records, the procedure is var1ed tq include
the use of a third buffer. After a block
of records bas been read and checked. a
copy of i t is moved to the third buffer.
This copy is used as a table to contain
record lengths so that the records contained in the actual buffer may be accessed

Queued Sequential Access Method (QSAM)

ln r.'ver~;Oc' order.
l\ torwdld :;"diCh i~, made
through thl' block tor the length control
nytes (11) in front of ench record, and
these bytes are saved in the blank control
bytes (bb) of the following record. The
length of the last leCOrel in the block is
saved in the DeB in order that the address
uf th,o flIst IPcord to be accessed (logically the Idst Lecord at the block) may be
com~uted.
The follow~ng Jlagrdm demonstrates the layout of the third buffer.

t r Olll t h"t dddn:>ss t.he h~ngt h of
last record in the block, which is
saved in the DCB, the first record
requested by the user is accessed from the
actual buffer. Then the lenqth of the preceding record is obtained from the control
bytes of the current record in the third
huffer, and saved in the OCB so that the
address of the next record may be computed.
By maintaining its own copy of the current
buffer. QSAM can be certain the lengths of
the previous logical records recorded in
the control bytes are always correct.
t.rdct.i nq

th~

DATA

ll,

~DCBSVl

The beginning-of-buffer address for
blocks of records in a readhack data set is
at the logical end of the block. By sub-

section 2:

Issuing I/O Reguests, Checking. and Positioning for Blocks of Data: QSAMs internal
functions are performed entirely within
storage. Any I/O requests for transfer of
data between storage and any I/O device, or
requests for repositioning a data set, are
passed on to BSAM. Table 50 in this section lists the BSAM modules invoked by QSAM
and the expected return codes.

Interface Rules and Module Description

185

before G1scussing the 1nternal logic of
'.ISM<; rout ine in relation to QSAM macro
instructions, i t is necessary to establish
certain rules which will be followed throughout the discuss1on.
tilL'

exit is required, the appropriate flags are
set in the DCB, and a r'eturn is made to tn",
calling subroutine.
Read/Write Subroutine

1.
/,

All fields wi.thin the OCB, when
referenc~~d. have a prefix of DCB.
1\11 fields within the DECD, when

referenced, have a prefix of DEC.
J.

All references to fields withi!l either
table indicate the contents of the
field unless it is specifically stated
otherwise.

!j.

Each at the nine entry subroutines is
referred to by the name of its entry
point. A calling module always enters
QSAM at the entry point itself. For
internal processing, however, a
:c(eferencE: to "returning to CZCSAA"
will indicate the entry subroutine,
not the entry point.•

The Read/Write subroutine has two
entries.' CZCSAD is the ent ry when c: read
request is issued. and CZCSAE is the entry
~hen a ~rite request is issued.
The appropriate type code is set. 1nt_o the DEeB, dnd
linkage is established t_o BSAM Read/Write.
When control is returned to Read/Write, a
return is made to the calling subroutine.
Control Subroutine
The Control (CNTRL) subroutine invokes
the BSAM Control routine.
If the return
code from BSAM Control is not zero, the
SYNAD SUbroutine is invoked. Otherwise, a
return is made to the calling subrout~ine.
Ba~kspace

::"",

cert.ain of the QSAM subroutines
have the same names as BSAM modules,
,. ;uch as Redd/Write or Check,reference
t.o the BSI\M module of that name will
always be clearly marked by referring
to wBSAM Read/Write (CZCRA)- or by
using just the module ID "CZCRA" after
it has been identified with the name
of t.he module.

Certain of the QSAM subroutines perform
the same function each time they are
",ntered, regardless of the type of dat.a
set, device or macro instruction being
H3ed. To simplify the tracing of each
macro instruc'1:,ion, these subroutines are
~riefly described below, and thereafter
referred to only to indicate the specific
points at which they are invoked to perform
their functions.

SYNJ'..D is entered whenever an error in
reading, writing. or positioning has
occurred.
If the user has provided his own
SYNAD routine, a copy of the DECB on which
the error occurred is moved to DECB3, and
control is passed to his SYNAD.
If not, or
upon return from the user's SYNAD, tests
are made to see if the erroneous block may
be accepted or skipped, or if the task must
be abnormally terminated. If no abnormal
186

Subroutine

::.~ince

Part III:

The Backspace subroutine invokes BSAM
BaCKspace. After control is returned to
BaCKspace. a return is made to the calling
subroutine.
Point Subroutine
The Point subroutine invokes BSAM Point.
On return from CZCRM. the SYNAD subroutine
is invoked if the return code regist.er contains a four.
If the return code is zerc,
or upon return from SYNAD, a return is made
to the calling subroutine.
Check Subroutine
The Check subroutine establishes linkage
to BSAM Check (CZCRC).
After control is
passed back from CZCRC, if SYNAD is
requested the SYNAD subroutine is invoked,
and after cont.rol is passed back to Check,
a return is made to the calling subroutine.
If SYNAD is not requested and EODAD is
indicated, control is passed to the user's
EODAD routine, from ~hich no return is
expected. Otherwise, a return is made to
the calling subroutine.
Flush Subroutine
Three cases exist:
1.

If no I/O requests are outstanding, an
exit is ~de to the calling
subroutine.

Queued Sequential AcceSS Method (QSAM)

1 .

2.

3.

When any I/O request is outstanding
and the DECB has been marked intercepted and EODAD has been requested,
then the number of outstanding I/O
requests in the DEB (DEBNCP) is set to
zero, and a return is made to the calling subroutine.

the data set.
Phase 3 will de~cribe the
functions performed for all the .'Ibove macro
instructions when subsequently issued.

If the I/O request which remains outstanding is not complete, an AWAIT SVC
is issued and the completion is
awaited. The Purge flag in the DECB
is then set on, and control is passed
to the Check subroutine.
Upon return
from Check, a return is made to the
calling subroutine.

Phase 1 - Communication: When the user
issues a GET macro instruction, the macro
expansion sets a locate or move mode code
in the DCB, and then establishes type-l
linkage to the QSAM entry point whose V-con
is found in DCBGTV. At the entry pOint,
the user's registers are saved, and base
registers for QSAM are established.
If
CZCSAA is entered, phase 2 is begun by giv:hg control to INITIO.
If CZCSAG is
entered, phase 3 is begun by giving control
to GET.

GET 10 Subroutine
The GETIO subroutine first invokes Read/
Write to perform a read on the DECB pointed
to by DCBDE2, and then invokes CheCK to
check the read done previously on the DECB
pointed to by DeBDE1.
If Check detected an
error in the read operation and the user
indicates it is to be skipped, GETIO
Switches the DECB pointers and goes back to
repeat the reading and checking operations,
until no error is detected. Otherwise,
GETIO invokes the COMIO subroutine to
initialize buffer addresses, and then
returns to the calling subroutine.
PUTIO Subroutine
PUTIO invokes Read/Write to perform a
write on the DECB pointed to by DCBDE2, and
then invokes Check to check the DECB
pointed to by DCBDE1. PUTIO gives control
to COMIO to reinitialize the free buffer,
and then makes a return to the calling
SUbroutine.
PUTXIO Subroutine
IF A PUTX has been issued on the current
block, PUTXIO invokes Read/Write to write
the updated block back to the data set, and
Check to check the completion of the write.
Following this, or if no PUTX was issued on
the block, PUTXIO invokes GETIO to read and
check the next block.
It then returns to
the calling subroutine.
LOGIC OF MACRO SERVICES
The logic of the GET, PUT, and PUTX
macro instructions can be broken down into
three phases. Phase 1 deals with the communication between the problem program and
the body of the QSAM routine.
Phase 2
describes the initialization which is done
only for: the first of these macro
instructions issued on a data set; the
first issued after a SETL type-E or -B has
repositioned the data set; or the first
after FEOV has advanced to a new volume in

GET Macro Processing

phase 2- First GET; Initialization:
INITlO fills in two DECBs, for all data
sets, and places their addresses in the
DCB.
It sets the forward or backward reads
byte in the DECB. and sets the addresses of
the buffers obtained by SAM Open into the
data area pointers of the DECBs. Then the
DCB address and the maximum block size are
set into the DECBs. If single buffering is
being done, the DECB pointers in the DCB
are set equal to each other, and GETIO is
invoked to read and check the first block.
If double buffering is being done, Read/
Write is invoked to read the first block,
and GETIO is then invoked to read the
second and check the read of the first.
Before returning to INITIO, GETIO gives
control to COMIO to initialize buffer
addresses. COMIO calculates the actual
size of the block read in, by subtracting
the residual count in the CSW from the
",aximum block size.
It sets the current
record address in the DCB from the data
area address in the DECB, and then calculates the end-of-buffer address using the
actual block size.
If the record format is
variable, four is added to the record
address to allow for the four system control bytes in front of the block, and the
sum of the lengths of the records is
checked against the block size.
If they
are not equal, ar,j if the user had not
specified an EROPT parameter of ACC in the
DCB, the task abnormally terminates by
executing an ABEND macro instruction.
Otherwise, COMIO returns to GETIO, which
immediately returns to INITIO. Before
returning to CZCSAA. INITIO places the
V-con of CZCSAG in DCBGTV and DCBGTR, in
order that the next GET issued by the user
will enter QSAM at that point.
After INITIO has returned control to
CZCSAA, the Get subroutine is invoked, and
phase 3 is entered.
Section 3:

Internal Logic

187

If process1ng on t.he
bufter is complete, Get invokes
~ither PUTXIO. to write an updated block
Lack to an update data set, and read in the
~.<·:(t
[.lnck, CI it l.nvokes GE:rrc to reflll
co;np],·ted ',llfter.
Arter. the return
± (,,1;'. ".1 til"r P\TTXIe> or GETIO, or. .If proce:,,'.inq no the C'url>"nt Clutter is not yet comI. lett·,
GET cdlc1ilate~; t.he current. record
ddjl~S~. and if the GST macro instruction
was in locate mode, sets the current record
"ddress int.o register 1 in the user' s save
.;rcc;.
1 f t he GET macro instruction wa~; in
~ove mode, the record is moved into the
user's work area.
:;_::._~'C!.i!t~on;

Ql~rent

he record address is incremented,
t
t!lP lengt.h of the current logical reco:co, ~;o as t.O point t.e the end of t: he reconl.
If 1. t 1S wi t.hin the block, an immediate return is made to the entry section.
It it 15 at the end of the block, a flag in
the DeB 1.5 bet on to indicate t.hat. proces:;:,nq on trle current buffer is corr,plet.e, and
the return is made.
If it lies outside the
Dlock, and it the user has not specified an
t.l;:OI"I parameter of Ace in t~he DCB, the task
abnormally terminates by executing an ABEND
macro instruct. ion.
Ot.her1>lise, the return
to the entry section is made.
TtH'n t

Sl.nce processlng on any GET macro
ruct ion is now complete, botil CZCSAA
and CZCSAG issue a RETURN macro instruction, to restore the user's registers, and
link back to the problem program.
1. '1,-; t

.Phase 1 - Corrununication:

When the user

issues·--a""PuT· macro instruction. the macro
eX[MDSion indicates either locate or move
mode in the DCB, and establishes type-l
lin.kaqe to the QSAM entry point whose V-con
:l.s .In DCBPTV. At the entry point, the
user's registers are saved, and base reglsters for QSAM are established.
If CZCSAB
.is enteTed, phase 2 is begun by giving control 1'.0 INITIO.
If CZCSAW is entered,
phase 3 is begun by giving control to PUT.

Phase 2 - First PUT - Initialization:
INITle) builds two DECBs for all output data
S2tS, as described in phase 2 of the GET
Hldcro instruction, except that it sets the
DEeB type code to indicate that only writes
aTe Lo be done.
It then invokes the BSAM
Note routine (CZCRN) to obtain the relative
",oaress .... ithin the volume (TTRZ or ZZCC) of
the last block read or ...,ri tten.
If sing le
buffering is being done, the DECB pointers
111 the DCB are set equal to each other.
If
double buffering is being done, the completion code in the DECB is set to indicate
"complete with no errors·, so that the
first check, which will be done on an
unused DECB, will return normally.
Following this, if the record format is variable,
188

Part III:

tne t ....o length control b\tes at the beginning of the block are initially set to
four, and the current loqical recora
address is set to the beqinning-of-buffer
address, plus four. The end-of-buffer
address is calculat.ed by adding the maximum
block size to the beginning-of-buffer
address.
The V-con elf CZCSAW is placed in DCTPTV
so that the next PUT issued will en' er QSA~j
at that point, and a return is made to
CZCSAB.
From CZCSAB, control is th~n
passed to Put, and phase 3 is entertd.
Pnase 3 - Operation:
If the current block
of records is complete, Put gives control
to PUTIG to write t.he block out and check
the previous write operation.
The record
format is checked, since variable format
records are treated separately from fixed
and undefined. the en~-of-buffer address is
set to the current record address plus the
logical record length. Then, for both
fixed and undefined records, if the pu'r
maCL'O instruction is in locate mode, the
current record address is set into register
1 in the user"s save area.
If the PUT is
in move mode, the record is moved from the
user's work area to the current record
address, and in order to support substi tot;:,
mode exchange buffering. the address of the
user's work area is set into register 1 in
his register save area.
If t.he blOCK is complete, the End of
Buffer flag in the DCB is set on.
If the
block is not yet complete, or after the End
of Buffer flag is set, the logical record
(~unt for the current block is increased by
one, and a return is made to the entry section.
If the record overflowed the buffer,
the t..ask abnormally terminates by executing
an ABEND macro inst.ruct ion.
For variable format records, a check is
first made to see if the last PUT issued
was in locate mode. If so, the length control bytes of the record which was subsequently built in the buffer are checked to
be sure that the record is not larger than
the length previously estimated by the
user.
If it is larger. and if the record
~s too long to fit into the buffer. the
taSK is abnormally terminated.
Following this, or if the last PUT .... as
not in locate mode, if the current record
will not fit into the buffer. PUTIO is
invoked to write out the buffer. check the
previous write, a.nd provide a new buffer
address. After return from PUTIO, or if
the current record will fit into the buffer, the current record address is set into
register 1 of the user's register save area
if the PUT is in locate mode, and a return
is made to the entry section.
If the PUT
is in move mode. the record is moved from

Queued Sequential Access Method (QSAM)

.

J

the user's work area to the current record
address, which is then incremented by the
length of the record.
Since processing on any PUT macro
instruction is then complete, both CZCSAB
and CZCSAQ issue a RETURN macro instruction
to restore the user's registers and return
to the problem program.
PUTX Macro Processing
Phase 1 - Communication: When a PUTX macro
instruction is issued, the macro expansion
establishes type-l linkage to CZCSAX, whose
V-con is in DCBPXV. At the entry point.
the user's registers are saved, and base
registers for QSAM are established. If the
PUTX is an update PUTX, it must have been
preceded by a locate mode GET on the same
data set, and therefore cannot be the first
macro issued. Hence, phase 3 is begun by
giving control to the PUTX subroutine. If
it is an output PUTX. a check is made to
see if it is the first macro issued on the
data set, and if so, phase 2 is begun by
giving control to INITIO. Otherwise, PUTX
is invoked.
Phase 2 - First PUTX - Initialization: The
initialization for the first PUTX on a data
set is accOlIlplished by INITIO in exactly
the same manner as that for the first PUT
on a data set. When initialization is complete, a return is made to CZCSAX, which
then gives control to PUTX.
Phase 3 - Operation: If the data set on
which the PUTX macro instruction was issued
is opened for Output, the associated data
set must be opened for Output, and if it is
the task abnormally terminates by executing
an ABEND macro instruction. The record
which is to be put out must have been
retrieved by a locate-mode GET on the associated data set.
If it was not, the task
is abnormally terminated. Otherwise, a
flag is set in toe output DCB to indicate
that a move-mode PUT is to be performed,
the logical address field of the input DCB
is supplied as the address of the record to
be output, and control is given to the PUT
subroutine (whose operation was discussed
in phase 3 of the PUT macro instruction).
The data set must be opened for Output
and Update, and the last logical record
must have been retrieved by a locate mode
GET; otherwise, abnormal termination
occurs.
A flag is set in the DCB to indicate
that a PUTX has been issued on the current
block.
If processing on the current block
is complete, PUTXIO is inVOked to write the
updated block back to the data set, and to
read in the next block if ca lIed by the GET
subroutine. After the return from PUTXIO,

or if processing on the block was not complete, a return is made to CZCSAX, which
then issues a RETURN macro instruction to
restore the user's registers and link back
to the problem program.
TRUNe Macro Processing
The macro instructions TRUNe and RELSE
require no initialization phase, since they
perform no functions if they are the first
macro instructions issued on a data set.
Therefore, they will be discussed in only
two phases, communication and operation.
Phase - Communication: The expansion of
the TRUNC macro instruction establishes
type-l linkage to CZCSAT. whose V-con is
defined within the expansion. The entry
section saves the userts registers, establishes base registers for QSAM, and gives
control to the TRUNC subroutine.
Phase 2 - Operation: TRUNC makes an immediate return to the entry section under the
follOWing conditions:
1.

If proceSSing on the current block is
already complete, or has not yet
begun:

2.

If the record format is undefined;

3.

If the data set is opened for neither
Output nor Update:

4.

If no GET or PUT has previously been
issued on the data set.

Otherwise, if the data set is opened for
UPDATE, TRUNC sets the End of Buffer flag
in the DCB so that the next GET will retrieve the first logical record of the following block. If the data set is opened for
OUtput, and if the record format is variable, and if the last PUT was in locate
mode, the last logical record is checked to
be certain it does not overflow the buffer.
If it does, the task is abnormally terminated. In all other cases, the actual
block size is calculated, and PUTIO is
invoked to write out the block.
RELSE Macro Processing
Phase 1 - Communication: The expansion of
the RELSE macro instruction establishes
type-1 linkage to CZCSAR, whose V-con is
defined within the expansion.
The entry
section saves the user's registers, establishes base registers for QSAM, and gives
control to the RELSE subroutine.
Phase 2 - Operation: RELSE makes an immediate return to the entry section if processing has not yet beg1ffi on the current
block, or if the aata set is opened for
Output. Otherwise, it sets the End of
Section 3:

Internal Logic

189

iF,", ,,() t h"t th.· r.,,'xt (;1:1'
i l l r- t.-!t.":l t:"ve ·.:-_be :{ i a'. :·-jt
";':i ~ •. :di x"c'c'Jrj of the follo\..ling iJlock.
Tr,,,,;'; ;Un..sE return::; to CZCSAR. which issues
.: ;"'.'

t

;,. ... j"!

i'i>.:;

d~:d~ d

-:-;.po>

\.4'

mdcro instruction 'to restore the
cl';el.'" r,c'gisteLs dnd link back to the prot 1 ;_'~n to' { ':':'.{; .[ iim .
in~T'l1RN

.,

Ti'le C01.UDunicatJ.on phase is the same for
SETI, macro instruct.ions, but
(:,,, ."Je~a.tlor; phases must be discussed
s':,':JGirat.ely.
The expansion of each 5ETL
11IdCIO inst.ruction sets d code in the OCB to
:,(ji.cdte 1.1:.'3 type U:. R, P, E or B), and
t.ablishes type-l linkage to CZCSAS, whose
Ii"COD is found in nCBSLV.
The entry sec!.1.0l1 saves til,,: user's regist(xs and establlstH?s r..ase r€ Gl", x
beyond the current 0,;2 beinq processeci wi u

be the aile marked by CZCRN.
Theret,)t'>i:,
either a backspace or d f or'Wdrd SPdCt' .;1 1:
d lways b~ req\! ired h:, t"I,t t l"'V!' t h.' ,'P d < \: (
block.
The count. at d'cn;d~; j.·lo,"o>:,.,o',1
witni.n the current block (with the ;,:.qh "<
der bit set on to indicat.e t.lia\ d lJackwiLrd
or for.ward space is needed) is rf~t urneCi t,"
the user with the relative address obtdH";.ed
by CZCRN.

',J, t:'frJ"5 of

i~;

~s

done far SETL.
The SETLC

},dE;t:

to check the
or writ.e ~)erformedi a~ld then
cuntc'.)";' to BSAM Note ':CZCRN) to est.athe relative address (TTRZ or ZZCC)
the data set of the last block read

X'(::i~L;:i

'1102,;;
~.:oh

wi 'Lc."

qJ~'i'(,'tC'il"
:-_;.:Lnce t:bat may not be t.he
bloc:( C1l1CrerH:iY being processed. it must be
dete;nYJ.ined whether or not addi t.ional spac1.j'g will be needed.
The dat.a set is repo,·;.ltJ.cned tc, t.hat r'etrieval address.
..:
TtIE' SETl.'<
subrou·tine first invokes TREOV to cledr any
outstanding 1/0 requests.
Then, using the
retrieval address provided by the user as d
parameter. the SETLR subroutine invokes
POINT to reposition the data set to the
block specified by the ret.riaval addres~;.
If a backward or forward space is required
(see SETL type-C for the manr'er in ",hich
this is determined), either Backspace is
invoked to backspace one block, or Contr',d.
is invoked to forward space one block.
Following this, the original open oj:.tLor,
is saved, and if the data s~t is opened for
Out. put , the open option is set to indicate
that. t he block to which tJW data set is now
positioned must be read back in.
INITIO J.S
invoked 1:.0 set up new DECBs and ini'ciat.(' a
read of the desired block.
INITIO ,iliLt
function as it does in phase 2 of the GET
macro instruction, except in the case of an
output data set, when it sets the DECB tYF'
code to -read· and invokes Read/Write to
read in the desired block and GETIO to
check it.
When INITIO returns control to SETLR,
the current record address points to the
first record of the block.
The recox'd
count provided hy the user is then
decreased by one, and if the result is not
zero, the Get subroutine is invoked t~o cal-·
culate the address of the next logical
record.
Again the record count: .is
decreased by one, and GET is invoked 1,f 11:
is not zero.
When the record count j~"<.!>:::he;,;
zero, the current. record address poinT,~~ tc
the desired record.
At this point. Ul<2
original open option is restored, and, if
the data set is opened for Output ,. t.hc DEd"
type code is reset to ·write w •
A return is
made to CZCSAS, which issues a RETURN macro
instruction to restore the user" 5 register,;
and link back to the problem program,
SETL Type-P (Previous Record):
The SETLP
subroutine first checks to see if processing bas begun on the current buffer.
If

Queued Sequential Access Method (QSAM)

so, the previous record must be within the
~urr8nt hlock.
Its address is calculated,
the record count within the block is
decr~a~ed by t, and a return is made to
,~ZCSAS.

If the current buffer is empty, nawever,
previous record lies within the last
clock processed.
In this case, TR£OV is
lnvoked to clear any outstanding I/O
requests. Upon return fron. TREOV, if the
Write Request flag in the DeB is on, an
1wmediate backspace of one block is made.
If the data set is opened for RDBACK, Control is invoked to space forward one block.
If the data set is opened for Input, Check
lS invoked to check the last. read and then
a~ckspace is inVOKed to backspace the data
set three times, since it is positioned at
the end of the third block beyond the one
in which the desired record lies.
If the
data set. is opened for Output, it is positioned at the end of the block containing
the desired record, and BSP is therefore
invoked to backspace one block.
If any
positioning errors occur, SYNAD is invoked.

When the data set is correctly positioned, the Get and Put V-cons in DCBGTV
arid DCBPTV, respectively, are set to CZCSAA
and CZCSAB so that the next GET or PUT on
the data set. Then J
iOL
I

I

i

~2

..

Flowcharts

439

APPENDIX A:

CONTROL BLOCKS USED BY ACCESS METHODS MODULES

CHAADC-Explicit adcon group
used by:
CZCTC-Terrninal Task Control
CHABCT-BULKO~

Table

used by:
CZCQK-VDMEP
CHABPL-Buffer Page List
used by:
CZCMA-GETBUF
CZ CNA- FREEBU F
CZCNB-FREEPOOL
CHADBP-DEB Page
used by:
CZC~- MSAM Open
CZCMD-SETUR
C7.CME-DOMSAM
CZCMG-MSAM Posting and Error Retry
CZCMH-MSAM Finish
C7.CMI-MSAM Close
CHACLQ-CLEARQ
used by:
CZCTC-Terminal Task Control
CHADCB-Data control Block
used by:
CZCLA-Open Common
CZCLB-Close Common
CZCLD-FEOV
CZCMA-GETBUF
CZCMB-GETPOOL
CZC~- MSAM Open
CZCMD-SETUR
CZCME-DOMSAM
CZCMF-MSAM Read/Write
CZCMG-MSAM Posting and Error Retry
CZCMH-MSAM Finish
CZCMI-MSAM Close
CZCNA-FREEBUF
CZCNB-FREEPOOL
CZCOA-OPENVAM
CZCOB-CLOSEVAM
CZCQC-MQVEPAGE
CZCOD-Insert/Delete Page
CZCOE-REQPAGE
CZCOF-Insert
CZCOG-Reclaim
CZCQJ-Find
CZCQK-Stow
CZCOL-Search
CZCOM-Extend POD
CZCON-Relocate Members
CZCOD-GETNUMBR
CZCOP-VSAM Open
CZCOQ-VSAM Close
CZCOR-VSAM Get
CZCOS-VSAM Put
CZCQT-SETL
CZCOU-PUTX
CZCQV-FLUSHBUF
CZCPA-VISAM Put
440

CZCPB-VIST\M Get
CZCPC-SETL
CZCPE-Read/Write
CZCPI-GETPAGE
CZCPL-Add Directory Entry
CZCPZ-VISAM Open
CZCQA-VISAM Close
CZCQE-Search SOOT
CZCQI-Expand RESTBL
CZCQQ-VAM ABEND Interlock Release
CZCRA-BSAM Read/Write
CZCRB-Control
CZCRC-Ch'~ck

CZCRG-Backspace
CZCRM-Point
CZCRN-Note
CZCRP-SAM Posting and Error Retry
CZCSA-QSAM
CZCSB-IOREQ
CZCSC-IOR Open
CZCSD-IOR Close
CZCSE-IOREQ Posting
CZCWA-ASCII Translation and Conversion
CZCWB-Build Common DEB
CZCWC-SAM Close
CZCWD-DAOPEN
CZCWL-Build DA DEB
CZCWO-SAM Open Mainline
CZCWT-Tape Open
CZCWY-Tape Data Set Label
CZCXD-DA Output EOV
CZCXE-Mainline EOV
CZCXI-DA Input EOV
CZCXN-DA Input LABEL
CZCXO-Tape Output EOV
CZCXS-Set OSCB
CZCXT-Tape Input EOV
CZCXU-DA Output Label
CZCXX-Concatenation
CZCYA-TAM Open
CZCYG-TAM Close
CZCYM-TAM Read/Write
CZCZA-TAM Posting
CRADEB-Data Extent Block
used by:
CZCLA-Open Common
CZCLB-Close Common
CZCLD-Force End of Volume
CZCMA-GETBUF
CZCMB-GETPOOL
CZCMC-MSAM Open
CZCMD- SETUR
CZCME-OOMSAM
CZCMF-MSAM Read/Write
CZCMG-MSAM Posting and Error Retry
CZCMH-MSAM Finish
CZCMI-MSAM Close
CZCNA-FREEBUF
CZCNB- FREEPOOL
CZCRA-BSAM Read/Write
CZCRB-Control
CZCRC-Check
CZCRG-Backspace

CZCHM- Pc; 111
CZCRN- Not •.

CZCRP- SAM po::;t! l~g and Error Retry
CZCSl'..-Q5AM

CZCSB-IORW
CZCSC- lOR 0p'n
CZCSD- lOR <:1(,,(2
CZCSE-IOREQ POJt1n~
CZ(,WB- Bu i Id C,~mm<)il DEb
CZCWC--SAM Closp
CZCWlJ--DNJPEN
CZC .... L-Rui 1<1 ill'.. LH:S

CZCWM-Messdqe Writer
CZCWO-SAl'l Open Mai oline
CZCWP-Tape Positloning
('ZOm-Read Format -3 DSeE
CZCWT-Tape Open
CZCW¥-Tape Data Set Label
CZCXD-DA Output EOV
CZCXE-Mainli.ne EOV
CZCXI-DA Input EOV
CZCXN-DA Input Ldbel
CZCXS-Set DSCB
CZCXT-Tape Input EOV
CZCXU-DA Output Label
CZCXX-Concatenation
CZCYl>.-TAM Open
CZCYG-TAM Close
CZCYM-TAM Read/Write
CZCZA-TAM Posting
CHADEC-Data Lvent Control Block
used by:
CZCMC-M!-~A}", Open

CZCOM-Extend POD
CZCON-Relocate Members
CZC()fJ-GE'i'NUMBR
CZCOP-VSI',M Open
CZCOQ-VSl1.M Close
CZCOR-VSAM Get
CZCOS-V'3 bu"'i Put
cz C."CT- SETL
CZCOl'- PUTX
CZ CO V- fLUSHBUF
CZCII\-VJSAM Put
cz ...:r B- VI SAM Get
CZC::::C-SETL
CZCPE-Read/Write
eZCPI-GETPAGE
CZCPL-Add Directory Entry
CZCPZ-VISAM Open
CZCQA-VISAM Close
CZCQI-Expand RESTBL
CZC'.:1K-VDMEP
CZCQQ-VAM ABEND Interlock Release
CHAUse-DSCE Format-l & -3
used by:
CZCWD-DAOPEN
CZCWL-Build DA DEB
CZCWO-SAM Open Mainline
C2.CWR-Read Format-3 OSCB
CZCXD-DA Output EOV
CZCXI-DA Input EOV
CZCXS-Set OSCB
eHADSV--DSCB Format-A

CZCME-DO~..sAM

CZCOA-OP~AM

CZCMF-M.SAM

CZCOB-CLOSEVAM

Read/Wr'ite

Posting and Error Retry
CZCNH-MSAM Finish
CZC~J-MSAM Close

&

-B

used by:

CZC~-MSAM

CZCPE-Read/Write

CZCRA-BSAM Read/Write
CZCRB-Control
CZCRC-ChpcK.
CZCRP-SAM Posting and Error Retry
CZCSA-QSAM

CHAEPE-RESTBL External Page Entry
used by:
czeOC-ZVIOVEPAGE
CZCOE-REQPAGE
CZCOF-Insert
CZCCX:;-Reclaim
CZCOO-GETNUMBR

C':-'.CSB-IOR.F:V
f~ZCSD- IOH Clo.:3e
CZCSE--IOkEQ Posting
CZCWC-SAM Close

CHAFNQ- FINDQ

CZCWO-SAi"; Open Mr'1inline
CZCW¥-Tapp Data Set Label
CZCXE-Mainline EOV
CZCXS- Sd D~~CB
C ,;CYG-TAr-~ Close

CHAFRQ-FREEQ
used by:
CZCTC-Terminal Task Control

C2C:YM-TNr

Re-"\d/Writ_E'

CZCZA-T~M

Posting

used by:
CZCTC-Terminal Task Control

CHADdD-DCB Header
used by ~
CZCLB-Close Common
ClCOA-OPENVAM
CZCOB-CI,oSEVAM
CZCOC-MOVEPAGE
CZCOD-Insert/Delete Page
C2COE-REQPAGE
CZCOF-Insert
elCO(;-Heclaim
CZCOJ-Find
CZCOK--Stow
CZCOL-Search
Appendix A:

CHAGSM-General Services Macro Table
used by;
CZCLA-Open Common
CZCLB-('lose Cornman
CHAICB-Interruption Control Block
used by:
CZCMC-MSAM Open
CZCMD- SETUR
CZCMG-MSAM Posting and Error Retry
CZCMI-MSAM Close
CHAIOR-I/O Request Control Block
used by:
CZCMC-t-'BAM Open
CZCMD-SETUR
CZCMF-MSAM R~~d/Write
Control Blocks Used by Access Methods Modules

441

CZCMG-MSAM Posting and Error Retry
C2CMH-MSAM Finish
C2CRA-BSAM Read/Write
CZCRB-Control
CZCRP-:-SAM Posting and E:t"ror Retry
CZCSB- IOREQ
C2CSE-IOREQ Posting
CZCYM-TAM Read/Write
CZCZA-TAM Posting
CHAISA-Interruption storage Area
used by:
CZCEI-VMIER
CZCLA-Open Common
CZCtJ'.A-GETBUF
CZCMG-GETPOOL
C2CMD-SETUR
CZCME-OOMSAM
CZCMF-MSAM Read/Write
CZCMG-MSAM Posting and Error Retry
CZCMH-MSAM Finish
CZCNA-FREEBUF
CZCNB-FREEPOOL
CZCPA-VISAM Put
CZCPB-VISAMGet
C2CPC-SETL
CZCQE-Search SDST
CZCQK-VDMEP
CZCQQ-VAM ABEND Interlock Release
C2CRP-SAM Posting and Error Retry
CZCSA-QSAM
CZCSB- IOREQ
CZCSE-IOREQ Posting
CZCWD-DAOPEN
CZCWO-SAM open/Mainline
CZCWT-Tape Open
CZCWY-Tape Data Set Label
CZCXE-Mainline EOV
C2CXN-DA Input Label
C2CYG-TAM Close
CZCZA-TAIvi Posting
CHALBt-Data Set Header/Trailer Labell
used by:
C2CWM-Message Writer
CZCWY-Tape Data Set Label
CHALB2-Data Set Header/Trailer Label 2
used oy:
CZCWY-Tape Data Set Label
CHAMHD-RESTBL Member Header
used by:
C2COA-OPENVAM
C2COB-CLOSEVAM
CZCOC-MOVEPAGE
CZCOE-REQPAGE
CZCOJ-Fina
CZCOK-St.ow
CZCON-Relocate Members
CZCOO-GETNUMBR
CZCQI-Expand RESTBL
CZCQK-VDMEP
CZCQQ-VAM ABEND Interlock Release
CHAPOD-Partitioned Organization Directory
used by:
C2COJ-Find
CZCOK-Stow
CZCOL-Search

442

CZCOH-Extend POD
CZCON-Relocate Members
CZCOO-GETNUMBR
CHAPOE-Directory Alias Descriptor
used by:
CZCQJ-Find
C2COK-Stow
CZCOL-Search
CHAPOM-DirectOl"y Member Descri ptor
used by:
CZCOJ-Find
czeOK-Stow
CZCOL-Search
CZCON- Rf!locate Members
CZCOO-GJ,;TNUMBR
CHAPVT-Public/Private Volume Table
used by:
CZCEI-VMIER
CHARDQ- READQ
used by:
CZCTC-Terrninal Task Control
CHARHD-RESTBL Header
used by:
CZCOA-OPENVAM
CZCOB-CLOSEVAM
CZCOC-MOVEPAGE
CZCOD-Insert/Delete Page
CZCOE-REQPAGE
CZCOF-Insert
CZCOG-Reclaim
CZCOJ-Find
CZCOK-Stow
CZCOM-Extend POD
CZCON-Relocate Members
CZCOO-GETNUMBR
CZCOP-OPENSEQ
CZCOQ-CLOSESEQ
CZCOR-VSAM Get
CZCOS-VSAM Put
CZCOT-SETL
CZCOU-PUTX
CZCPA-VISAM Put
CZCPB-VISAM GET
CZCPC-SETL
CZCPE-Read/Write
CZCPI-GETPAGE
CZCPL-Add Directory Entry
CZCPZ-VISAM Open
CZCQA-VISAM Close
CZCQI-Expand RESTBL
CZCQK-VDMEP
CZCQQ-VAM ABEND Interlock Release
CHASAR-System Activity and Resource Table
used by:
CZCTC-Terrninal Task Control
CHASCB-SAM Communication Block
used by:
CZCWB-Build Common DEB
CZCWC-SAM Close
CZCWD-DAOPEN
CZCWL-Build DA DEB
CZCWM-Message Writer
CZCWO-SAM Open Mainline

CZCWP-Tape Positioning
CZCWR-Read Format-3 DSCB
CZC..JT-Tape Open
CZCWV-Volume Sequence Convert
CZCWY-Tape Data Set Lab€l
CZCXD-DA output EOV
CZCXE-Mainline EOV
CZCXI-DA Input EOV
CZCXN-DA Input Label
CZCXO-Tape Output EOV
CZCXS-Set DSCB
CZCXT-Tape Input EOV
CZCXU-DA Output Label
CZCXX-Concatenation
CHASDA-Symbolic Device Allocation
used by:
CZCEI-VMlER
CZCMC-MSAM Open
CZCMD-SETUR
CZCMG-MSAM Posting and Error Retry
CZCMl-MSAM Close
CZCQK-VDMEP
CZCRA-BSAM Read/Write
CZCRB-Control
CZCRC-ChecK
CZCRG- Backspace
CZCRP-SAM Posting
CZCSC-IOR Open
CZCWB-Build Common DEB
CZCWC-SAM Close
CZCWD-DAOPEN
CZCWL-Build DA DEB
CZCWM-Message Writer
CZCWP-Tape Positioning
CZCW¥-Tape Data Set Label
CZCXS-Set DSCB
CZCYA-TAM Open
CZCYG-TAM Close
CZCYM-TAM Read/Write
CZCZA-TAM Posting
CHASDE-Shared Data Set Entry
used by:
CZCOA-OPENVAM
CZCOB-CLOSEVAM
CZCQE-Search SDST
CZCQK-VDMEP
CZCQQ-VAM ABEND Interlock Release

CHASDT-I/O Statistical Data Table
used by:
CZCMG--MSAM Posting and Error Retry
CZCRP--SAM Posting and Error Retry
CHATCM-Task Common Table
used by"
CZCE.I -'IMLER
CZCQK- VDMEP
CZCTC-Terminal Task Control
CrlATCT-Terminal Control Table
used by:
CZCTC-Terminal Task Control
CHATDT-Task Data Definition Table
used by:
CZCEI-VMlER
CZCLA-Open Common
CZCLB-Close Common
C2CMC- MSAM Open
CZCMI-MSAM Close
CZCOA-OPENVAM
CZCOB-CLOSEVAM
CZCOE-REQPAGE
CZCQE-Search SDST
CZCQI-Expand RESTBL
CZCQK-VDMEP
CZCQQ-VAM ABEND Interlock Release
CZCSC-IOR Open
CZCWB-Build Common DEB
CZCWC-SAM Close
CZCWD-DAOPEN
CZCWI.-Build DA DEB
CZCWM-Message Writer
CZCWO-SAM Open Mainline
CZCWP-Tape Positioning
CZCWT-Ta pe Open
CZCWY-Tape Data Set Label
CZCXD-DA Output EOV
CZCXE-Mainline EOV
CZCXI-DA Input EOV
CZCXG-Tape Output EOV
CZCXS-Set DSCB
CZCXT-Tape Input EOV
CZCXX-Concatenation
CZCVA-TAM Open
CZCYG-TAM Close

CHASET-BULKIO S-Entry Table
used by:
CZCQI<-VDMEP

CHATOS-Terminal Access Operational status
Table
used by:
CZCYM-TAM ReadIWrite
CZCZA-TAM Posting

CHASDM-Shared Data Set Member
used by:
CZCOA-OPENVAM
CZCOB-CLOSEVAM
CZCQE-Search SDST
CZCQK-VDMEP
CZCQQ-VAM ABEND Interlock Release

CHAVPS-Virtual Program Status Word
used by:
CZCMA-GETBUF
CZCMB-GETPOOL
CZCNA-FREEBUF
CZCNB-FREEPOOL
CZCRA-BSAM Read/Write

CHASDS-Shared Data Set Table
used by:
CZCOA-OPENVAM
CZCOB-CLOSEVAM
CZCQE-Search SDST
CZCQK-VDMEP
CZCQQ-VAM ABEND Interlock Release

CHAW RQ-WRI TEQ
used by:
CZCTC-Terminal Task Control

Appendix A:

QWKAR-QSAM Work Area
used by:
CZCSA-QSAM
Control Blocks Used by Access Methods Modules

q43

APPENDIX B:

MODULES CALLED BY ACCESS METHODS MODULES

l'iOdule
CEAAC-ADDEV

Access Methods Modules That
Call this Module:
CZCYA - TAM Open
CZCYG - TAM Close

CEAAD-RMDEV

CZCYA - TMti Open
CZCYG - TAM Close

CEAAH-Reset

CZCMD
CZCMF
CZCMH
CZCRP
CZCSE
CZCZA

-

SETUR
MSAM Read/Write
MSAM Finish
SAM Posting
lOREQ Posting
TAM Posting

CEAAK-SETAE

CZCRA - DA Error Retry
CZCYG - TAM Close

CEAAQ-LlO
CALL

CZCMF
CZCRA
CZCRB
CZCRP
CZCSB
CZCYM
CZCZA

-

MSAM Read/Write
BSAM Read/Write
Control
SAM Posting
lOREQ
TAM Read/wt:ite
TAM Posting

CEAHQ-LSCHP/
TSEND

CZCOC
CZCOD
CZCOH
CZCOI
CZCOJ
CZCOK

-

MOVEPAGE
Insert/Delete Page
Interlock
Release Int~rlock
Find
Stow

CEAH3-XTRCT

CZCRH - DA Error Retry
CZCYG - TAM Close

CEAH7-SETXP

CZCOC - MOVEPAGE

CEAIS-SYSER

CZCMF - MSAM Read/Write
CZCMG - MSAM Posting and
Error Retry
CZCRP - SAM Posting
CZCYG - TAM Close
CZCZA - TAM Posting

CEAP4-LVPSW

CZCRA - BSAM Read/Write

CEAP7-AWAIT

CZCMI
CZCRA
CZCRB
CZCRC
CZCSD
CZCWC
CZCWO
CZCXE

-

MSAM Close
BSAM Read/Write
Control
Check
lOR Close
SAM Close
SAM Open Mainline
Mainline EOV

CEAP9-TSEND

CZCYM - TAM Read/Write

CEAQ4-CKCLS

CZCMA
CZCMC
CZCNB
CZCOI

444

-

GETBUF
MSAM Open
BSAM Read/Write
Release Interlock

Module

Access Methods Modules That
Call this Module
CZCOR - VSAM Get
CZCSB - IOREQ
CZCSC - lOR Open
CZCYM - TAM Read/Write

CEARO-TWAIT

CZCRC - Check

CEAA1- PGOU'l'

CZCOB - CLOSEVAM

CZAAB-Gate

CZCWM - Message Writer

CZABQ-WTO

CZCMD - SETUR
CZCMG - MSAM Posting and
Error Retry
CZCMH - MSAM Finish
CZCRH - DA Error Retry
CZCWM - Message writer
CZCYA - TAM Open
CZCYG - TAM Close
CZCZA - TAM Posting

CZACP-ABEND

CZCOA
CZCOB
CZCOC
CZCOD
CZCOE
CZCOJ
CZCOK
CZCOM
CZCOO
CZCOP
CZCOR
CZCOS
CZCOT
CZCOO
CZCPA
CZCPB
CZCPC
CZCPE
CZCPI
CZCPL
CZCPZ
CZCQE
DZCYA
CZCYG
CZCYM

CZAEBFINDJFCB

CZCLA - Open Common

CZCAB-Bump

CZCXD
CZCXI
CZCXO
CZCXT
CZCXX
CZCWD
CZCWT

CZCAP-ABEND

CZCRP - SAM Posting

-

-

OPENVAM
CLOSEVAM
MOVEPAGE
Insert/Delete Page
REQPAGE
Find
Stow
Extend POD
GETNUMBR
VSAM Open
VSAM Get
VSAM Put
SETL
PUTX
VISAM Put
VISAM Get
SETL
Read/Write
GETPAGE
Add Directory Entry
VISAM Open
Search SDST
TAM Open
TAM Close
TAM Read/write

DA Output EOV
DA Input EOV
DA Input Label
Tape Input EOV
Concatenation
DAOPEN
Tape open

Module
CZCEG-GIVBKS

Access Methods Modules That
Call this Module
CZCWC - SAM Close

C:lCEV-GIVBKV

ChCOE - CLt)SEVAM

C2CEK-Extend

CZCOE - REQPAGE
CZeXD - DA Output EOV

CZCF0-0btain/ CZCWD CZCWR Retain
CZCXD CZCXI CZCXN CZCXS ezcxu CZCOA CZCOB -

DAOPEN
Read Forut.lt- 3 OSCB
DA Output EOV
DA Input EOV
DA Input Label
Set oseB
DA. Output Label
OPENVAM
CLOSEVAM

CZCGA-VMA

Open eOllU\lOn
Close Conmon
GETBUF
MSAM Open
MSAM Close
VMA
DA Error Retry
FREEPOOL
OPENVAM
CLOSl,VAM
MQVEPAGE
OPENSEQ
Read/Write
Add Directory Entry
VISAM Open
Extend POD
Expand RESTBL
lOR Open
lOR Close
Build Common DEB
SAM Close
DAOPEN
Build DA DEB
SAM Open Mainline
Read Format-3 OSCB
Tape Open
Mainline EOV
TAM Open
TAM Close

C2CJD-DIF

CZCLA
CZCLB
czeMA
CZCMC
CZCMI
CZCGA
CZCRH
CZCNB
CZCOA
CZCOB
CZCOC
CZCOP
CZCPE
CZCPL
CZCPZ
CZCOM
eZCQI
czcse
czeSD
eZCWB
CZCWC
CZCWD
CZCWL
CZCWO
CZCWR
CZCWT
CZCXE
CZCYA
CZCYG

-

CZCMD - SETUR
CZCMF - MSAM Read/Write
CZCMG - MSAM Posting and
Error Retry
CZCMH - MSAM Finish
CZCMI - MSAM Close
CZCRP - SAM Posting
CZCSD - lOR Close

CZCJI-INTINQ

CZCMI - .M.SAM Close
CZCRP - SAM Posting

CZCJ 1.- LVPRV

CZCWD
CZCWO
CZCWT
CZCWY
CZCXN
CZCXU
CZCYA

-

DAOP.EN
SAM Open Mainline
Tape Open
Tape Data Set Label
DA Input Label
DA Output Label
TAM Open
Appendix B:

Module
CZCJS-SIR

Access Methods Modules That
call this Module
CZCMD - SETUR
CZCMG - MSAM Posting and
Error Retry
CZCMH - MSAM Finish
CZCRH - DA Error Retry
CZCRP - SAM Posting

CZCJ'I'-QLE

CZCRH - DA Error Retry
CZCRP - SAM Posting

CZCLA-Common
Open

CZCMD - SETUR
CZCXX - Concatenation

CZCLB-Coromon
Close

CZCMD - SETUR
CZCXX - Concatenation

CZCMA-GE~BUF

CZCZA - GETBUF

CZCMC-MSAM
Open

CZCLA - Open Common

CZCMF-MSAM
Read/Write

CZCME-DOMSAM

CZCMH-MSAM
.Finish

CZCMI - MSAM Close

CZCMI-MSAM
Close

CZCLB - Close Common

C:ZCOA-VAM
Open

CZCLA - Open Common

CZCOB-VAM
Close

CZCLB - Close Common

CZCOCMOVE PAGE

CZCOA
CZCOB
CZCOR
CZOOS
CZCOT
CZCOV
CZCPI
CZCQA

-

CZCOD-Insert/ CZCOS Delete Page CZCOV CZCPI CZCPL -

OPENVAM
CLOSEVAM
VSAM Get
VSAM Put
SETL
FLUSHBUF
GETPAGE
VISAM Close
VSAM Put
FLUSHBUF
GETPAGE
Add Directory Entry

CZCOE-REQPAGE CZCOA - OPENVAM
CZooC - MOVEPAGE
CZCOF - Insert
CZCOF-Insert

CZCOD - Insert/Delete Page
CZCOM - Extend POD
CZCOO - GETNUMBR

CZCOG-Reclaim CZooD - Insert/Delete Page
CZCOK - Stow
CZCOO - GETNUMBR
CZCOHInterlock

CZCOA
CZCOC
CZooD
CZCOJ

-

OPENVAM
MOVEPAGE
Insert/Delete page
Find

Modules Called by Access Methods Modules

445

f'lJOdule
-----

Access Methods Modules That
Ca 11 this Module
CZCOK - Stow
CZCOO - GETNUMBR
CZCQE - Search SDST

CZCOl-Release C'lCOA CZCOC Interlock
CZCOD CZCOJ CZCOM CZCOO CZCQE CZCQQ -

OPENVAM
MOVEPAGE
Insert/Delete Page
Find
Extend POD
GETNUMBR
Search SDST
VAM ABEND Interlock
Release

Module
CZCPBVISAM Get

Access Methods Modules That
Call this Module
CZCPC
SETL

CZCPC-SETL

CZCOJ - Find
CZCPE - Read/Write; DELREC

CZCPE-Read/
Write;
DELREC

CZCMD - SETUR
CZCPA - VISAl'i Put
CZCPI - GETPAGE

CZCPI-GETPAGE CZCPA
CZCPB
CZCPC
CZCPE

-

VISAM Put
VISAM Get
SETL
Read/Write; DELREC

C'lCOJ-Find

CZCMD - SETUR
CZCOB - CLOSEVAM

CZCPZVISAM Open

CZCOK-Stow

CZCOJ - r'ind
CZCV() - VAM ABEND Interlock
Release

CZCQACZCOR - CLOSEVAM
VI SAM Close CZCOK - Stow

CZCOL-Search

CZCOJ - Find
CZCOK - Stow
CZCOO - GETNUMBR

CZCQECZCOA Search SDST CZCOB CZCOK CZCQQ -

CZCOM-Extend
POD

CZCOK

CZCONRelocate
Members

CZCOM - Extend POD
CZCOO - GETNUMBR

CZCOOGETNUMBR

CZCOC - MOVEPAGE
CZCOD - Insert/Delete Page

CZCOPVSAM Open

CZCOA - OPENVAM
CZCOJ - Find

CZCOQVSAM Close

CZCOB - CLOSE.VAM
CZCOK - Stow

CZCORVSAM Get

CZCOP - VSAM Open

czcos-

CZCOP - VSAM Open
CZCOQ - VSAM Close
CZCOT - VSAM SETL

CZCRC-Check

CZCYA - TAM Open
CZCYG - TAM Close
CZCSA - QSAM

CZCOT-SETL

CZCOJ - Find
CZCOP - VSAM Open

CZCRGBackspace

CZCSA - QSAM

CZCOU-PUTX

CZCOP - VSAM Open

CZCRP - SAM Posting
CZCRH-DA
Error Retry

CZCOVFLUSHBUF

CZCOQ
CZCOR
CZCOS
CZCOT
CZCOU

-

VSAM Close
VSAM Get
VSAM Put
SETL
PUTX

CZCPA
CZCLB
CZCPC
CZCPE
CZCPI
CZCQA

-

VISAM Put
VI SAM Get
SETL
Read/Write; DELREC
GETPAGE
VISAM close

VSAM Put

CZCPAVISAM Put

446

-

CZCOA - OPENVAM
CZCOJ - Find

OPENVAM
CLOSEVAM
Stow
VAM ABEND Interlock
Release

STOW
CZCQF-JFCBVUD CZCOB - CLOSEVAM
CZCOE - REQPAGE

-

CZCQI
Expand
RESTBL

CZCOA
CZCOC
CZCOE
CZCOJ

CZCRA-SAM
Read/Write

CZCRC-Check
CZCSA-QSAM
CZCWY-Tape Data Set Label
czcxs-Set DSCB

CZCRB-Control CZCRC
CZCSA
CZCWY
CZCXS

-

-

OPENVAM
MOVEPAGE
REQPAGE
Find

Check
QSAM
Tape Data Set ~bel
Set DSCB

CZCRM-Point

CZCWL - Build DA DEB
CZCSA - QSAM

CZCRN-Note

CZCSA - QSAM

CZCRQ-FINDR

CZCRG - Backspace

CZCRR-RELFUL

CZCRM - Point

CZCRS-FULREL

CZCRN - Note
CZCXS - Set DSCB

l-lodule.
CZCRX-VMER

CZCRY-VM5DR

Access Methods Modules That
Call this Module
CZCMG - MSAM Posting and
Error Retry
CZCRP - SAM Posting
CZCZA - TAM Postinq

Modul.§:

czcwv-

Volume
~)equence

Convert

-

MSAM Posting and
Error Retrl
CZCRP - SAM Postinq
CZCZA - TAM Postinq
CZCMG

-

Force End of Volume

CZCSA-QSAl'J
FEOV

CZCLD

CZCSC-IOR
Open

CZCLA - Open Common

CZCSD-IOR
Close

CZCLB - Close COllllton
CZCXI - DA Input EOV

CZCTJ-Prompt

CZCWY - Tape Data Set Label
CZCXI - DA Input EOV

CZCWB-Build
Common DEB

CZCWL
CZCWO
CZCWT
CZCXE
CZCXO
CZCXT

-

Access Methods Modules That
Call this Module
czcwc - SAM Close
CZCWO
SAM Open Mainline
CZCWY
Tiipe Data Set Wbel
CZCXD - DA Ollt put EOV
CZCXE - Mdinllnt' l':OV
C'1,('X I

DA Input EOV

CZCXO - Tape Output EOV
CZCXT
Tape Input EOV
CZCXD-DA

CZCXE - Mainline EOV

Output. EOV

Build DA DEB
SA¥ Open Mainline
Tape Open
Mainline EOV
Tape Output EOV
Tape Input EOV

CZCXE-SAM
Mainlin('
EOV

CZCLD - Force End of Volume
CZCRC - Check
CZCWC - SAM C los e

CZCXI-DA

CZCXE - Mainline EOV

Input. EOV

CZCXN-DA
CZCWD - DAOPEN
Input. Label
CZCXO-TAPE
output. EOV

CZCXE - Mainline EOV

CZCXS-Set
DseB

CZCWC - SAM Close
CZCXD - DA Output EOV
CZCXI - DA Input EOV

CZCXT-Tape
Input EOV

CZCXE - Mainline EOV

CZCWC-SAM
Close

CZCLB - Close Common

CZCWD-DAOPEN

CZCWO

CZCWL-Build
DA DEB

CZCWD - DAOPEN
CZCXD - DA Output EOV
CZCXI - DA Input EOV

CZCXU-DA
Output
Label

CZCWD - DAOPEN
CZCXD - DA Output EOV

CZCWMMessage
Writer

CZCWP
CZCXD
CZCXN
CZCXX

CZCXXConcatenation

CZCXE - Mainline EOV
CZCXI - DA Input BOV
CZCXT - Tape Input EOV

CZCLA - Open Common

CZCYA-TAM
Open

CZCLA - Open Common

CZCwo-SAM
Open

CZCYG-TAM
Close

CZCLB - Close Common

CZCYM-TAM
Write

CZCYA - TAM Open
CZCYG - TAM Close
CZCZA - TAM Posting

SVC-REDTIM

CZCMD - SETUR

SYSKA1-TIME

CZCWY - Tape Data Set Label

SAM Open Mainline

-

Tape Positioning
DA output EOV
DA Input Label
Cbncatenation

CZCWP-Tape
CZCWC - SAM Close
Positioning
CZCWR-Read
Format-3
OSCB

CZCWD - DAOPEN
CZCWX - DA Output EOV

CZCWT-Open
Tape

CZCWO - SAM Open Mainline

Appendix B:

Modules called by Access Methods Modules

441

APPENDIX C:

ACCESS METHODS MODULE DIRECTORY

This appendix provides an alphabetic listing of the various modules that are used in the
Access Methods.
Also provided are the CSECT, PSECT, entry points and chart ID of each
module.
r--------T-------------------------------~----------~---------T----------T-----------,

I
I

Module
10

I
I

Module Name

I
I

CSECT

I
I

PSECT

I
I

Entry
Points

I
i

Chart 10

I
I

t---------t--------------------------------+----------+----------t----------t-----------~

i
I
I
I
I
I

I

CZCEI
CZCEY
CZCEZ

I
I
I
I
I
I

CZCFT

I

CZCLA

I
I
I
I
I
I
I
I
I
I
I
I
I
I

I

VMIER

OUPOPEN
DUPCLOSE
DELVAM

I

OPEN COMMON

I
I
I
I
I

I

CZCLB
CZCLD
CZCMA

CZCMB

CZCMC
CZCMD

CZCME
CZCMF
CZCM:;
CZCMH

I

I
I
i
I
I
I
I
I
I
I
I
I
I
I

~

448

CZCEIC
CZCEYC
CZCEZC
CZCFTC

I

CLOSE COMMON
FORCED END OF VOLUME
GEl' A BUFFER

GET A BUFFER POOL

MSAM OPEN
SET UNIT RECORD

OOMSAM
!o5AM READ/wRITE
!o5AM POSTING AND ERROR RETRY

MSAM FINISH

MSAM CLOSE
FREE A BUFFER

FREE A BUFFER POOL

I
I
I
I
I
I
I
I
I

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

CZCLBB
CZCLDC
CZCMAC

CZCMBB

CZCMCC
CZCMDC

CZCMEC
CZCMFC
CZCMGC
CZCMHC

CZCMIC
CZCMBB

I

CZCNBA

i
I
I
I

CZCOAC

I

OPEN VAM
CLOSE VAM

I
I
I

I
I
I
I
I
I

I

CZCEIP

CZCEn
CZCEZP
CZCFTP

I
I
I
I
I
I

I

CZCEIl

CZCEYl
CZCEZl
CZCFTl

I
I
I
I
i
I

I

JB
MB

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

CZCLAB
CZCLBP
CZCLDB
CZCMAB

CZCMBP

CZCMCP
CZCMDP

CZCMFP
CZCMGP
CZCMHP

CZCMIP
CZCMBP

I

CZCNBB

I
I
I

CZCOAP

I
I

CZCOBC

I
I

I

CZCOBP

I
I
I
I
i
I
I
I
I
I
I
I
I
I
I

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

CZCLAO
CZCLBC
CZCLDF
CZCMAG
SYSMAG
CZCMAB
CZCMBG
SYSMBG
CZCMBP
CZCMCl
CZCMDl
CZCMD2
CZCMD3
CZCMEl
CZCME2
CZCKFl
CZCMGl
CZCMG2
CZCMHl
CZCMH2
CZCMH3
CZCMIl
CZCNAF
SYSNAF
CZCNAP

I
I

CZCNBC
SYSNBC
CZCNBB

I
I
I

CZCOAl

I
I

I

CZCOBl

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
t
I
I
I
I

I
I
I
,

MF

!

KF

I

M

I
I
I
i

!

I i i
CZCLAC

J

j

I
I
CZCMI
I
I
CZCNA
I
I
I
I
CZCNB
I
I
I
I
CZCOA
I
I
CZCOB
I
I
LI ________
CZCOC
I

I
i
I
I
I
I

I

DA
FA
BB

BA

AI
AJ

BB
BC
CC
DC

DD

BC

I

HD

I
I
I

MA

I
I
I
I
I

ME

I

_______________________________
~ __________
J
..,VEPAGE
CACOCC ~ _________
CZCOCP ~ __________
CZCOCl ~ __________
JA

r---------T---------------------------·-----T----------T----------T----------T-----------

I
i

Module I
ID
I

Module Name

I
I

CSECT

I
I

PSECT

I
I

Entry
Points

I
I

Chart ID

t---------f---------------------------·-----f----------+---------+----------+-----------CZCOD
CZCOE
CZCOF
czeOG
eZCOH
eZCOI
CZCOJ
CZCOK

CZCOL
CZeOM
CZCON
CZCOO
CZCOP
ezcOQ
CZCOR
CZCOS
CZCOT
CZCOU
CZCOV
CZCPA
CZCPB
CZCPC

INSERT PAGE
DELETE PAGE

CZCOOC

CZCODP

CZCODl
CZCOD2

KA

REQUEST PAGE

CZCOEC

CZCOEP

CZCOEl

KD

INSERT

CZCOFC

CZCOFP

CZeOFl

KB

RECLAIM

ezcocc

czeOGP

CZCOGl

KE

INTERLOCK

CZCOHC

CZeOHP

CZCOHl

LA

RELEASE INTERLOC"

CZCOIC

CZCOIP

CZCOIl

LB

FIND

CZCOJC

CZCOJP

CZCOJl

PA

I

STOW

CZCOKC

CZCOKP

CZCOKl

PB

!
I
I
I
I
I
i
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I,

SEARCH

CZCOLC

None

CZCOLl
CZCOL2

PC

EXTEND POD

eZCOMe

CZeOM"£'

CZeOMl

PO

RELOCATE MEMBERS

eZCONC

None

CZCONl

PE

GETPAGE NUMBER

CZCOOC

CZCOOP

CZCOOl

PF

OPEN SEQUENTIAL

CZCOPC

czeopp

CZCOPl

Me

CLOSE SEQUENTIAL

ezeOQC

ezcoQP

CZCOQl

Me

VSAM GET

CZCORC

None

CZCORl

NA

VSAM PUT

CZCOSC

None

CZCOSl
CZCOS2

NB

SET LOCATION

CZCOTC

None

CZCOTl

NC

PUT EXCHANGE

CZCOUC

None

CZCOUI

ND

FLUSH BUFFER(S)

CZCOVC

CZCOVP

CZCOVl

NE

VISAM PUT

CZCPAC

None

CZCPAl
CZCPA2

OA

VISAM GET

CZCPBC

None

CZCPBl

OB

SET LOCATION

CZCPCC

None

CZCPCl
CZCPC2

OC

READ/wRlTE
DELETE-RECORD

CZCPEC

CZCPEP

CZCPEI
CZCPHl

OD

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

I

I
I
I
I
I
I

CZCPE

!
I

I
I

CZCPIC
CZCPIP
OE
CZCPIl,
I GETPAGE
CZCPI2,
i END SEQUEm'IAL
CZCPI3 ,
I RELEASE EXCLUSIVE
CZCPD1,
I
CZCPGl
I
I
CZCPL I ADD DIRECTORY ENTRY
CZCPLC
CZCPLP
OF
CZCPLl
I
CZCPZC
CZCPZP
CZCPZ
CZCPZl
MD
I VISAM OPEN
I
CZCQA I VIS AM CLOSE
CZCQAC
CZCQAP
CZCQAl
MH
I
CZCQE LSEARCH SDST
CZCQEC LCZCQEP
CZCQEl iI_ _ _ _ _ _
.10
L-________
-LI __________
_____ I __________
_ _ _ _ _ J!
I ______________________________
I ____
CZCPI

~

Appendix C:

Access Methc,ds Module Directory

449

r---------T--------------------------------T----------T----------T----------T-----------,
I Module I
I
I
I Entry
t
t
I

10
I
Module Name
I CSECT
I PSECT
I Points I Chart 1D !
r---------t--------------------------------f----------t----------t----------+-----------~
I CZCQI I EXPAND HESTRL
I CZCQEC I CZCQEP I CZCVF.l 1
KC
I
I
I
I
I
I
I
I
I CZCQKC I CZCQKP I CZCVKl I
.h'
I
! CZCQK I VDMEP
!
I
I
I
I CZCVK 2 I
I
I
I
I
i CZCVKJ 1
I
CZCQQ
CZCRA

CZCRB
CZCRC
CZCRG
CZCRa
CZCRM
CZCRN
CZCRP
CZCRQ

I
I
!
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
,
I

BSAM READ/WRITE

TAPE CONTROL
CHECK I/O
BACKSPACE
DA ERROR RETRY
LOGICALLY REPOSITION TAPE OR
DA DATA SET
NOTE ID OF LAST RECORD READ
OR WRITTEN

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
f

CZCQEC
CZCRAC

CZCRBC
CZCRCC
CZCRGC
CZCRHC
CZCRMC
CZCRNS

I
I
I
I
I
I
I
I
I
I
I
I
I
t
I
I
I
I
I
I
I
I
I
I
I

I
I
SAM POSTING AND ERROR RETRY
I CZCRPC
I
I
FIND RECORDS PER TRACK
t
I
I
RELFUL
' I
I
I
I
I
FULREL
I
I
I
I
I
I
GET (The first GET following al
I
SETL type E or B, the first
I
I
GET following a FEOV, or the I
I
first GET on a data set.)
I
I
I
I
PUT (Entered for the Same PUT I
I
macro instruction as GET
I
I
above. )
I
I

CZCQEP
CZCRAP

CZCRBP
CZCRCP
CZCRGP
CZCRHP
CZCRMP
CZCRNP
CZCRPR

I
I CZCQQl
I
I CZCRES,
I CZCRAS,
I CZCRDS
I
I CZCRBS
I
I CZCRCS
I
I CZCRGA
I
I CZCRHl
I
I CZCRMA
1
I
I CZCRNA
I SYSRNA
I
I CZCRPl
I CZCRP2
I
I CZCRQA

I
I
I
1
I
I
I
I
I
I
I
t
I
I
I
I

Ml
SA

GD
CF
GC
CB
GB

f

I
1
I
1
I
1
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

GA
CA

I
I
!
I
I
!
I
I
I
I
I
I
1
I
I
I
I
I
I
I
I
I
I
I

10

I
.\
I CZCRRA
IE
I
I SYSRRA
I
I
CZCRS I
I CZCRSA
IF
I
I SYSRSA
I
I
CZCSA I
I CZCSAA
QA
I
I
I
I
I
I
I
I
I
t CZCSAB
I
I
I
,
I
1
I
I
I
I GET (All tnose not covered
I
I
I CZCSAG I
I above. )
I
I
I
I
I
I
I
I
I
I
I
I CZCSAW I
I PUT
I
I
I
I
I
1 SETLB, E
I
I
I CZCSAH 1
I
I
I
I
I
I SETLR
I
I
I CZCSAL 1
I
1
I
I
I
, COMIO
I
1
I CZCSAM I
I
I
I
I
I
I SETLP
I
I
I CZCSAQ 1
I
I
1
I
I
1 SETL
I
1
I CZCSAS I
I
I
I
I
I
SAM CLOSE or FEOV
I __________ I __________ I __________
CZCSAV I ___________ JI
IL _________ LI _______________________________
CZCRR

I
I

VA!" ABEND INTERLOCK R:":LEASE

~

450

~

~

~

r---------T--------------------------------T----------y----------T----------T-----------,

I
i

Module I
ID
I

I
I

Module Name

CSECT

I
I

PSECT

i
I

Entry
Points

I
I

Chart ID I

~---------+------------------~-------------t----------t----------+----------+-----------~

!

CZCSA

I
I

I

I
I

CZCSB
CZCSC
CZCSD
CZCSE
CZCTC

I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

I

I
I
I

CZCWB
CZCWC

I
I
I
I
I
I

CZCWD

I
I
I
I
I
I
I
I

I

I

I

I
I
CZCWT I
I
CZCWV I
lI _________
CZCWR

INITIO
GET
PUT
TREOV
IOREQ
lOR OPEN
lOR CLOSE
IOREQ POSTING

MTT COMMAND

I

CZCWP

RELSE

TERMINAL TASK CONTROL

CZCWA

CZCWO

TRUNC

I

I

CZCWM

PUTX

I
I
I
I
I
I
I
I
I

CZCWL

SETLC

I !
I

I

CZCSAZ

I

i
!

CZCSl\2

I

I

I

C'ZCSA.3

I
I
I

I
I
I

I
!
I

I
I
I
I
I
I
I
I
I
I
I
I
t
I
I
I

I
t

I
!
I
I

READQ MACRO
WRITEQ MACRO
CLEARQ MACRO
FREEQ MACRO
ASCII TRANSLATION AND
CONVERSION

CZCSBC

CZCSBP

CZCSCC

DAOPEN
BUILD OR EXTEND DA DEB
MESSAGE AND ABEND PROCESSING

I
I
I
I
I
I

I
I

I

I
I
I
I
I
I
I
BE

CZCSCP

CZCSDC

CZCSDP

CZCSDl

DF

CZCSEC

CZCSER

CZCSEl

CE

CZCTCC

CZCTCP

CZCTCl

RA

CZCTCl
CZCTC2
CZCTC3
CZCTC~

CZCTC6

,.

QA

CZCSBl
CZCSB2
CZCSCl

CZCTC5

I
I

TAPE POSITIONING

CZCSA9

I

SAM CLOSE

SAfoil OPEN l'1AINLINE

CZCSA8

I
I
I

I
I
I
I
I
I

BUILD OR MODIFY COMMON
PORTION OF A DEB

CZCSA6
CZCSA7

I
I
I
I
I
I
I

FINDQ MACRO

CZCSALI

I
I

CZCWAC

CZCWAP

AL

I
:
!

I
I
I

CZCWAl

I

CZCWBC

CZCWBP

CZCWBl

CZC~CC

CZCWCP

CZCWCl
CZCWDP

I
I

CZCWDP

CZCWLC

CZCWLP

CZCWLl

CZCWMC

CZCWMP

CZCWMl

CZCWOC

CZCWOP

CZCWOl

CZCWPC

I

CZCWPP

CZCWPl

.

i
/

I

I

I
I
I
I
I
I

CZCWDC

;

I
I
I
I
I

I
I
I
I
I
I

I

I

GE
AE

DB
AD
AF

IC
AB
IA

I

I CZCWRC
CZCRWP
CZCRWP I
AG
I
I
OPEN TAPE
I CZCWTC
CZCWTP
CZCWTl I
AC
I
I
VOLUME
SEQUENCE CONVERT
CZCWVC iI _ _________
CZCWVP li __________
CZCWVl LI ___________
IB
_____________________________
iI __________
J
READ FORMAT-3 DSCBs

~_~

Appendix C:

Access Methods Module Directory

451

r---------T--------------------- -----------T----------T--------- -T-- -- --- ---T-- ---- --. -- -1

I
I

Module I
I
I
lEnt ry
I
I
ID
I
Module Name
I CSECT
I PSECT
I Points I Chart ID I
~------+_----------------------------+--------+_---------+--------+----------1
I czcwx I TAPE VOLUME LABEL PROCESSOR
I CZCWXC I cZCWXP I CZCWXl I
EA
I
I
I
I
I
I CZCWX2 I
\
I
I
I
I
I CZCWX3 I
I

I
!

cZCWY

CZCXD
CZCXE
CZCXI
CZCXN
CZCXO
CZCXS
CZCXT
CZCXU
CZCXX
CZCYA

I
I
I
I
I
I
I
I
I
I
I
I

I
I
I
I
I
I

I
I
I
I
I
I

I
i
I
I
I

I

TAPE DATA SET LABEL PROCESSOR I

DA OUTPUT EOV
MAINLINE EOV
DA INPUT EOV
DA INPUT lABEL PROCEBSOR
TAPE OUTPUT EOV
SET DSCB
TAPE INPUT EOV
DA OUTPUT LABEL PROCESSOR
CONCATENATION PROCESSOR
TAM OPEN

I
I
I
I
I
I
I
I
I
I

I
I
I
I
I
I

I
I
I
I
I
I

I

I

CZCWYC

CZCXDC
CZCXEC
CZCXIC
CZCXNC
CZCXOC
CZCXSC
CZCXTC
CZCXUC
CZCXXC
CZCYA

I

t

I
I
I
I
I
I
I
I
I
I

I
I
I
I
I
I

I
I
I
I
I

I

I

cZCWYP

CZCXDP
CZCXEP
CZCXIP
CZCXNP
CZCXOP
CZCXSP
CZCXTP
CZCXUP
CZCXXP
CZCYAP

I
I
I
I
I
I
I
I
I
I
I
I

I
I
I
I
I

I

I
I
I
I
I
I

I

I

I

~

~

CZCWYl
CZCWY2
CZCWY3
CZCWY 4
CZCXDl
CZCXEl
CZCXIl
CZCXNl
CZCXOl
CZCXSl
CZCXTl
CZCXUl
CZCXXl
CZCYAl

I
I
I
I
I
I
I
I
i
I
I
I

I
I
I
I
I
I

I
I
I
I
I

I

I

EB

I
I
I

FF
FB
FE
EG
FD
AH
FC
EH
FG
AK

I

, CZCYG
I CZCYGP I CZCYGl I
DE
I
I
I
I
CZCYM
TAM REAOI'WRITE
I CZCYM
I CZCYMP I CZCYMl I
BD
I
I
I
I
I
Il _________
CZCZA LI ___________________________
TAM POSTING
I __________
CZCZA
I __________
CZCZAP I _________
CZCZAl L
I - -___CD_____ JI
-L
CZCYG

452

TAM CLOSE

~

APPENDIX 0:
QWKAR
QWKLEN
QWKBKL
QWKFRL
QWKS14
QWKS15
QWKSVO
QWKSVl
QWKSV2
QWKSV3
\iWKSV4
QWKSV5
QWKSV6
QWKSV7
QWKSV8
QWKSV9
QWKS10
QWKSll
QWKS12
QWKS13
QWl4, /64

czeMl1
CZeMI

(1'\::;"",1 ~'lni"h)

hll,:l1l4

clm;!,)
71, ~H9
eZCNA (FREEBUF)
90,320
eZCNB (FREEPOOL)
90,327
ezeOA (OPENVAM)
132.3bl~
CZCOB (CLOSEVAM)
139,369
ezeoc (MOVEPAGE)
98,336
CZCOD (Insert/Delete Page) 119,351
CZCOE (Request External Pages)
122,354
CZCOF (Insert)
120,352
eZCOG (Reclaim)
123,355
czeOH (Interlock)
129,359
eZCOI (Release Interlock)
130,360
CZCOJ (Find)
165,400
czeOK (Stow)
168,404
CZeOL (Search)
171,412
czeOM (Extend POD)
172,413
CZCON (Relocate Members)
172,414
CZCOO (GETNUMBR) 173,415
CZCOP (VAM Open)
137,367
CZCOQ eVAM Close) 142,375
CZCOR (VSAM GET)
144,379
CZCOS (VSAM PUT) 147,381
CZCOT (VSAk SETL)
148,383
CZCOU (PUTX)
150,385
CZCOV (FLUSHBUF)
150,386
CZCPA (VISAM PUT) 155,387
CZCPB (VISAM GET) 157,390
CZCPC (VISAM SETL)
157,392
CZCPE (Read/Write Delete Record)
159,394
CZCPI (GETPAGE) 160,396
CZCPL (Add Directory Entry) 162,398
CZCPZ (VISAM Open)
138,368
CZCQA (VISAM Close) 142,376
CZCQE (Search SDST)
112,348
CZCQI (Expand RESTBL) 121,353
CZCQK (VAM Data Management Error
Processing)
104,343
CZCQQ (VAM ABEND Interlock
Release) 142,377
CZCRA (BSAM Read/Write)
28,223
CZCRB (Control)
28,223
CZCRC (Check)
86,320
CZCRG (Backspace)
85.319
CZCRH (DA Error Recovery)
50,257
CZCRM (Point) 84,318
CZCRN (Note)
83,317
CZCRP (Posting, BSJ\.M) 46,245
CZCRQ (FINDR)
94,333
CZCRR (RELFUL)
95,334
CZCRS (FULREL)
95,335
CZCSA (QS~)
179,417
CZCSB (IOREQ)
41,244
CZCSC (I/O Request, Open)
26,222
CZCSD (I/O Request, Close) 73,292
CZCSE (Posting, IOREQ)
65,277
CZCTC (Terminal Task Control)
195,433
CZCWA (ASCII Translation and
Conversion)
86,321
CZCWB (Build Common DEB)
17,210
CZCWC (SAM Close) 68,282
CZCWD (DA Open. BSM!)
17,208
(M~;AM

Index

457

CZCWL
CZCWM
CZCWO
CZCWP
CZCWR
CZCWT
CZCWV
CZCWX
CZCWY
CZCXD
CZCXE
CZCXI
CZCXN
CZCXO
CZCXS
c~CAT

CZCXU
CZCXX
CZCYA
CZCYG
CZCYM
CZCZA

(Build DA DEB) 18,211
(Message Writer)
93,332
(SAM Open)
15,202
(Tape Positioning)
91,328
(Read Format- 1 DSCBs)
19,212
(TAPE OPEN)
16,206
(Volume Sequence Convert)
92,331
(Tape Volume Label) 74,294
(Tape Data set Label) 74,298
(DA Output EOV)
82,31~
(Mainline EOV)
79,310
(DA Input EOV)
82,313
(DA Input Label Processor) 18,307
(Tape Output EOV)
81,312
(Set DSCB)
19,213
(Tape Input ~OV)
80,311
(DA Output Label Processor) 78,308
(Concate"'lation Processor) 8:J,316
(TAM Open)
24,221
(TAM Close) 72,291
(TAM Read/Write)
35,242
(TAM Posting) 60,275

DA Error Recovery routine (CZCRH)
50
chart 257
contingent processing 51-54
general processing 50
DA Input EOV routine (CZCXI) 52
chart 313
DA Input Label Processor .routine
(CZCXN)
78
chart
307
DA Open routine (CZCWD) 17
chart
208
DA Output EOV routine (CZCXD> 82
chart 314
DA output Label Processor routine (CZCXU) 78
chart 308
DA Read/Write (see BSAM Read/Write)
27
DAIN (DA Input EOV) routine (CZCXI)
82
chart 313
DAOV (DA output EOV) routine (CZCXD) 82
chart 314
data check
MSAM

printer 56
reader. punch 57
2311. 2314. 2302 51
2400 tape 49
Data control Block
primary/secondary 136
QSAM 178
SAM, TAM, COREQ 5
VAM 109
VIS AM 152
VSAM 145
data convertec check 49
Data Event Control Block
check (interceptions)
66
IO~EQ
42
MSAM 11.3~
QSAM 178
queue (IOR~Q)
42
SAM 28
VISAM 152
Data Extent Block
building of
458

common 17
DA 18
SAM 15
tdpe 16
DA siz~ algor~Lhm 18
modify 18
page and workpage layout 20
processing 18
QSAM 178
SAM 6
data group E9-71,8
data movement from buffer 42-45
Data Set Control Block
Read Format-) DSCB 19
SAM processing 19
S.i::T USCB 19
VAM 118
data set labels 74-79
data set maintenance 119-126
data set page release 125
data set sharing 127-131,102.112-117
DCB (see Data Control Block)
DCB header 112
chaining of 135
interlock summary 143
DCB macro. control block building 3
DCBD macro. control block building 3
DCBRCX 22-24.70-71
DCBSUR 22-24
DEB (see Data Extent Block)
deblocking logical records 183
DECB (see Data EVent control Block)
DECB queue 4J.
delete e~ernal paqe entries 123
delete member or alias descriptor 168
delete VAM data set 124
delete VISAM J.ecord (CZ,CPE) 159
chart 394
DELPAGE (Insert/Delete Page) routine
(CZCOD) 119
chaI:t 351
DELVAM (Delete a VAM Data set) routine
(CZCFT) 124
chart 356
device end 61
DFTRMENT macro. control block building 3
DILBL (DA Input Label Processor) routine
(CZCXN) 78
directory
chango VISAM 162
VAM

115

VISAM 1':.'3
VPAM 't~
directory page assj.qnment 132
disallie 39
disconnect. k'I'T terminal 197
DOLBL (DA Ou(~f'ut. lAt.el Processor) routine
(CZCXU) 78
chart 308
DOMSAM routine (CZCME)
30
chart 227
GET processing 30
PUT processing 32
error recording 33
unit check, exception 31
double hufterinq 183-185
DSCB (see Data Set Control Block)
DUPCLOSE routine (CZCEZ) 141

chart 374
duplexing 103
DUPOPEN routine (CZCEY)
chart 366
dynamic buffering 62

format-E DSCB 118
format-F DSCB 118
FREEBUF routine (CZCNA)
90
chart
326
FREE pour. Tout.ine (CZC"lB)
90

136

chart

edit phase 44
enable 39
end of block 63
end of data set 149
end of file
(EOF)
72
end of line 63
end of transmission 63
end of volume processors 79-83
Check 66
SAM overview B
enter table 108
EOV (see end of volume)
EPE '10
equipment check
DA 52
2400 tape 48
MSAM printer 58
reader, punch 57
error retry and recovery
BSAM 4,47
IOREQ 65
MSAM 33,34,54-59
Posting 46-67
TAM 60-65
VAM 103-107
ESETL 160
Event Control Block (see DECB)
Expand RESTBL EXPRES routine (CZCQI)
chart 353
Extend POD routine (CZCOM)
164
chart 413
External Page Entry 110
EXTPOD (Extend POD) routine (CZCOM)
chart 413

chart

.\)')

general services macro table (CHAGSM)
14
GET 187
Get Member Page Number routine (CZCOO)
17 J
chart 415
GET routine (CZCORJ
144
chart.

179

GET routine (CZCPB)
chart.

QSAt-l

157

379

GET/PUT
BSAt-, rna cros

3

187-189

GETBUF routine (CZCl".AJ
chart~

89

325

GETIO 187
GETNUMBR (Get Member Page Number routine
(CZCOO)
173
chart.

415

GETPAGE routine (CZCPI)
chart.

121

172

107

FEOV 191
FEOV (Force EOV) routine (CZCLD)
79
chart 309
tile protect 54
find records per track 94
Find routine (CZCOJ)
105
Chart 400
PINDO macro processor 196
FINDR routine (CZCRQ)
94
chart 333
Finish (CZCMH)
69
chart 284
fixed-length records
VSAM 137
VSAM GET 147
Flush 186
FLUSHBUF routine (CZCOV)
150
chart 386
Force End-of-Volume routine (CZCLD)
79
chart 309'
form type F 58
format, VAM volume '18

160

396

GETPOOL (CZCMB) routine
chart 324

Fence Sitter
QSAM 179
VA.l'1

327

Jo'Ri':EQ rnacre, processor 197
F1JL.REL rout in.' (CZC'RS)
q~,

87

hardware failure 47
hashing table 165
header labels 75,76
I/O completion 7
I/O interrupt 46
I/O request
buffering 12
chaining rules 44
Check used with 13
close 13
Close routine 73
edi t. phase 44
introduction 3
macro 26,12
Open routine 23
overview 12
posting overview 12
posting routine 65
I/O request control block (lORCB)
chaining 9
SAM general 7
use in posting
46-67
I/O statistical data table 7
I/O Supervisor
BSAM 46
MSAM 34
IOR£Q 12
inboard failure 60
incorrect length
DA 52
MSA"~ printer, reader, punch
60
2400 tape 50
inhibit 39
input/output request control block (see
Index

459

J{)CCbJ

Page (INSDEL) routine

DS0r~/Delete

U:zeOD)

119

:~hdl:"t

351
fc(,\!tine

ICZCOF)

,-'':"",lTol check
56
,oHLine (CZCOH)
129
]59
.";tlm.mary (DHD)
143

lc:). fa,,:.,"
,nh',]ock
il,H t
il,(e,];:,cl\.

c()nL.l:ol !:.dble

POD

120

128

164

t'edd

127

aftel: ABEND 143
page level 160

I.cole",;,;€:
.clp~se

",q;ite
127
l ,,If;:'lXoption stora,)e area
l.)",t-e.l:v,~nt

108

ion required

D.il,
~i2
!lSi\N

p"Llnter

S8

redder, punch 56
.<:4iIO tape
48-49
.iNTIK (Interlock) rout;im' (ClCOH)
chm:t
359
-'"m Cj;;,:'k Ioutin,:, (CZCSD) '13
Chi.iiit

292

,tt'Jr.). ()'p~i)

i>_t)ut,l.l~:e:

,hi> i:"t
(",'.00::-

};)hl~':)

,: l,,-'!,:

1/0

:r 10

:n)'.ltHH'

crh±."i ,to

26

:n::quest control block)
1: equest)
(CZCSS)
41

:~ J.j. i,~

~,n:\lpt iOlI

i I.Il

.• fl G

(CZeSCi

222

2LUhJ:l:\
UHr~,,)

Storagp Al ea}

126
"i~.f' Control Block
i. 1 (,z, of
6
If",l';1,.2
12

108

£0Ie~se

(~JFCB)

6-13

8

f 172
chart 414
RELSE (QSAM)
189
Request External Pages (REQPAGE) routine
(CZCOE)
122
chart 354
Resident Terminal Access Method
introduction 3
overview 10
Index

q61

terminal task control 195
RESTBL 110-112
building the 135
VPAM 164-165
RESTBL header 110,112
retrieval address 149
retry and error recovery
(see also - Posting)
VAM
103-107
return data to external storage 150
rewrite a logical record 150
kLINTLK (Release Interlock) routine
(CZCOH
130-131
chart 360
RTAM (See Resident Terminal Access Method)
SAM Close routine (CZCWC) 68
chart 282
SAlti communication block (CHASCB)
8
initialization 15
SAM Open Mainline (CZCWO) 15
chart 202
SAM Posting and Error Retry routine
(CZCRP)
46
chart 245
device dependent error procedure 47
general 47-48
non-normal completion 47
normal completion 47
2400 Tape 48
SCB (SAM communication block)
8,15
SDAT (Symbolic Device Allocation Table)
SDSE (Shared Data Set Entry)
115
SDST (Shared Data Set Table)
112
SOT (I/O Statistical Data Table)
7
search code 171
SEARCH routine (CZCOL)
171
chart 412
Search Shared Data Set Table routine
(CZCQE)
112
chart 348
search ty~e (M, E, or A)
171
SEEK Check 52
Set OSCB routine (CZCXS)
19
chart 213
Set Unit Record routine (see SETUR)
SETL 190
SETL routine (CZCOT)
148
chart 383
SL~L routine (CZCPC)
157
chart 392
SL~UR (Set Unit Record) routine (CZCND)
asynchronous interruption 24
card punch 22
chart 216
printer 22
synchronous interruption 22
ues
22
SETXP SVC (in Movepage)
101
SHARE command (VAM sharing) 129
shared data set entry 116
shared data set table 112-117
Sharing 127-129,101-102
PERMIT command 129
SuST

112

SHARE command 129
Single phase message 94
462

6

21

SPER routine (:Jet' :;AM Postinq d'1ci Error
Retry)
SRCHSOST (Search SOST) routine (CZCQE)
112
chart 348
START I/O failure
MSAl-l

55

IORhQ 66
statistical data table 7
STOW routine (ClCOK)
168
chal.t 40Q
types 169
symbolic device allocation table
SYNAO subroutine 186
SYSUeS, SYSURS 9,22

6

TAIEOV (Tape Input EOV) routine (CZCXT)
80
. chart
311
TAM (see Terminal Access 1.'1ethod>
TAN Close routine (C?CYG)
72
chart 291
TAM Open routine (C~CYA)
2Q
chart 221
TAM Posting routine (CZCZA)
60
chart 275
TAM Read/Write routine (CZCYM)
35
chart 242
type option 36
TAOEOV (Tape Olltput roV) routine
(CZCXO)
81
chart 312
Tape Data Set Label routine (CZCWY) 74
chart 298
Tape Input EOV routine (CZeXT)
80
chart 311
TapE Open routine (CZCWT)
16
chart 206
Tape Output EOV routine (CZCXO)
81
chart 312
tape positioning calculation 91-92
Ta~e POSitioning routine (CZCWP)
91-92
chart 328
Tape Read/Write 29
Tape Volume Label rout:ne (CZCwX)
74
chart 294
task data definition table 108-109
TCIT 

(CZCWX)
chart

Volume Laoel)

roul11l(~

74
294

22,35,58
UCS (universal character set)
(see also SETUR routine)
undefined operation 61
undefined records
137
VSAM GET 146
unit check
MSAM 58,59
2311, 2314, 2302
52
2400 Tape 48
unit exception
DA 51
flag 64
MSFu'1 57 / 59
2400 Tape 50
unit record configuration 21
unit record device (see MSAM)
(see also SETUR)
unit type table 37,40
universal character set 22,35,58
unrecoverable error 58-59
unusual command sequence 57
user routine 83-87
user SYNAD
(BSAM Posting)
48
UTT (unit type table)
37,40
Vfu~

(see Virtual Access Method)
VAM ABEND Interlock Release routine
(CZCQQ)

142

chart 377
V&'1 close module interaction 133
VAM control block relationship 108
VAM Data Management Error Processing
routine (CZCQK)
104
cilart 343
Vfu~ facilities
103
VAM interfaces 107
V}\Yl introduction 99
VAYl open processing 132-138
VA,\{ volume format
11B
VNili\BIR ('lAM ABEND Interlock Release)
routine (CZCQQ}
142
chart 377
variable length records
VSAM 137
VSAM GET
147
VCCW list 42,44-45
VDMEP (VAM Data Management Error
Processing) routine (CZCQK)
104
chart 343
VOMER macro use 105
Virtual Access Method
close processing 139-142
introduction 99-117
open processing 132-139
overview 99
virtual data set organization 99
Virtual Indexed Sequential Access Method

keys

on/off

1 r.)l
t-l.l"t'

l,lc,It,,!·,;

m~.lL"t·OS

p.:llje [unnal!;

1~)J

1',\

1~) ..~

1',4

Virtual Memory ltlj!llt Error Recllvery routine
(CZCEI)

102

chart 340
Virtual Partitioned Access Method
control blocks 164
macros
164
overview 164,102
routines, general
164
Virtual Sequential Access Method
macros
144
overview
102
record formats
144
routines 144
VISAM (see Virtual Indexed Sequential
Access Method)
VISAM Close routine 142
chart 376
VISAM interlock overview 127
VISA.."1 Open rout_ine
138
chart 368
VISAM record relationship 155
VMER (see System Service Routines,
GY28-2018)
VMIER (Virtual Memory Input Error Recovery)
routine (CZCEI)
102
chart 340
VOLCVT (Volume Sequence Convert) routine
(CZClfIV)
92
chart 331
volume format 118
Volume Sequence Convert routine (CZCWV)
92
chart 331
VPAM (see Virtual Partitioned Access
Method)
VPAM interlock overview 127
VSAl-i (see Virtual Sequential Access
Method)
VSAM Close routine 142
chart 375
VSAM Open routine 137
chart 367
VSAM interlock overview 127
write (see Read/Write)
write into application TCT slot
write replace by key 159
replace by retrieval address
WRITEQ macro processor 197
zero CCW

50-54

40

2702
control unit
Close 72-73
2741

159

56

1050 37,40,62
1052-7 73
2302, 2311, 2314
2400 tape 48-50
2701

197

40

37,62

Index

4£3

International Busineaa Mechines Corporation
Data Procesaing Division
U33 Westcheater Avenue, White Pleina, Naw York 10604
!U.S.A onlyJ
IBM World Trade Corporetian
821 United Nations Plaza, New York, New York 10017
ilnternatianelj



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.4
Linearized                      : No
XMP Toolkit                     : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:56:37
Producer                        : Adobe Acrobat 9.13 Paper Capture Plug-in
Modify Date                     : 2009:09:08 16:50:09-07:00
Create Date                     : 2004:03:10 11:45:48-06:00
Metadata Date                   : 2009:09:08 16:50:09-07:00
Creator Tool                    : HardCopy
Format                          : application/pdf
Title                           : Scanned Document
Document ID                     : uuid:e4526394-8625-447c-8d4e-78b903343a6e
Instance ID                     : uuid:8cfb3800-23b3-4b9c-8296-0dd690b418cb
Page Count                      : 235
Creator                         : HardCopy
EXIF Metadata provided by EXIF.tools

Navigation menu