IBM System 360 Programmers Guide

Download as pdf or txt
Download as pdf or txt
You are on page 1of 137

File No.

S360-20
Form C28- 6550- 2 OS

Systems Reference Library

IBM System/360 Operating System


System Programmer's Guide

This publication describes:

• How to maintain the data set cataloging facility of


the Operating System and the volume-table-of-
contents (VTOC) of a direct-access volume.

• How to modify or extend capabilities of the Operat-


ing System in the areas of job and job-step
accounting~ processing of magnetic tape labels, and
SVC routines.

• How to implement the data set protection feature of


the Operating System.

• How to write a shift initiator program for use when


the multiprogramming with a fixed number of tasks
(MFT) option is incorporated in the Operating
System.

• How to use the EXCP (Execute a Channel Program) and


XDAP (Execute a Direct-Access Program) macro-
instructions, the Resident Access-Method and BLDL
Table options, and the tracing routine.

Also included are descriptions of system macro-


instructions used in modifying the control program.
PREFACE

This publication consists of self-


contained chapters, each of which provides
information on how to modify or extend the
capabilities of the IBM System/360
Operating System control program. Although
the information in one chapter is sometimes
related to information in another, all
chapters have been written as separate and
complete units. Each chapter contains its
own introductory section and list of pre-
requisite publications. This organization
has been used to reduce cross-referencing
and to facilitate the addition of new
chapters.

Third Edition (March 1967)

This publication is a revision of Forms C28-6550-0 and C28-6550-1 and


obsoletes the previous editions. This publication retains the content
of the previous editions, as amended by Technical Newsletters N28-2145,
N28-2157, N28-2162, N28-2183, N28-2188, and N28-2207, with the following
exceptions:
The format and field description of the Data Set Control Blocks, the
Data Extent Block, and the Job File Control Block are dele-ted.
The chapter Cataloged Procedures is deleted.

Additions and changes to existing material that are effective as of


this edition, are indicated by a vertical bar in the left margin.
Specifications contained herein are subject to change from time to
time. Any such change will be reported in subsequent revisions or
Technical Newsletters.

This publication was prepared for production using an IBM computer to


update the text and to control the page and line format. Page
impressions for photo-offset printing were obtained from an IBM 1403
Printer using a special print chain.
copies of this and other IBM publications can be obtained through IBM
Branch Offices.
A form for readers' conunents appears at the back of this publication.
It may be mailed directly to IBM. Address any additional conunents
concerning this publication to the IBM Corporation, Progranuning Systems
Publications, Department D58, PO Box 390, Poughkeepsie, N. Y. 12602

~ International Business Machines corporation 1966, 1967


CONTENTS

MAINTAINING THE CATALOG AND THE VOLUME TABLE OF CONTENTS. 9

Maintaining the Catalog and the Volume Table of contents. • • 10


How to Read a Block From the Catalog • • • • • • • 10
Specifying the Name of an Index Level or Data Set • • . •• 10
Specifying the Name of a Generation Data Set • • • • • 11
Specifying a Name Using an Alias. • · • . 12
Specifying by TTR • • • • • • • • • 12
How to Build an Index. • • • • • • 13
How to Build a Generation Index. • 13
How to Delete an Index • • • . 14
How to Assign an Alias • • • • • • . 14
How to Delete an Alias • • • • . • . 15
How to Connect Control Volumes • • • • • • . 15
How to Disconnect Control Volumes. • 16
How to Catalog a Data Set. • • • • • • 17
How to Remove Data Set References From the Catalog • • • • 17
How to Recatalog a Data Set • • · 18
How to Read a Data Set Control Block From the Volume Table of
Contents. • • • • • • • • 18
How to Delete a Data Set · 19
How to Rename a Data Set • • • • • • 20

Appendix A: Catalog Block Entries. • • • • • • • • • • 25


Control Entries • • • • • • • • 25
Pointer Entries • • • • • • • • • • • • • • 26
The Volume Control Block Contents • • • • • • • 28

Appendix B: Device Code Designations ~ • 29


ADDING SVC ROUTINES TO THE CONTROL PROGRAM. • • • 31
Writing SVC Routines. • • • . • • • • . • • 32
Characteristics of SVC Routines • • • • . • 32
Programming conventions for SVc'Routines. • • 32

Inserting SVC Routines Into the Control Progra_ • . • • • • • 37


Specifying SVC Routines • • • • • • • . • • • . . 37
Inserting SVC Routines During the System Generation Process • • 37

ADDING AN ACCOUNTING ROUTINE TO THE CONTROL PROGRAM. • •• 39

Writing an Accounting Routine • • 40


Inserting an Accounting Routine Into the Control Program. • • . 41
Inserting an Accounting Routine Before System Generation.. 41
Inserting an Accounting Routine After System Generation • • • • 41

NONSTANDARD LABEL PROCESSING ROUTINES; VOLUME LABEL AND


DUAL-DENSITY TAPE DEVICE EDITOR ROUTINES • . • 43

Section 1: Writing Nonstandard Label Processing Routines • • • 44


Input Header Label Routines • 44
Input Trailer Label Routine • • • 44
Output Header Label Routines. 44
Output Trailer Label Routines • • 45
programming Conventions • • • 45
Program Functions . • • • • • 46
Explanations of Logic Blocks. • 52
Inserting Nonstandard Label Routines Into the Control Program • • 53
Section 2: Volume Label and Dual-Density Tape Device Editor
Routines • • • 55

Programming Conventions • • • • 55

Entry Conditions and General Logic Flow of the Editor Routines. • • • 56


Entry Conditions • • • • • • • • • • • • . • • 56
General Logic Flow • • • • • • • • 58

Logic Block Explanations. • • • • 61

Inserting Your Label Editor Routines Into the Control Program • . • . 63

Appendix: IECDSECT,IEFJFCBN, and IEFUCBOB Macro-Instructions • · • • 65


IECDSECT Macro-Instruction • • • • • • • . • • • • · • . 65
Control Statements Required • • • • • · 65
IECDSECT Macro-Definition • • • • • . · . • • • . 65
IEFUCBOB Macro-Instruction • . • • • • • • 70
Control Statements Required • • . • . • • • 70
IEFUCBOB Macro-Definition • • •• • . • • . • • • • 70
IEFJFCBN Macro-Instruction . . • . . • • · • • 71
Control statements Required • . • • • • • • 72
IEFJFCBN Macro-Definition • . • • • • • • • • • • 72

EXECUTE CHANNEL PROGRAM (EXCP) MACRO-INSTRUCTION. • • 74

Execute Channel Program (EXCP) Macro-Instruction. • 75


Use of EXCP in System and Problem Programs. • • • • 75
System Use of EXCP • • • 75
Programmer Use of EXCP • • • • • • 76

EXCP Requirements • • • • • • • 76
Channel Program. • • • • . • • • 76
Data and Command Chaining • • 76
Control Blocks • . • • • • • • • • 77
Input/Output Block (lOB). • 77
Event Control Block (ECB) • • 77
Data Control Block (DCB) • • . · 77
Data Extent Block (DEB) • 77
Channel Program Execution • . • • • • • • 78
Initiation of Channel Program. • • • • • • • 78
Completion of Channel Program. • • • • • • • • 79
Device End Errors . • • • . • • • • • • • 79
Interruption Handling and Error Recovery Procedures. • • • • • 79
Error Recovery Procedures for Related Channel Programs. • • 79

Appendages. • • • • • • • • • • • 80
Defining Appendages. • • • • 80
Entering Appendages Into SVC Library • • • • • 80
Characteristics of Appendages • • . • · 81
Start Input/Output (SIO) Appendage. • • • • 82
Program Controlled Interruption (PCI) Appendage • • • • • • 82
End-of-Extent Appendage • 82
Channel End Appendage • • · 83
Abnormal End Appendage. • • 83
EXCP Programming Specifications • • 84
Macro-Instructions • • • . • • 84
DCB -- Define Data Control Block for EXCP . • • • 84
OPEN -- Initialize Data Control Block . • • • • • • 90
EXCP -- Execute Channel Program . • • • . 91
EOV -- End of Volume. • • • • ~. • • • . • • • • • • • • • • 91
CLOSE -- Restore Data Control Block • . • • • 92
Control Block Fields . • • • . • • 93
Input/Output Block Fields . • • 93
Event Control Block Fields • • • • 95
Data Extent Block Flelds • . • . • · . 96
Appendix: Restore Macro-Instruction . • . . '. . . • 97
RESTORE Macro-Instruction • • 97
Control Statements Required • 97
RESTORE Macro-Definition • • • • 97

EXECUTE DIRECT ACCESS PROGRAM (XDAP) MACRO-INSTRUCTION. . • • . 98

Execute Direct Access Program (XDAP) Macro-Instruction. . • • 99


Requirements for Execution of Direct-Access Program • • 99
XDAP Programming Specifications . • . • . . • • .100
Macro-Instructions • • • . • . . . • • . • • .100
DCB -- Define Data Control Block. . . • d • • • • .100
OPEN -- Initialize Data Control Block . .. • • • • . • • • .100
XDAP -- Execute Direct-Access Program • . • • • . • .100
EOV -- End of Volume. . • • • .101
CLOSE -- Restore Data Control Block • .101
The XDAP Control Block • • • . • • • • . • . • .102
Event Control Block (ECB) • • · • . 102
Input/Output Block (lOB) • • • • • . 103
Direct-Access Channel Program .103
XDAP Options • • • . • • • • • • • • .103
Conversion of Relative Track Address to Actual Address . · .103
Appendages • • • • • • • • • • . • • • • • . • • . 104
L- and E- Forms of XDAP Macro-Instruction. .104
Appendix: CVT Macro-Instruction. . • • . • .105
Format of the CVT Macro-Instruction .105
Control Statements Required • • • • . 105
CVT Macro-Definition. • • • • • • . 105
HOW TO USE THE TRACING ROUTINE • .108
HOW TO USE THE TRACING ROUTINE • • . 109
Table Entry Formats • _ · • . 109
Location of the Table • • . • · • . 109
IMPLEMENTING DATA SET PROTECTION • .111
Implementing Data Set Protection . • • • • • 112
Password Data Set Characteristics and Record Format • • .112
Protecting the Password Data Set • • • .113
Creating Protected Data Sets . • • • .113
Protection Feature Operating Characteristics. · . • . 113
Termination of Processing . • . • • • • · . • . 113
Volume Switching. . • • • • • · • • . . .114
Data Set Concatention • • • • · • . 114
SCRATCH and RENAME Functions. .114
Counter Maintenance • • • • . · . • • . .114
THE RESIDENT BLDL TABLE AND RESIDENT ACCESS 'METHOD OPTIONS • . 115

The Resident BLDL Table and Resident Access Method Options • . · .116
The Resident BLDL Table Option. • . • • • . 116
Selecting Entries for the Resident BLDL Table. . . • • .117
Table Size. • • . • • • • • · . • . • .117
Frequency of Use. • • • . . • • • • • • . 117
The Resident Access Method Option • .117
Considerations for Use • • • • • • .117
Creating Procedure Library Lists • • .118
Example. • • • • • • • • • • • • .118

Appendix A: Resident Access Method Option - Standard List IEAIGGOO .120

CONSTRUCTING A DUMMY WAITR ROUTINE. .121

Constructing a Dummy WAITR Routine. • • .122


Functions of the Dummy WAITR Routine. • .122
A Coding Example • • • • • • • • • • 122
Job Control Language Statements • • • • 123

Programming Considerations. • .124


SYSTEM MACRO-INSTRUCTIONS • • .125

Locate Device Characteristics (DEVTYPE) Macro-Instruction • .126


Device Characteristics Information. • • • • • • • .126
Output for Each Device Type • • • • • • • • • • .128
Exceptional Returns • • • • • • • • .129
How to Read a Job File Control Block. • • • • • • • .130
OPEN -- Prepare the Data Control Block for Processing (S> • • . 130
RDJFCB -- Read a Job File Control Block (S> . • • • • • .131
ILLUSTRATIONS

FIGURES

Figure 1. Status of Control Information and Pointers • • • • • • • • 47


Figure 2. Format of Combined Work and Control Block Area • • • • • • 48
Figure 3. General Flow of a Nonstandard Label Processing Routine
After Receiving Control From the OPEN Routine. • • • • . • • • • • • 49
Figure 4. General Flow of a Nonstandard Label Processing Routine
After Receiving Control FrOID the CLOSE Routine • • • • • • • • . • . 50
Figure 5 • GenE~ral Flow of a Nonstandard Label Processing Routine
After Receiving Control Frorr the EOV Routine • • • • • • • • • • 51
Figure 6. Editor Routine Entry Conditions. . • . . .• • 57
Figure 7. General Flow of an Editor Routine After Receiving
Control From the OPEN Routine. • • • • • • • • • • • • • • 59
Figure 8. General Flow of an Editor Routine After Receiving
Control From the End-of-Volume Routine • • • . • • • 60
Figure 9. Data Control Block Format for EXCP (After OPEN). • • 86
Figure 10. Input/Output Block Format. • • • • • . • • . . • • • 93
Figure 11. Event Control Block After Posting of Completion Code. 95
Figure 12. Event Control Block After Posting of Completion Code • • • 102
Figure 13. The XDAP Channel Programs. • • • • • • • • . • • .103

TABLES

Table 1. Programming Conventions for SVC Routines • • • • • • • . • • 33


MAINTAINING THE CATALOG AND THE VOLUME TABLE OF CONTENTS

This chapter provides detailed informa-


tion on how to maintain and modify the
catalog and volume table of contents.
Before reading this chapter, you should
be familiar with the information contained
in the prerequisite publications listed
below.
Documentation of the internal logic of
the routines used to maintain and modify
the catalog and volume table of contents
can be obtained through your IBM Branch
Office.

PREREQUISITE PUBLICATIONS
The IBM System/360 operating System:
Assembler Language publication (Form
C28-6514) contains the information neces-
sary to code programs in the assemtler
language.
The IBM System/360 operating Systerr:
Data ~anagement publication (Form C28-6537)
contains a general description of the
structure of catalog indexes, as well as a
brief discussion of the volume tatle of
contents (V'roc).
The IBM System/360 Operating System:
Control Program Services publication (Form
C28-6541) contains an explanation of" the
notation conventions used to describe the
macro-instructions contained in this chap-
ter.
The IBM System/360 Operating System:
System Control Blocks publication (Form
C28-6628) contains format and field de-
scriptions of the system control tlocks
referred to in this chapter.

RECOMMENDED PUBLICATIONS
The IBM System/360 Operating System:
utilities publication (Form C28-6586) de-
scribes how to maintain and ITodify the
catalog and the volume table of contents
through the use of utility programs.

Maintaining the Catalog and the Volume Table of contents 9


MAINTAINING THE CATALOG AND THE VOLUME TABLE OF CONTENTS

This chapter describes how to maintain and modify the catalog and the
volume table of contents through the use of macro-instructions. Most of
the maintenance and modification functions can also be performed using
utility statements. The utility statements are described in the
publication IBM System/360 Operating System: Utilities.

The functions you can perform using the macro-instructions are


described in text, and the formats of the macro-instructions are
tabulated on a fold-out sheet at the tack of this chapter. The chart on
the fold-out sheet associates the function described in text with the
macro-instructions needed to perform the function. You should keep the
fold-out sheet open when reading the text.
The functions that are described in text are as follows:

• How to read a block fron: the catalog.


• How to build an index.
• How to build a generation index.
• How to delete an index.
• How to assign an alias.
• How to delete an alias.
• How to connect control volumes.
• How to disconnect control volumes.
• How to catalog a data set.
• How to rerr,ove data set references from the catalog.
• How to recatalog a data set.
• How to read a data set control block from the volume table of
contents.
• How to delete a data set.
• How to rename a data set.
Accompanying the function descriptions in text are coding examples
and programm1ng notes; exceptional-return condition codes for the
macro-instructions are tabulated on the back of the fold-out sheet.

HOW TO READ A BLOCK FROM THB CATALOG

To read either an index block or a block indicating the volumes on


Which a data set is stored (volume-list block), you use the LOCATE and
CAMLST macro-instructions. There are two ways to specify the block that
you want read into main storage: by using the nawe of the index level or
data set, or by using the block's location relative to the beginning of
the catalog (TTR).

Specifying the Name of an Index Level or Data Set


If you specify an index level name, the first block of the named
index is read int,o main storage, and an exceptional return code is set.
Index tlock formats are contained in Appendix A of this chapter.

If you specify a data set name, a 256-byte volume-list block is read


into main storage. The block contains up to 20 volume pointers, each of
which points to a volume on which ~art of the data set is stored. The
first two bytes of the block contain the number of volume pointers for
the data set. Each volume pointer is a 12-byte field that contains a
4-byte device code, a 6-byte volume serial number, and a 2-byte data set
sequence number. (Device codes are contained in Appendix B of this
chapter.)

10
If the nam4ed data set is stored on more than 20 vol urnes, bytes
253-255 of the block contain the relative track address of the next
block of volume pointers. Byte 256 contains a binary zero.

Example: In the following example, the list of volumes that contain


data set A.B is read into main storage. The search for the volume-list
block starts on the system residence volume.

r---------T----------T-------------------------------------------------,
I Name I Operation I Operand ~
~---------+----------+-------------------------------------------------i
I I LOCATE I INDAB READ VOLUME-LIST BLOCK FOR I
I I Check Exceptional Returns CATALOGED DATA SET A.B INTOI
I INDAB I CAMLST I NAME,AB"LOCAREA MAIN STORAGE AREA NAMED I
I AB I DC I CL44'A.B' LOCAREA. LOCAREA ALSO I
I LOCAREA I DS I OD CONTAINS 3-BYTE TTR AND I
I _________ I ___________
L ~ DS ~I _________________________________________________
265C 6-BYTE SERIAL NUMBER JI

The LOCATE macro-instruction points to the CAMLST macro-instruction.


NAME, the first operand of CAMLST, specifies that the system is to
search the catalog for a volume-list tlock by using the name of a data
set. AB, the second operand, specifies the main storage location of a
44-byte area into which you have placed the fully qualified name of a
data set. LOCAREA, the fourth operand, specifies a 265-byte area you
have reserved in main storage.
After execution of these macro-instructions, the 265-byte area
contains: the 256-byte volurre-list block for data set A.B, the 3-byte
relative track address (TTR) of the block following the one read into
main storage, and the 6-byte serial number of the volume on which the
block was found ..

Specifying the Name of a Generation Data Set


You specify the name of a generation data set by using the fully
qualified generation index name and the relative generation number of
the data set. The value of a relative generation number reflects the
position of a data set in a generation data group. The following values
can be used:
• Zero - specifies the latest data set cataloged in a generation data
group.
• Negative nt~ber - specifies a data set cataloged before the latest
data set.
• Positive number - specifies a data set not yet cataloged in the
generation data group.
When you use zero or a negative number as the relative generation
number, a volume-list block is read into main storage and the relative
generation number is replaced by the absolute generation name.
When you USE~ a positive number as the relative generation number, an
absolute generation name is created and replaces the relative generation
number. A volume-list block is not read, since none exists for these
data sets.
Example: In t.he following example, the list of volumes that contain
generation data set A.PAY(-3) is read into main storage. The search for
the volume-list block starts on the system residence volume.

Maintaining the Catalog and the Volume Table of contents 11


r---------T----------T-------------------------------------------------,
I Name I operationl Operand I
~---------+----------+-------------------------------------------------~
I I LOCATE I INDGX READ VOLUME-LIST BLOCK FOR I
I I Check Exceptional Returns DATA SET A.PAY(-3) INTO I
I INDGX I CAMLST I NAME,APAY"LOCAREA MAIN STORAGE AREA NAMED I
I APAY I DC I CL44'A.PAY(-3)' LOCAREA. LOCAREA ALSO CON- i
I LOCAREA I DS I OD TAINS 3-BYTE TTR AND I
IL _________ I
~--
DS________ I _________________________________________________
~
265C 6-BYTE SERIAL NUMBER JI

The LOCATE macro-instruction points to the CAMLST macro-instruction~


NAME, the first operand of CAMLST, specifies that the system is to
search the catalog for a volume-list block by using the name of a data
set. APAY, the second operand, specifies the main storage location of a
44-byte area into which you have placed the name of the generation index
and the relative generation number of a data set in the generation data
group. LOCAREA, the fourth operand, specifies a 265-byte area you have
reserved in main storage.
After execution of these macro-instructions, the 265-byte area
contains: the 256-byte volurre-list clock for generation data set
A. PAY(-3), the 3-byte relative track address ('ITR) of the block
following the one read into rrain storage, and the 6-byte serial number
of the volume on which the block was found. In addition, the system
will have replaced the relative generation number that. you specified in
your 44-byte area with the data sst's absolute generation name.

§pecifying a Name Using an Alias


For each of the preceding functions, you can specify an alias as the
first name in the qualified name of an index level, data set, or
generation data set. Each function is performed exactly as previously
described, with one exception: the alias narre specified is replaced by
·the true name.

§pecifying by TTR
You can read any block in the catalog by specifying, in the form TTR,
the identification of the block and its location relative to the
beginning of the catalog. TT is the number of tracks defining the
position, relative to the beginning of the catalog, of the track on
which the block to be read resides; R is the identification of the block
on that track. (Formats of each type of catalog block are contained in
Appendix A of this chapter.)
Example: In the following example, the block at the location indicated
by TTR is read into main storage. The specified block is in the catalog
on the system residence volume.

r---------T----------T-------------------------------------------------,
I Name I Operationl Operand I
t---------+----------+-------------------------------------------------~
I I LOCATE I BLK READ A BLOCK INTO MAIN I
I I Check Exceptional Returns STORAGE AREA NAMED LOCAREA I
I BLK I CAMLST I BLOCK,TTR"LOCAREA I
I 'ITR I DC I H' 5' RELATIVE TRACK 5 I
I I DC I X'03' BLOCK 3 ON TRACK I
I LOCAREA I DS I 00 LOCAREA ALSO CONTAINS 3-BYTEI
IL _________ I __________
~ DS I _________________________________________________
~ 265C TTR AND 6-BYTE SERIAL NO. JI

12
The LOCATE macro-instruction points to the CAMLST macro-instruction.
BLOCK, the first operand of CAMLST, specifies that the system is to
search the catalog for the block indicated by TTR, the second operand.
LOCAREA, the fourth operand, specifies a 265-byte area you have reserved
in main storage.
After execut.ion of these macro-instructions, the 265-byte area
contains: the 256-byte index block, the 3-byte relative track address
CTTR) of the block following the one read into main storage, and the
6-byte serial number of the volume on which the block was found.

HOW TO BUILD AN INDEX


To tuild a new index structure and add it to the catalog, you must
create each level of the index separately. You create each level of the
index ty using the INDEX and. CAMLST macro-instructions.
These two macro-instructions can also be used to add index levels to
existing index structures.

Example: In the following example, index structure A.B.C is built on


the control volume whose serial number is 000045.

r---------T----------T-------------------------------------------------,
I Name I Operation I Operand I
t---------f----------f-------------------------------------------------~
INDEX I INDEXA BUILD INDEX A
Check Exceptional Returns
INDEX I INDEXB BUILD INDEX STRUCTURE A.B
Check Exceptional Returns
INDEX I INDEXC BUILD INDEX STRUCTURE A.B.C
Check Exceptional Returns
INDEXA CAMLST I BLDX,ALEVEL,VOINUM
INDEXB CAMLST I BLDX,BLEVEL,VOLNUM
INDEXC CAMLST I BLDX,CIEVEL,VOtNUM
VOLNUM DC I CL6'000045' VOLUME SERIAL NUMBER
ALEVEL DC I CL2'A' INDEX STRUCTURE NAMES
BLEVEL DC I CL4'A.B' FOLLOWED BY BLANKS
L- CLEVEL
________ ~
DC ._____ I _________________________________________________
_____ ~
CL6'A.B.C' WHICH DELIMIT FIELDS J

Each INDEX macro-instruction points to an associated CAMLST macro-


instruction. BLDX, the first operand of CAMLST, specifies that an index
level be built. The second operand specifies the main storage location
of an area into which you have placed the fully qualified name of an
index level. ThE; third operand specifies the main storage location of
an area into which you have placed the 6-byte serial nuwoer of the
volume on which the index level is to be built.

HOW TO BUILD A GENERATION INDEX


You build a generation index by using the INDEX and CAMLST macro-
instructions. All higher levels of the index must exist. If the higher
levels of the index are not in the catalog, you mus·t build them. How to
build an index has been explained previously. In the following example,
the generation index D is built on the control volurr.e whose serial
number is 000045. The higher level indexes A.B.C already exist. When
the number of generation data sets in the generation index D exceeds
four, the oldest data set in the group is uncataloged and scratched.

Maintaining the Catalog and the Volurre Table of contents 13


r---------T----------T-------------------------------------------------,
I Name I operation I Operand I
~---------+----------+-------------------------------------------------~
I I INDEX I GENINDX BUILD GENERATION I
I I Check Exceptional Returns INDEX I
I GENINDX I CAMLST I BLDG,DLEVEL,VOLNUM"DELETE,,4 I
I DLEVEL I DC I CLsrA.B.C.D' BLANK DELIMITER I
VOLNUM I __________
IL _________
~ DC ~ I _________________________________________________
CL6'000045' JI

The INDEX macro-instruction points to the CAMLST macro-instruction.


BLDG, the first operand of CAMLST, specifies that a generation index be
built. DLEVEL, the second operand, specifies the main storage location
of an area into which you have placed the fully qualified name of a
generation index. VOLNUM, the third operand, specifies the main storage
location of an area into which you have placed the 6-byte serial number
of the volume on which the generation index is to be built. DELETE, the
fifth operand, specifies that all data sets dropped from the generation
data group are to be deleted. The final operand, 4, specifies the
number of data sets that are to be maintained in the generation data
group.
Note: A model DSCB for the generation data set must be placed on the
control volume containing the index prior to creation of the data set.
The system will take information from the model DSCB when you create a
data set for the group. A model DSCB is created by specifying, in a DD
statement: the name of the data set; zero space allocation, i.e.,
SPACE=(TRK, (0»; and appropriate DCB=parameters.

HOW TO DELETE AN INDEX


You can delete any number of index levels from an existing index
structure. Each level of the index is deleted separately. You delete
each level of the index by using the INDEX and CAMLST macro-
instructions.
If an index level either has an alias, or has other index levels or
data sets cataloged under it, it cannot be deleted.
Example: In the following example, index level C is deleted from index
structure A.B.C. The search for the index level starts on the system
residence volume.

r---------T----------T-------------------------------------------------,
I Name I Operation I Operand I
~---------+----------+-------------------------------------------------~
I I INDEX I DELETL DELETE INDEX LEVEL C FROM I
I I Check Exceptional Returns INDEX STRUCTURE A.B.C I
I DELETE I CAMLST I DLTX,LEVELC I
I _________
L LEVELC I __________
~ DC ~I _________________________________________________
CL6'A.B.C' ONE BLANK FOR DELIMITER JI

The INDEX macro-instruction points to the CAMLST macro-instruction.


DLTX, the first operand of CAMLST, specifies that an index level be
deleted. LEVELC, the second operand, specifies the main storage
location of an area into which you have placed the fully qualified name
of the index structure whose lowest level is to be deleted.

HOW TO ASSIGN AN ALIAS


You assign an alias to an index level by using the INDEX and CAMLST
macro-instructions. An alias can be ass~gnea only to a high level
index; e.g., index A of index structure A.B.C can have an alias, but

14
index B cannot. Assigning an alias to a high level index effectively
provides aliases for all data sets cataloged under that index.
Example: In the following example, index level A is assigned an alias
of x. The search for the index level starts on the system residence
volume.

r---------T----------T-------------------------------------------------,
I Name I Operation I Operand I
~---------+-----.-----+-------------------------------------------------i
I I INDEX I ALIAS BUILD AN ALIAS FOR A HIGHI
I I Check Exceptional Returns LEVEL INDEX I
I ALIAS I CAMLST I BLDA,DSNAME"DSALIAS I
I DSNAME I DC I CL8'A' MUST BE 8-BYTE FIELDS I
IL _________
DSALIAS iI __________
DC iI _________________________________________________
CL8'X' JI

The INDEX macro-instruction points to the CAMLST macro-instruction.


BLDA, the first operand of CAMLST, specifies that an alias be built.
DSNAME, the second operand, specifies the main storage location of an
8-byte area into which you have placed the name of the high level index
to be assigned an alias. DSALIAS, the fourth operand, specifies the
main storage location of an 8-byte area into which you have placed the
alias to be assigned.

HOW TO DELETE AN ALIAS


You delete an alias previously assigned to a high level index ty
using the INDEX and CAMLST macro-instructions.
Example: In the following example, alias X, previously assigned as an
alias for index level A, is deleted. The search for the alias starts on
the system residence volume.

r---------T----------T-------------------------------------------------,
I Name I Operation I Operand I
~---------+----------+-------------------------------------------------i
I I INDEX I DELALIAS DELETE AN ALIAS FOR A I
I I Check Exceptional Returns HIGH LEVEL INDEX I
I DELALIASI CAMLST I DLTA,ALIAS I
IL _________
ALIAS iI ______
DC . ____ iI ________
CL8'X' - - -______________________________________
MUST BE 8-BYTE FIELD JI

The INDEX macro-instruction points to the CAMLST macro-instruction.


DLTA, the first operand of CAMLST, specifies that an alias be deleted.
ALIAS, the second operand, specifies the main storage location of an
8-byte area into which you have placed the alias to be deleted.

HOW TO CONNECT CONTROL VOLUMES


You connect two control volumes by using the INDEX and CAMLST
macro-instructions. If a control velume is to be connected to the
system residence volume, you need supply only the serial nurober of the
volume to be connected and the nawe of a high level index associated
with the volume to be connected.
If a control volume is to be connected to a control volume other than
the system residence volume, you must supply the serial numbers of both
volumes and the name of a high level index associated with the volume to
be connected.
The result of connecting control volumes is that the volume serial
number of the control volUme connected and the name of a high level

Maintaining the Catalog and the Volume Table of Contents 15


index are entered into the volume index of the volume to which it was
connected. This entry is called a control volume pointer. A control
volume pointed to by a control volun;e cannot, in turn, point to another
control volume.
Example: In the following example, the contrel voluroe whose serial
number is 001555 is connected to the control volume numbered 000155.
The name of the high level index is HIGHINDX.

r---------T----------T-------------------------------------------------,
I Name I Operation I Operand I
~---------+----------+-------------------------------------------------~
I I INDEX I CONNECT CONNECT TWO CON- I
I I Check Exceptional Returns TROL VOLUMES WHOSE I
I CONNECT I CAMLST I LNKX,INDXNAME,OLDCVCL,NEWCVOL SERIAL NUMBERS AREI
I INDXNAMEI DC I CL8'HIGHINDX' 000155 AND 001555. I
I OLDCVOL I DC I CL6'000155' I
IL _________
NEWCVOL I __________
~
DC ~
I _________________________________________________
CL6'001555' JI

The INDEX rracro-instruction points to the CAMLST macro-instruction.


LNKX, the first operand of CAMLST, specifies that control volumES be
connected. INDXNAME, the second operand, specifies the main storage
location of an 8-byte area into which you have placed the name of the
high level index of the volume to be connected. OLDCVOL, the third
operand, specifies the main storage location of a 6-byte area into which
you have placed the serial number of the volume to which you are
connecting. NEWCVOL, the fcurth operand, specifies the main storage
location of a 6-byte area into which you have placed the serial number
of the volume to be connected.

HOW TO DISCONNECT CONTROL VOLUMES


You disconnect two control volumes by using the INDEX and CAMLST
macro-instructions. If a control vclume is to be disconnected from the
system residence volume, you need supply only the name of the high level
index associated with the volurre to be disconnected.
If a control volume is to be disconnected from a control volume other
than the system residence volume, you must supply, in addition to the
name of the high level index, the serial nurr-ber of the control volume
from which you want to disconnect.
The result of disconnEcting control volumes is that the control
volume pointer is removed from the volume index of the volume from which
you are disconnecting.
Example: In the following example, the control volume that contains the
high level index HIGHINDX is disconnected from the system residence
volume.

r---------T----------T---------------------'----------------------------,
I Name I Operationl Operand I
~---------+----------+------------------,-------------------------------~
I I INDEX I DISCNECT DISCONNECT TWO CONTROL I
I I Check Exceptional Returns VOLUMES I
I DISCNECTI CAMLST I DRPX,INDXNAME I
IL_________ DC
INDXNru~EIL __________ LI _________________________________________________
CL8'HIGHINDX' MUST BE 8-BYTE FIELD JI

The INDEX macro-instruction points to the CAMLST macro-instruction.


DRPX, the first operand of CAMLST, specifies that control volumes be
disconnected. INDEXNAME, the second operand, specifies the main storage

16
location of an 8-byte area into which you have placed the name of the
high level index of the control volume to be disconnected.

HOW TO CATALOG A DATA SEr


You catalog a data set by using the CATALOG and CAMLST macro-
instructions. All inde* leve~s required to catalog the data set must
exist in the catalog, or an exceptional return code is set.
You must build a complete volume list in main storage. This volume
list consists of volume pointers for all volurres on which the data set
is stored. The first two bytes of the list indicate the number of
volume pointers that follow. Each 12-byte volume pointer consists of a
4-byte device code, a 6-byte volume serial number, and a 2-byte data set
sequence number. The sequence number is always zero for 'direct-access
volumes. (Device codes are contained in Appendix B of this chapter.)
Example: In the following example, the data set named A.B.C is
cataloged under an existing index structure A.B. The data set is stored
on two volumes.

r---------T----------T---------~---------------------------------------,
I Name I Operation I Operand I
~---------+----------+-------------------------------------------------~
I I CATA:LOG I ADDABC CATALOG DATA SET A.B.C. THE I
, I Check Exceptional Returns INDEX STRUCTURE A.B. EXISTS I
I ADDABC I CAMLST I CAT,DSNAME"VOLUMES I
I DSNAME I DC , CL6'A.B.C' ONE BLANK FOR DELIMITER I
I VOLUMES I DC I H,. 2' TWO VOLUMES I
I , DC , X'30002001' 2311 DISK STORAGE I
, , DC , CL6'000014' VOLU~E SERIAL NUMBER ,
, I DC , H' 0' DATA SET SEQUENCE NUMBER I
, I DC I X'30002001' 2311 DISK STORAGE I
, , DC I CL6'000015' VOLUME SERIAL NUMBER I
, _________ , __________
L ~ DC , _________________________________________________
~ H'O' SEQUENCE NUMBER J,

The CATALOG macro-instruction points to the CAMLST macro-instruction.


CAT, the first operand of CAMLST, specifies that a data set be
cataloged. DSNAME, the second operand, specifies the main storage
location of an area into which you have placed the fully qualified name
of the data set to be cataloged. VOLUMES, the fourth operand, specifies
the main storage location of the volume list you have built.

HOW TO REMOVE DATA SET REFERENCES FROM THE CATALOG


You remove data set references from the catalog by using the CATALOG
and CAMLST macro-instructions.
Example: In the following example, references to data set A.B.C are
removed from the catalog.

r---------T-----------T-------------------------------------------------,
'Name I Operation, Operand I
~---------+----------+-------------------------------------------------~
I I CATALOG I REMOVE REMOVE REFERENCES TO DATA I
I I Check Exceptional Returns SET A.B.C FROM THE CATALOG I
I REMOVE I CAMLST I UNCAT,DSNAME I
L DSNAME I ___________
I _________ ~ DC I _________________________________________________
~CL6'A.B.C' ONE BLANK FOR DELIMITER JI

The CATALOG macro-instruction points to the CAMLST macro-instruction.


UNCAT, the firs·t cperand of CAMLST, specifies that references to a data

Maintaining the Catalog and the Volurre Table of Contents 17


set be removed from the catalog. DSNAME, the second operand, specifies
the main storage location of an area into which you have placed the
fully qualified name of the data set whose references are to be removed.

HOW TO RECATALOG A DATA SET


You recatalog a cataloged data set by using the CATALOG and CAMLST
macro-instructions. Recataloging is usually performed when new volume
pointers must be added to the volume list of a data set.
You must build a complete volume list in main storage. This volurre
list consists of volume pointers for all volumes on which the data set
is stored. The first two bytes of the list indicate the number of
volume pointers that follow. Each 12-byte volume pointer consists of a
4-byte device code, a 6-byte volume serial number, and a 2-byte data set
sequence number. The sequence number is always zero for direct-access
volumes. (Device codes are contained in Appendix B of this chapter.)
Example: In the following example, the data set named A.B.C is
recataloged. A new volume pointer is added to the volume list, which
previously contained only two volume pointers.

r---------T----------T-------------------------------------------------,
I Name I Operationl Operand I
~---------+----------+-------------------------------------------------~
CATALOG I RECATLG RECATALOG DATA SET A.B.C,
Check Exceptional Returns ADDING A NEW VOLUME
POINTER TO THE VOLUME
RECATLG CAMLST RECAT,DSNAME"VOIUMES LIST.
DSNAME DC CL6'A.B.C' ONE BLANK FOR DELIMITER
VOLUMES DC H' 3' THREE VOLUMES
DC X'30002001' 2311 DISK STORAGE
DC CL6'000014' VOLUME SERIAL NUMBER
DC H' 0' SEQUENCE NUMBER
DC X'30002001' 2311 DISK STORAGE
DC CL6'OOOOlS' VOLUME SERIAL NUMBER
DC H'O' SEQUENCE NUMBER
DC X'30002001' 2311 DISK STORAGE
DC CL6'000016' VOLUME SERIAL NUMBER
DC H'O' SEQUENCE NUMBER
---------~----------~-------------------------------------------------
The CATALOG macro-instruction points to the CAMLST macro-instruction.
RECAT, the first operand of CAMLST, specifies that a data set be
recataloged. DSNAME, the second operand, specifies the wain storage
location of an area into which you have placed the fully qualified name
of the data set to be recataloged. VOLUMES, the fourth operand,
specifies the main storage location of the volume list you have built.

HOW TO READ A DATA SET CONTROL BLOCK FROM THE VOLUME TABLE OF CONTENTS
You can read a data set control block (DSCB) into main storage by
using the OBTAIN and CAMLST If-acro-instructions. There are two waY3 to
specify the DSCB that you want read: by using the name of the data set
associated with the DSCB, or by using the atsolute track address of the
DSCB.
When you specify the name of the data set, a forroat 1 DSCB is read
into main storage. To read a DSCB other than a format 1 LSCB, you must
specify an absolute track address. <DSCB formats and field descriptions
are contained in the System control Block publication).

18
When a data set name is: specif ied, the 96-byte data portion of the
format 1 DSCB, and the absolute track address of the DSCB are read into
main storage. When the absolute track address cf a DSCB is specified,
the 44-byte key portion and the 96-byte data portion of the DSCB are
read into main storage.
Example: In the following example, the format 1 DSCB for data set A.B.C
is read into main storage. The serial nurrber of the volume containing
the DSCB is 770655.

r---------T-----·-----T-------------------------------------------------,
I Name I Operation I Operand I
~---------+----------+-------~-----------------------------------------i
I I OBTAIN I DSCBABC READ DSCB FOR DATA I
I I Check Exceptional Returns SET A.B.C INTO MAINI
I DSCBABC I CAMLST I SEARCH,DSABC,VOLNUM,WORKAREA STORAGE AREA NAMED I
I DSABC I DC I CL44'A.B.C' WORKAREA. 96-BYTE I
I VOLNUM I DC I CL6'770655' DATA PORTION IS I
I WORKAREAI DS I OD READ. THE REST OF I
I I DS I 350C THE AREA IS USED BYI
IL _________ I __________ I _________________________________________________
~ ~
THE OBTAIN ROUTINE JI

The OBTAIN macro-instruction points to the CAMLST macro-instruction.


SEARCH, the first operand of CAMLST, specifies that a DSCB be read into
main storage. DSABC, the second operap.d~ specifies the main storage
location of a 44-byte area into which you have placed the fully
qualified name of the data set whose associated DSCB is to be read.
VOLNUM, the third operand, specifies the main storage location of a
6-byte area into which you have placed the serial nurrber of the volume
containing the required DSCB. WORKAREA, the fourth operand, specifies
the main storage location of a 350-byte work area that is to contain the
DSCB~

After execution of these macro-instructions, the first 96 b~tes of


the work area contain the data portion of the fornat 1 DSCB; the next
five bytes contain the absolute track address of the DSCB. The OBTAIN
routine uses the rest of tht area as a ~ork area.

HOW TO DELETE A DATA SET

You delete a data set stored on direct-access volumes by using the


SCRATCH and CAMLSTmacro-instructions. This caUSES all data set control
blocks <DSCB) for the data set to be deleted, and all space occupied by
the data set to be made available for reallocation. If the data set to
be deleted is sharing a split cylinder, the space will not be made
available for reallocation until all data sets on the split cylinder are·
deleted.
A data set cannot be deleted if the expiration date in the fermat 1
DSCB has not passed, unless you choose to ignore the expiration date.
You can ignore the Expiration date by using the OVRD option in the
CAMLST macro-instruction.
If a data set to be deleted is stored on more than one volume, either
a device must be available on which to mount the volumes, or at least
one volume must be mounted. In addition, all other required volu~es
must l:e serially mountable. Certain volumes, such as the system
residence volume, must always be mounted.
When deleting a data set, you must tuild a complete volume list in
main storage. This volume list consists of volurre pointers for all
volumes on which the data set is stored. The first two bytes of the
list indicate the number of volume pointers that follow. Each 12-byte

Maintaining the Catalog and the Volurre Table of contents 19


volume pointer consists of a 4-tyte device code, a 6-byte volume serial
number, and a 2-byte data set sequence number. The sequence number is
always zero for direct-access volurres. (Device codes are contained in
Appendix B of this chapter.)

Volumes are processed in the order that they appear in the volume
list. Those volunles that are pointed to at the beginning of the list
are processed first. If a volume is not mounted, a rressage is issued to
the operator requesting him to mount the voluroe. You can indicate the
I/O device on which unmounted volumes are to be mounted by loading
register 0 with the address of the UCB associated with the device to be
used. When the volume is mounted, processing continues. If you do not
load register 0 with a UCB address, its contents rrust be zero.
If the operator cannot mount the requested volume, he issues a reply
indicating that he cannot fulfill the request. A condition code is then
set in the last byte of the volume pointer for the unavailable volume,
and the next volume indicated in the volume list is processed or
requested.
Example: In the following example, data set A.B.C is deleted from two
volumes. The expiration date in the format 1 DSCB is ignored.

r---------T----------T-------------------------------------------------,
I Name I Operation I Operand I
~---------+----------+-------------------------------------------------~
SR I 0,0 SET REG 0 TO ZEROI
SCRATCH I DELABC DELETE DATA SET I
Check Exceptional Returns A.B.C. FROM TWO I
DELABC CAMLST I SCRATCH,DSABC"VOLIST"OVRD VOLUMES, IGNORING I
DSABC DC I CL44' A. B. C' THE EXPIRATION I
VOLIST DC I B'2' DATE IN THE DSCB. I
DC I X'30002001' 2311 DISK STORAGE I
DC I CL6'000017' VOLUME SERIAL NO. I
DC I H'O' SEQUENCE NUMEER I
DC I X'30002001' 2311 DISK STORAGE I
DC I CL6' 000018' VOLUME SERIAL NO. I
L _________ ~
DC
__________~
I _________________________________________________
H'O' SEQUENCE NUMBER JI

The SCRATCH macro-instructicn points to the CAMLST macro-instruction.


SCRATCH, the first operand of CAMLST, specifies that a data set be
deleted. DSABC, the second operand, specifies the main storage location
of a 44-nyte area into which you have placed the fully qualified name of
the data set to be deleted. VOLIST, the fourth operand, specifies the
main storage location of the volunie list you have built. OVRD, the
sixth operand, specifies that the expiration date be ignored in the OSCB
of the data set to be deleted.

HOW TO RENAME A DATA SET


You rename a data set stored on direct-access volumes by using the
RENAME and CAMLST macro-instructions. This causes the data set nanie in
all format 1 data set control blocks (DSCB) for the data set to be
replaced by the new narre that you supply_
If a data set to be renanled is stored on more than one volume, either
a device must be available on which to mount the volumes, or at least
one volume must be mounted. In addition, all other required volumes
must be serially mountable. Certain volumes, such as the system
residence volume, must always be mounted.
When renaming a data set, you must build a complete volume list in
main storage. This volun'e list consists of volume pointers for all

20
volumes on which the data set is stored. The first two bytes of the
list indicate the number of volume pointers that follow. Each 12-byte
volume pointer consists of a 4-byte device code, a 6-byte volume serial
number, and a 2-byte data set sequence number. The sequence number is
always zero for direct-access volumes. (Device codes are contained in
Appendix B of this chapter.)
Volumes are processed in the order they appear in the volume list.
Those volumes that are pointed to at the beginning of the list are
processed first. If a volume is not mounted, a message is issued to the
operator requesting him to mount the volume. You can indicate the I/O
device on which unmounted volumes are to be mounted by loading register
o with the address of the UCB associated with the device to be used.
When the volume is mounted, processing continues. If you do not load
register 0 with a UCB address, its contents must be zero.
If the operator cannot mount the requested volume, he issues a reply
indicating that he cannot fulfill the request. A condition cede is then
set in the last byte of the volume pointer for the unavailable volume,
and the next volume indicated in the volume list is processed or
requested.
Example: In the following example, data set A .. B.C is renamed D.E.F.
The data set extends across two volumes.

r---------T----------T-------------------------------------------------,
I Name I Operation I Operand I
~---------+----------+-------------------------------------------------~
SR I 0,0 SET REG 0 TO ZEROI
RENAME I DSABC CHANGE DATA SET I
Check Exceptional Returns NAME A.B.C. TO I
DSABC CAMLST I RENAME,OLDNAI'<1E,NEWNAME, VOLIST D.E.F I
OLDNAME DC I CL44'A.B.C' I
NEW NAME DC I CL44'D.E.F' I
VOLIST DC I H' 2' TWO VOLUI"1ES I
DC I X'30002001' 2311 DISK STORAGE I
DC I CL6' 000017' VOLUME SERIAL NO. I
DC I H'O' SEQUENCE NUMBER I
DC I X'30002001' 2311 DISK STORAGE I
DC I CL6' 000018' VOLUME SERIAL NO. I
. DC
_________ __________
~ I _________________________________________________
~ H' 0 ' SEQUENCE NUMBER JI

The RENAME macro-instruction points to the CAMLST macro-instruction.


RENAME, the first operand of CAMLST, specifies that a data set be
renamed. OLDNAME, the second operand, specifies the main storage
location of a 44-byte area into which you have placed the fully
qualified name of the data set to be renamed. NEWNAME, the third
operand, specifies the main storage locaticn of a 44-byte area into
which you have placed the new name of the data set. VOLIST, the fourth
operand, specifies the main storage location of the voluule list you have
built.

Maintaining the Catalog and the Volume Table of Contents 21


Macro-Instructions Required to Maintain and Modify the Catalog and VTOC

r----------------------------T---------------------------------------------------------------------~---------------------------------------------------T
I I Macro-Instructions Required to Perform Function I 1 list-addrx
I Function r------------------T--------------~--------------------------------------------------------------------------------------+ points to the parameter list <labe
I I Name I Operation I Operands I list-name) set up by the CAMLST mac
~----------------------------+------------------+---------------+--------------------------------------------------------------------------------------+ instruction.
I Read a block from the I [symbol] ! LOCATE ! list-addrx 1 I
I catalog - by name I [list-name) I CAMLST I NAME,dsname-relexp6, [cvol-relexp7],area-relexp9 I
~----------------------------+------------------+---------------+--------------------------------------------------------------------------~===--------+ 2 name-rele:A-P
I Read a block from the I [symbol] I LOCATE I list-addrx 1. I specifies the main storage location of
I catalog - by location I [list-name] I CAMLST I BLOCK,ttr-relexp3,[cvol-relexp7],area-relexp9 I fully qualified name of a data set or in
~--------.
I
--------------------+------------------+---------------+--------------------------------------------------------------------------------------+
Build an index I [symbol] I INDEX I list-addrx1 I
level. The name cannot exceed 44 characte
If the name is less than 44 characters.
I I [list-name] I CAMLST I BLDX,name-relexp2, [cvol-relexp7] I must be followed by a blank. The name must
~----------------------------+------------------+---------------t--------------------------------------------------------------------------------------+ defined by a C-type Define Constant (
I Build a generation I [symbol] I INDEX I list-addrx 1 I instruct~on.
I index I [list-name] I CAMLST I BLDG,name-relexp2, [cvol-relexp7]" [DELETE15], [EMPTy16] ,n'.lmber-absexp17 I
~----------------------~-----+------------------+---------------+--------------------------------------------------------------------------------------+
I Assign an alias I [symbol] I INDEX I list-addrx 1 I
I I [list-name] I CAMLST I BLDA,index name-relexp5, [cvol-relexp7],alias name-relexp10 I 3 ttr-relexp
~----------------------------+------------------+---------------t--------------------------------------------------------------------------------------+ specifies the main s~orage location of
, Delete an index I [symbol] I INDEX I list-addrx1 I 3-byte relative track address (TTR). T
I I [list-name] I CAMLST I DLTX,name-relexp2, [cvol-relexp7] I address indicates the position. relative
~----------------------------+------------------+---------------+--------------------------------------------------------------------------------------+ the beginning of the catalog data set, of
I Delete an alias I [symbol] I INDEX I list-addrx 1 I track containing the block (TT), and the bl
I I [list-name) I CAMLST I DLTA, index name-relexp5, [cvol-relexp7] I identification on that track (R).
~----------------------------+------------------+---------------+--------------------------------------------------------------------------------------+
I Connect control I [symbol] I INDEX I list-addrx 1 I
I volumes I [list-name) I CAMLST I LNKX,index name-relexp5,[cvol-relexp7J,new cvol-relexp12 I " cchhr-relexp
~----------------------------+------------------+---------------+-----------------------------------~--------------------------------------------------+ specifies the main storage location of
I Disconnect control I [symbo~] I INDEX i list-addrx~ ! 5-byte absolute track address (CCHHR) a
I volumes I [list-name) I CAMLST I DRPX,index name-relexp5, [cvol-addrx 7 ] I DSCB.
~----------------------------+-----------------~+--------------~--------------------------------------------------------------------------------------+
I Catalog a data set I [symbol] I CATALOG I list-addrx 1 I
I I [list-name) I CAMLST I CAT,name-relexp2,[cvol-relexp7],vol list- r e lexp13 I 5 index name-relexp
~----------------------------+------------------+---------------+------------------------------------~-------------------------------------------------+ specifies the main storage location of
I Remove data set refer- I [symbol] I CATALOG I list-addrx1 I name of a high level index. The area t
I ences from the catalog I [list-name] I CAMLST I UNCAT,name-relexp2,[cvol-relexp7] I contains the name must be eight bytes Ie
~----------------------------+------------------+---------------+--------------------------------------------------------------------------------------+ The name must be defined by a c-type Def
I Recatalog a data set I [symbol] I CATALOG I list-addrx 1 I Constant (DC) instruction.
I I [list-name] I CP~LST I RECAT,name-relexp2, [cvol-relexp7],vol list-relexp13 I
~----------------------------+------------------+---------------+--------------------------------------------------------------------------------------+
I Read a DSCB from the I [symbol] I OBTAIN llist-addrx 1 I 6 dsname-relexp
I VTOC - by name I [list-name] I CAMLST I SEARCH,dsname-relexp6,vol-relexpB,wk area-relexp1~ I specifies the main storage location of a f~
~----------------------------+------------------+---------------t--------------------------------------------------------------------------------------1 qualified data set name. The area t
I Read a DSCB from the I [sYKillol] I OBTAIN I list-addrx 1 I contains the name must be 44 bytes long.
I VTOC - by location I [list-name] I CAMLST I SEEK,cchhr-relexp~,vol-relexpB,wk area-relexp1~ I name must be defined by a C-type Def
~----------------------------+------------------+---------------f--------------------------------------------------------------------------------------1 Constant (DC) instruction.
I Delete a data set I [symbol] I SCRATCH I list-addrx1 I
I I [list-name] I CAMLST I SCRATCH,dsname-relexp 6"vollist-relexp13,,[OVRD1B] I
7 cvol-relexp
~----------------------------+------------------+---------------+--------------------------------------------------------------------------------------1 specifies the main storage location 0:
I Change the data set I [symbol] I RENAME I list-addrx 1 I
6:byte volume serial number for the volum,
I name in a DSCB I [list-name] I
~----------------------------L------------------~-----__________ _____________________________________________________________________________________ +
CAMLST I RENAME,dsname-relexp6,new name-relexp11,vol list-relexp13
~-
I
be processed. If this parameter is not sp'
=====_____________________________________________________________________________________________________________________________
IL___ Note:The superscript numbers refer to the enumerated list of explanations for the operands. ._________________ I ~
fied, the system residence volume is p:
essed.

B vol-relexp
specifies the main storage location of
6-byte serial number of the volume on wi
the required DSCB is stored.

9 area-relexp
specifies the main storage location 0
26S-byte work area that you must define.
work area must begin On a double-word bou
rYe The first 256 bytes of the work area 1

contain the block that is read from


catalog, and the last nine bytes of the
area will contain the relative track adj
and block identification (in the form TTR
the block following the one read into
storage and the serial number of the volum
which the block was found.

Maintaining
lintain and Modify the Catalog and VTOC

-----------------------------------------------------------------------------------------------------------------------T
Macro-Instructions Required to Perform Function I 1 list-addrx 10 alias name-relexp
---------------T-------------.-----·---------------------------------,--------------------------------------------+
Name 1 Operation I Operands I
points to the parameter list (labeled specifies the main storage location of the
list-name) set up by the CAMLST macro- name that is to be used as an alias for a high
--------------+---------------+-------------------------------------------------------------------------------------+
[symbol] I LOCATE I list-addrx 1 I
instruction. level index. The area that contains the name
[list-name] i CAMLST i NAME,dsname-relexp6, [cvol-relexp7],area-relexpg i must be eight bytes long. The name must be
.:2 _____ ._,....1 .......... _ defined ny a C-type Define Constant (DC)
----------------+--------------~-------------------------------------------------------------------------------------+ !:' instruction.
[symbol] i LOCATE i list-addrx 1. I
J..1Cl.1UC -..L CoL'C ......

specifies the main storage location of the


[list-name] I CAMLST I BLOCK,ttr-relexp3,[cvol-relexp7 1,area-relexp9 I fully qualified name of a data set or index 11 new name-relexp
----------------+--------------+----------------------~---------------------------------------------------------------+ level. The name cannot exceed 44 characters_ specifies the main storage location of a fully
[symbol] 1 INDEX I list-addrx1 I If the name is less than 44 characters, it
[list-name] I CAMLST 1 BLDX,name-relexp2, [cvol-relexp7] I
qualified data set name that is to be used to
must be followed by a blank. The name must be rename a data set. The area that contains the
---------------+-------------t------------------------------------------------------------------------------------+
[symbol] 1 INDEX 1 list-addrx 1 I
defined by a C-type Define Constant (DC) name must be 44 bytes long. The name must be
instruct~on. defined by a C-type Define Constant (DC)
[list-name] 1 CAMLST 1 BLDG,name-relexp2, [cvol-relexp 7 1" [DELETE.1:5], [EMPTy16] ,mlmber-absexp17 I
instruction.
---------------+--------------+----------------------------------------------------------------------------------+
[symbol] 1 INDEX 1 list-addrx 1 I 1.2 new cvol-relexp
[list-name] 1 CAMLST 1 BLDA,index name-relexps,[cvol-relexp7],alias name-relexp10 I 3 ttr-relexp specifies the main storage location of the
----------------+---------------t--------------------------------------------------------------------------------------+
[symbol] 1 INDEX 1 list-addrx1 I
specifies the main storage location of a 6-byte volume serial number of the control
3-byte relative track address (TTR). This volume that is to be connected to another
[list-name] I CAMLST I DLTX,name-relexp2, [cvol-relexp7] I address indicates the position, relative to control volume.
---------------+--------------+------------------------------------------------------------------------------------+
[symbol] I INDEX I list-addrx 1 I
the beginning of the catalog data set, of the
track containing the block (TT), and the block
[list-name] 1 CAMLST 1 DLTA,index name-relexp5, [cvol-relexp7] I identification on that track (R).
----------------+---------------+--------------------------------------------------------------------------------------+
[symbol] 1 INDEX 1 list-addrx 1 I
13 vol list-relexp
specifies the main storage location of an area
[list-name] I CAMLST I LNKx,index name-relexp5,[cvol-relexp7],new cvol-relexp12 I " cchhr-relexp that contains a volume list. The area must
---------------+---------------+--~---------------------------------------------------------------------------------+ specifies the main storage location of the begin on a half-word boundary.
[symbol] ! INDEX ! list-addrx1 ! 5-byte absolute track address <CCHHR) -~ -a
DRPX,index name-relexp5, [cvol-addrx 7 ]
UL
[list-name] 1 CAMLST I I DSCB. 1~ wk area-relexp
--------------~+--------------+--------------------------------------------------------------------------------------+ specifies the main storage location of a
[symbol] 1 CATALOG I list-addrx 1 1 350-byte work area that you must define. The
[list-name] 1 CAMLST I CAT,name-relexp2,[cvol-relexp7],vol list-r elexp13 I 5 index name-relexp work area must begin on a double-word bounda-
---------------+---------------+--------------------------------------------------------------------------------------+
[symbol] 1 CATALOG 1 list-addrx 1 I
specifies the main storage location of the ry.
name of a high level index. The area that
[list-name] I CAMLST I UNCAT,name-relexp2,[cvol-relexp7] I contains the name must be eight bytes long. If a data set name was specified, the first 96
--------------+---------------+--------------------------------------------------------------------------------------+
[symbol] 1 CATALOG 1 list-addrx1 I
The name must be defined by a C-type Define bytes contain the data portion of a format 1
DSCB, and the next five bytes contain the
Constant (DC) instruction.
-[list-namel- -I Cl...MliST I RECAT,name-relexp2, ~cvol-relexp7] ,vol list-reiexp13 I absolute track address of the DSCB. The rest
---------------+---------------+-------------------------------------------------------------------------------------+
[symbol] 1 OBTAIN 1 ·list-addrx 1 I
of the area is used as a work area by the
OBTAIN routine.
6 dsname-relexp
[list-name] I CAMLST 1 SEARCH,dsname-relexp6,vol-relexpB,wk area-relexp1~ I specifies the main storage location of a fully
----------------+---------------+-------------------------------------------------------------------------------------,
[symbol] 1 OBTAIN I list-addrx 1 1
qualified data set name. The area that If an absolute track address was specified,
the first 140 bytes contain the key portion
contains the name must be 44 bytes long. The
[list-name] I CA¥LLST I SEEK ,cchhr-relexp~, vol-relexpB, 'Ilk area-relexp1.~ 1 name must be defined by a C-type Define and data portion of the DSCB. The rest of the
----------------+---------------f--------------------------------------------------------------------------------------,
[symbol] 1 SCRATCH 1 list-addrx1 I
Constant (DC) instruction. '4f area is used as a work area by the OBTAIN
routine.
[list-name] I CAMLST I SCRATCH,dsname-relexp6"vol list-relexp13,,[OVRD1B] I
7 cvol-relexp
----------------+---------------+-------------------------------------------------------------------------------------~ specifies the main storage location of a
[symbol] I RENAME I list-addrx 1 . I
[list-name] I CAMLST I RENAME,dsname-relexp6,new name-relexp11,vol list-relexp13 I 6-byte volume serial number for the volume to 1.5 DELETE
be processed. If this parameter is not speci- specifies that all data sets dropped from a
----------------~--------------~--------------------------------------------------------------------------------------+ fied, the system residence volume is proc-
rs refer to the enumerated list of explanations for the operands. 1 generation data group are to be deleted, i.e.,
essed. the space allocated to the data sets is to be
----------------------------------------------------------------------------------------------------_._----------------~
made available for reallocation.
B vol-relexp
specifies the main storage location of the 1.6 EMPTY
6-byte serial number of the volume on which specifies that references to all data sets in
the required DSCB is stored_ a generation data group cataloged in thE
generation index are to be removed from the
9 area-relexp index when the number of entries specified is
specifies the main storage location of a exceeded.
265-byte work ared that you must define. The
work area must begin on a double-word bounda- ~7 number-absexp
ry_ The first 256 bytes of the work area will specifies the number of data sets to be
contain the block that is read from the included in a generation data group. This
catalog, and the last nine bytes of the work number must be specified, and cannot exceed
area will contain the relative track adjress 255.
and block identification (in the form TT~) of
the block following the one read into main 1.8 OVRD
storage and the serial number of the volume on specifies that the expiration date in the DSCB
which the block was found. should be ignored_

Maintaining the Catalog and the Volume Table of Contents 23


EXCEPTIONAL RETURN CONDITION CODES

Control is always returned to the instruction that follows the LOCATE, INDEX, CATALOG, OBTAIN, SCRATCH, or RENAME macro-instr'lJ;ction. If the function has
been performed successfully. register 15 contains zeros. Oth€rwise.register 15 contains a condition code that indicates the reason for the failure.
The condition codes for the macro-instructions are as follows:

r----------------------------------------------------,
r----------------------------------------~-----------,
I INDEX Macro-Instruction ! r----------------------------------------------------l
( CATALOG Macro-Instruction i
i LOCATE Macro-Instruction I ~----------------------------------------------------i ~----------------------------------------------------~
~----------------------------------------------------1 Code Interpretation Code Interpretation I
Code Interpretation I
4 Either the required control volume was not 4 Either the required control volume was not I
4 Either the required control volume was not mounted, or the specified volume does not mounted, or the specified volume does not
mounted or the specified volume does not contain a catalog data set (SYSCTLG).
I
contain a catalog data set (SYSCTLG). I
contain a catalog data set (SYSCTLG). The I
volume serial number of the required vol- 8 The existing catalog structure is incon- 8 The existing catalog structure is incon-
ume is contained in bytes 260-265 of the sistent with the operation performed.
I
sistent with the operation performed. I
work area. Because the INDEX macro-instruction uses Because the INDEX macro-instruction uses I
the search routine of the LOCATE macro- the search routine of the LOCATE macro-
8 One of the names of the qualified name was instruction, register 1 contains the instruction, register 1 contains the
not found. Register 0 contains the number condition code that would be given by the condition code that would be given by the
of the last valid name in the qualified LOCATE macro-instruction, and register 0 LOCATE macro-instruction, and register 0
name. For example, if the qualified name contains the number of index levels contains the number of index levels
A.B.C.D were specified, but name C did not referred to during the search. referred to during the search.
exist at the level specified, register 0
~ould contain the binary code 2. The work 12 An attempt was made to delete an index or 12 Not used with the CATALOG macro-
area contains the first index block of the generation index that has an alias or has instruction.
last valid index name, the serial number indexes or data sets cataloged under it.
of the volume containing the index (in The index is unchanged. 16 The index structure necessary to catalog
bytes 260-265), and the relative track the data set does not exist.
address (in bytes 257-259) of the next 16 The qualified name specified when building
index block. an index or generation index implies an 20 Space is not available on the specified
index structure that does not exist: the control volume.
12 Either an index, an alias, or a control high level index, specified when connect-
volume pointer was found when the list of ing control volumes, does not exist. 24 An attempt was made to catalog an
qualified names was exhausted. improperly named generation data set.
20 Space is not available .on the specified
16 A data set resides at some level of index control volume. 28 A permanent I/O error was found when
other than the lowest index level speci- processing the catalog.
fied. Register 0 contains toe number of 24 Not used with the INDEX macro-instruction. t - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -______________ J
simple names referred to before the data I
set was found. For example, if the quali- 28 A permanent I/O error was found when I
fied name A.B.C.D were specified, and a IL _________________
processing- __________________________________ JI
the catalog.
data set were found cataloged at A.B.C,

L 3.
register 0 would contain the binary code r----------------------------------------------------,
t SCRATCH Macro-Instruction I r----------------------------------------------------,
I RENAME Macro-Instruction I
I ~----------------------------------------------------i ~----------------------------------------------------~
I 20 A syntax error exists in the name (e.g., Code Interpretat ion I Code Interpretation
i nine characters, a double delimiter, blank )
I name field, etc.). 4 No volumes containing any part of the data i 4 No volumes containing any part of the data
I set were mounted, nor was a UCB address I set were mounted, nor was a UCE address
I 24 A permanent I/O error was found when contained in register o. I contained in register o.
I processing the catalog. I
I 8 An unusual condition was encountered on I 8 An unusuaL condition was encountered on
I If the LOCATE macro-instruction fails to perfo~m one or more volumes. I one or more volumes.
I its function for any of the reasons indicated I
I above, register 0 contains the number of indexes After the SCRATCH macro-instruction is executed, I After the RENAME macro-instruction is executed,
IL ___________________________________________________
,i
searched before the failure was encountered. _ the last byte of each 12-byte volume pointer in I the last byte of each 12-byte volume pointer in
the volume list indicates the following condi- I toe volume list indicates the following condi-
tions in binary code: tions in binary code:
Interpretation
I Code Interpretation
o The DSCB for the data set has been deleted I
r-----------------------------·-----------------------, from the VTOC on the volume pointed to. I o The DSCB for the data set has been renamed
I OBTAIN Macro-Instruction I I in the VTOC on the volume pointed to.
~----------------------------------------------------~ 1 The VTOC of this volume does not contain I
I Code Interpretation I the DSCB to be de leted. I 1 The VTOC of this volume does not contain
I J I the DSCB to be renamed.
I 4 The required volume was not mounted. I 3 The DSCB was not deleted because either I
I I the OVRD option was not specified or the I 3 A DSCB containing the new name already
I 8 The DSCB was not found in the VTOC of the J
retention cycle has not expired. I exists in the VTOC of this volume.
I specified voIume. I I
I I 4 A permanent I/O error was found when I 4 A permanent I/O error was found when
I 12 A permanent 1,0 error was found when I processing this volume. I processing this volume. I
IL____________________________________________________
processing the specified volume. JI
I I
5 A device for mounting this volume was I 5 A device for mounting this volume was I
unavailable. I unavailable. I
I i
6 The operator was unable to mount this I 6 The operator was unable to mount this I
volume.
____________________________________________________ JI IL __________________________________________________
volume. JI

24
APPENDIX A: CATALOG BLOCK ENTRIES

This section describes the contents of all catalog entries.

Control Entries

A volume index control entry is always the first entry in a volume


index. The volume index control entry is 22 bytes long and contains
eight fields.
Field 1: Name Field (8 bytes) -- contains only a binary one to ensure
that this entry is the first entry in the first block of the index.
Field 2: Last Block Address (3 bytes) -- contains the relative track
address of the last block in the volume index. The address is in the
form TTR.
Field 3: Half-word Count (1 byte) -- contains a binary five to indicate
that five half words follow.
Field 4: Catalog Upper Limit (3 bytes) -- contains the relative track
address of the last block in the catalog data set. The address is in
the form TTR.
Field 5: Zero Field (1 byte> -- contains binary zeros.
Field 6: First Available Block Address (3 bytes) contains the
relative track address of the unused block in the catalog that is
closest to the beginning of the catalog data set.
Field 7: Zero Field (1 byte) -- contains binary zeros.
Field 8: Unused Bytes in Last Block (2 bytes) -- contains the binary
count of the number of unused bytes in the last block of the volume
index.

An index control entry is the first entry in all indexes except


volume indexes. The index control entry is 18 bytes long and contains
six fields.
Field 1: Name Field (8 bytes) -- contains only a binary one to ensure
that this entry, because it has the lowest binary name value, is the
first entry in the first block of the index.
Field 2: Last Block Address (3 bytes) -- contains the relative track
address of the last block assigned to the index. The address is in the
form TTR.
Field 3: Half-word count (1 byte) contains a binary three to
indicate that three half words follow.
Field 4: Index Lower Lin,it (3 bytes) -- contains the relative track
address of the block in which this entry appears. The address is in the
form TTR.
Field 5: Number of Aliases (1 byte) -- contains the binary ccunt of the
number of aliases assigned to the index. If the index is not a hiyh
level index, this field is zero.
Field 6: Unused Bytes in Last Block (2 bytes) -- contains the Linary
count of the number of unused bytes remaining in the last block of the
index.

Maintaining the Catalog and the Volurre Table of Contents 25


An index link entry is the last entry in all index blocks. The entry
is 12 bytes long and contains three fields.

Field 1: Name Field (8 bytes) -- contains only the hexadecimal number


FF to ensure that this entry, because it has the highest binary name
value, will appear as the last entry in any index block.

Field 2: Link Address (3 bytes) -- contains the relative track address


of the next block of the same index, if there is a next block in the
index. Otherwise, the field contains binary zeros.

Field 3: Half-word count (1 byte) contains a binary zero to indicate


that no additional fields follow.

Pointer Entries

An index pOinter entry can appear in all indexes except generation


indexes. The entry is 12 bytes long and contains three fields.

Field 1: Name Field (8 bytes) -- contains the name of the index being
pointed to by field 2.

Field 2: Index Address (3 bytes) -- contains the relative track address


of the first block of the index named in field 1. The address is in the
form 'ITR.

Field 3: Half-word count (1 byte) -- contains a binary zero to indicate


that no additional fields follow.

A data set pointer entry can appear in any index. It contains the
simple name of a data set ana from one to five 12-byte fields that each
identify a volume on which the named data set resides. If the data set
resides on more than five volumes, a volume control block n:ust be used
to point to the volumes. The volume control block is identified by a
volume control block pointer entry, not a data set pointer entry.

The data set pointer entry varies in length. The length is


determined by the formula (14+12w), where IT is the number of volumes
containing the data set. The variable m can be from 1 through 5. The
d.ata set pointer entry can appear in any index, and it contains five
fields.

Field 1: Name Field (8 bytes) -- contains the simple name of the data
set whose volurres are identified in field 5.

Field 2: Address Field (3 b}tes) -- contains a binary zero.

Field 3: Half-word count (1 byte) -- contains the binary count of the


numter of half words that follow. The nun:ber is found by the formula
(6m+1), where m is the number of volumes on which the data set resides.
The variable m can be from 1 through 5.

Field 4: Volume count (2 bytes) -- contains the binary count of the


nurrber of volumes identifiea in field 5 of this entry.

Field 5: Volume Entries (12 to 60 bytes) -- contains from one to five


12-byte entries, each of which identifies a volume on which the data set
resides. Each entry contains a 4-byte device code, a 6-byte volume
serial nurrber, and a 2-~yte data set sequence number. The data set
sequence nUITber is zero for direct-access volumes.

A volume control block pointer entry can appear in any index. It can
identify up to 20 volurres. The entry is 14 bytes long and contains four
fields.

26
Field 1: Name Field (8 bytes) contains the last name of the
qualified name of the data set identified by this entry. The data set
resides on the volumes whose serial numters are given in the volurre
control block pointed to by field 2.

Field 2: Address Field .(3 bytes) -- contains the relative track address
of the volume control block identifying the volumes containing the data
set named in field 1. The address is in the form ~TR.

Field 3: Half-word count (1 byte) contains a binary one to indicate


that one half word follows.

Field 4: Zero Field (2 bytes) -- contains binary zeros.

A control volume pointer entry can appear only in volume indexes. It


is 18 bytes long and contains four fields.

Field 1: Name Field (8 bytes) -- contains a high level index name that
appears in the volume index of the control volume identified in field 4.

Field 2: Address Field (3 bytes) -- contains binary zeros.

Field 3: Half-word count (1 byte) contains a binary three to


indicate that three half words follow.

Field 4: Control Volmne Serial Number (6 bytes) -- contains the serial


number of the control volume whose volume index contains an entry
identifying the high level index name in field 1.

An alias entry can appear in voluITe indexes only. An alias entry is


20 bytes long and contains four fields.

Field 1: Name Field (8 bytes) -- contains the alias of the high level
index identified in field 2.

Field 2: Address Field (3 bytes) -- contains the relative track address


of the first block of the index named in field 4. The address is in the
form TTR.

Field 3: Half-word Count (1 byte) -- contains a binary four to indicate


that four half words follow.

Field 4: True Name Field (8 bytes) -- contains the name of the index
whose alias appears in field 1. The address of the index is in field 2.

A generation index pointer entry can appear in all indexes except


generation indexes. The entry is 16 bytes long and contains six fields.

Field 1: Name Field (8 'bytes) -- contains the name of the generation


index whose address is contained in field 2.

Field 2: Address Field (3 bytes) -- contains the relative track address


of the generation index named in field 1. The address is in the form
TTR.

Field 3: Half-word Count (1 byte) -- contains a binary two to indicate


that two half words follow.

Field 4: Flags (1 byte) -- contains flags that govern the uncataloging


of data sets as specified by the DELETE and EMPTY options of the INDEX
macro-instruction. The options and their hexadecimal codes are as
follows:

Maintaining the Catalog and the Volume Table of Contents 27


EMPTY=Ol DELETE=02 EMPTY and DELETE=03

Field 5: MaximuITr Generations Allowed (1 byte) -- contains the binary


count of the maximum number of generations allowed in the index at one
time as specified in the INDEX macro-instruction.

Field 6: Current Generation Count (2 bytes) -- contains the binary


count of the number of generations cataloged in the index.

The Volume Control Block Contents

A volume control block is composed of one or more volume-list blocks.


Each volume-list block contains an 8-byte key and a 256-byte data
portion. The data portion of the volume-list block can identify up to
20 volumes on which a data set is recorded. The format of the volume
list block is as follows:
Field 1: Number of volumes (2 tytes) -- the first volume-list block
contains the binary count of volumes on which the data set is stored;
the value of this field is reduced by 20 for each subsequent volume-list
block. If a data set is on 61 volumes, for example, it has four
volume-list blocks. The first field of each block contains 61,41,21,
and 1, respectively.

Field 2: Volume Identification (12 to 240 bytes) -- contains from 1 to


20 12-byte entries, each of which identifies a volume on which the data
set resides. Each entry contains a 4-byte device code, a 6-byte volume
serial number, and a 2-byte aata set sequence number. The data set
sequence number is zero for direct-access voluroes.

Field 3: Zero Field (10 bytes) -- contains binary zeros.

Field 4: Chain Address (3 bytes) -- contains the relative track address


of the next block of this volume control block, if additional blocks
exist. The address is in the form TTR. If this is the last block of
the volume control block, the field contains a binary zero. If this
field is not zero, this block must contain twenty 12-byte fields
identifying volumes of the data set.
Field 5: Zero Field (1 byte) -- contains binary zeros.

28
APPENDIX B: DEVICE CODE DESIGNATIONS

Device Code
Designation
Device Features (In Hexadecimal>

IBM 2400 Series Magnetic


Tape Units 30008001

IBM 2400 Series Magnetic


Tape Units 7-track Compatibility 30808001

IBM 2400 Series Magnetic 7-track Compatibility


Tape Units Data Conversion 30C08001

IBM 2400 Series Magnetic


Tape Units Phase Encoding 34008001

IBM 2400 Series Magnetic Phase Encoding


Tape Units with Dual Density 34208001

IBM 2311 Disk Storage Drive 30002001

IBM 2301 Drum Storage 30402002

IBIvl 2302 Disk Storage 30002004


IBM 2303 Drum Storage 30002003

IBlvJ 2314 Direct Access


Storage Facility 30C02008

Maintaining the Catalog and the Volume Table of Contents 29


ADDING SVC ROUTINES TO THE CONTROL PROGRAM

This chapter provides detailed


information on how to write an SVC routine
and insert it into the control program
portion of the System/360 Operating System.
Before reading this chapter, you should
be familiar with the information contained
in the prerequisite publications listed
below.
Documentation of the internal logic of
the supervisor and its relationship to the
remainder of the control program can be
obtained through your IBM Branch Office.

PREREQUISITE PUBLICATIONS
The IBM System/360 Operating System:
Assembler Language publication (Form
C28-6514) contains the information neces-
sary to code programs in the assemtler
language.
The IBM System/360 Operating System:
Control Program Services publication (Form
C28-6541) describes the system macro-
instructions that can be used in programs
coded in the assembler language.

Adding SVC Routines to the Control Program 31


WRITING SVC ROUTINES

Because your SVC routine will be a part cf the control program, you
must follow the same programming conventions used in SVC routines
supplied with System/360 Operating System.
Four types of SVC routines are su~plied with System/360 Operating
System, and the programming conventions for each type differ. The
general characteristics of the four types are described in the following
text, and the programming conventions for all types are shown in tabular
form.
Characteristics of SVC Routines
All SVC routines operate in the supervisor state. You should keep
the following characteristics in mind when deciding what type of SVC
routine to write:

• Location of the routine - Your SVC routine can be either in main


storage at all times as part of the resident control program, or on
a direct-access device as part of the SVC library. Type 1 and 2 SVC
routines are part of the resident control program, and types 3 and 4
are in the SVC library •
• Size of the routine - Types 1, 2, and 4 SVC routines are not limited
in size. However, you nust divide a type 4 SVC routine into load
modules of 1024 bytes or less. The size of a type 3 SVC routine
must not exceed 1024 bytes.
• Design of the routine - Type 1 SVC routines must be reenterable or
serially reusable; all other types must be reenterable .
• Interruption of the routine - When your SVC routine receives
control, the CPU is masked for all maskable interruptions but the
machine check interruption. All type 1 SVC routines must execute in
this masked state. If you want to allow interruptions to occur
during the execution of a type 2, 3, or 4 SVC routine, you must
change the appropriate niasks. If you expect that a type 2, 3, or 4
SVC routine will run for an extended period of time, it is
recommended that you allow interruptions to be processed where
possible.
Programming Conventions for SVC Routines
The programming conventions for the four types of SVC routines are
summarized in Table 1. Details about many of the conventions are in the
reference notes that follow the table. The notes are referred to by the
numbers in the last column of the table. If a reference note for a
convention does not pertain to all types of SVC routines, an asterisk
indicates the types to which the note refers.

32
Table 1. Programming conventions for SVC Routines
r---------------------T-----------T------T---------T--------T----------,
I I I I I IReference I
I Conventions I Type 1 IType 21 Type 3 IType 4 I Code I
I I I I I I I
~---------------------t-----------t------t---------t--------t----------~
Ipart of resident I Yes I Yes I No I No I I
Icontrol program I I I I I I
~----------------------t-----------t------t---------t--------t----------~
ISize of routine I Any I Any I ~ 1024 lEach I I
I I I I 1:ytes Iload I I
I I I I I module I I
I I I I I ~ 1024 I I
I I I I l1:ytes I I
~---------------------t-----------t------t---------t--------t----------~
IReenterable routine I Optional, I ~es I Yes I Yes I 1 I
I Ibut rrust I I I I I
I Ibe seriallyl I I I I
I I reusable I I I I I
~---------------------t-----------t------t---------t--------t----------~
IMay allow inter- I No I Yes I Yes I Yes I 2 I
Iruptions I I I I I I
~---------------------t-----------~------~---------~--------+----------~
IEntry point I~ust be the first 1:yte of the routinel I
I lor load module, and must be on a I I
I I double-word 1:oundary I I
~---------------------+-------------------------------------t----------i
INumber of routine INumbers assigned to your SVC routines I I
I Ishould be in descending order from I I
I 1 2 5 5 through 200 I I
~----------------------t-----------T------T---------~-------t----------i
IName of routinE; IIGCnnn IIGCnnnlIGCOOnnn IIGCssnnnl 3 I
~---------------------t-----------~------~---------~--------t----------i
IRegister contents at IRegisters 3, 4, 5, and 14 contain I 4 I
lentry time Icommunication pointers; registers 0, I I
I 11 , and 15 are parameter registers I I
~---------------·------t-----------T------T---------T--------+----------i
IMay contain reloca- I Yes I Yes I No* I No* I 5 I
Itable data I I I I I I
~---------------------t-----------t------+---------t--------t----------~
ICan supervisor re- I Not I Yes* I Yes* I Yes* I 6 I
Iquest block (SVRB) belapplica1:le I I I I I
I extended I I I I I I
~---------------------t-----------t------t---------t--------t----------~
IMay issue WAIT macro-I No I Yes* I Yes* I Yes* I 7 I
I instruction I I I I I I
~---------------------t-----------t------t--------·-t--------t----------~
IMay issue XCTL macro-I No I No I No I Yes* I 8 I
I instruction I I I I I I
~---------------------t-----------t------t---------t--------t----------~
IMay pass contral to I None I Any I Any I Any I I
Iwhat other types of I I I I I I
ISVC routines I I I I I I
~---------------------t-----------t------~-·------~-~--------t----------i
IType of linkage with I Not I Issue supervisor call I I
lather SVC routines lapplicable I (SVC) instruction I I
~---------------------t-----------~-------------------------t----------~
IExit from SVC Routine I Branch using return register 14 I I
~---------------·------t-----------T-------------------------t----------i
IMethod of abnormal IUse resi- IUse ABEND I 9 I
I termination Ident abnor-Imacro-instruction or I I
I Imal termi- Iresident abnormal I I
I Ination rou-Itermination routine I I
IL _____________________ Itine
~ ___________ I _________________________ I __________ JI
~ ~

Adding SVC Routines to the Control Program 33


Reference SV Routine
- Code ~ Reference Notes

1 all If your SVC rcutine is to be reenterable, you


cannot use macro-instructions whose expansions
store information into an in-line parameter list.
2 all You should write SVC routines so that program
interruptions cannot occur. If a program inter-
ruption does eccur during execution of an SVC
routine, the routine loses control and the task
that called the routine terminates.
If a program interruption occurs and you are
modifying a serially reusable SVC routine, a
system queue, control blocks, etc., the modifica-
tion will never complete; the next time the
partially modified code is used, the results will
be unpredictatle.

3 all You must use the following conventions ~hen


naming SVC routines:
• Types 1 and 2 roust be named IGCnnn; nnn is
the decimal nurrber of the SVC routine. You
rrust specify this nawe in an ENTRY, CSECT, or
START instruction.
• Type 3 must te named IGCOOnnn; nnn is the
signed decimal nurober of the SVC routine.
This name must be the name of a member of a
partitioned data set.
• Type 4 must be named IGCssnnn; nnn is the
signed decimal number of the SVC routine, and
ss is the nuwber of the load module minus
one, e.g., ss is 01 for the second load
module of the routine. This naroe roust be the
name of a member of a partitioned data set.

4 all Before your SVC routine receives control, the


contents of all registers are saved. For type 4
routines, this applies only to the first load
module of the routine.
In general, the location of the register save
area is unknown to the routine that is called.
When your SVC routine receives control, the
status of the registers is as fellows:
• Register 0 and 1 contain the same information
as when the SVC routine was called.
• Register 2 contains unpredictable informa-
tion.
• Register 3 contains the starting address of
the communication vector table.
• Register 4 contains the address ef the task
control block (TCB) of the task that called
the SVC routine.

34
Reference SVC Routine
Code Types Reference Notes

• Register 5 contains the address of the super-


visor request tlock (SVRB), if a type 2, 3,
or 4 SVC routine is in control. If a type 1
SVC routine is in control, register 5 con-
tains the address of the last active request
tlock.

• Register 6 through 12 contain unpredictable


information.

• Register 13 contains the same information as


when the SVC routine was called.

• Register 14 contains the return address.

• Register 15 contains the same information as


when the SVC routine was called.
You must use registers 0, 1, and 15 if you want
to pass inforrr.ation to the calling program. The
contents of registers 2 through 14 are restored
when control is returned to the calling prograrr.
5 3,4 Because relocatatle address constants are not
relocated when a type 3 or 4 SVC routine is
loaded into main storage, you cannot use them in
coding these routines; nor can you use macro-
instructions whose expansions contain relocatable
address constants. Types 1 ana 2 are not
affected by this restriction since they are part
of the resident control program.
6 2,3,4 You can extend the SVRB, in 8-byte increments,
from 96 bytes up to 144 bytes. The extended area
is available as a work area during execution of
your routine only if you specify the extension
during the system generation process. When your
SVC routine receives control, register 5 contains
the address of the SVRB to which the extended
save area is appended.
7 2,3,4 You cannot issue the WAIT macro-instruction
unless you have changed the system mask to allow
I/O and external interruptions. If you have
allowed these interruptions, you can issue WAIT
macro-instructions that await either single or
multiple events. The event control block (ECB)
for single-event waits or the ECB list and ECBs
for mUltiple-event waits must be in dynamic main
storage.
8 4 When you issue an XCTL macro-instruction in a
routine under control of a type 4 SVRB, the new
load module is brought into a transient area.
The contents of registers 2 through 13 are
unchanged when control is passed to the load
module; register 15 contains the entry point of
the called load module.

Adding SVC Routines to the control Progran: 35


Reference SVC Routine
Code Types Reference Notes
9 all Type 1 SVC routines must use the resident abnor-
mal termination routine to terminate any task.
The entry point to the abnormal termination
routine is in the communication vector table
(CVT). The symbolic name of the entry point is
CVTBTERM.
Type 2, 3, and 4 SVC routines must use the ABEND
macro-instruction to terminate the current task,
and IIiUSt use the resident abnormal termination
routine to terminate a task other than the
current task.
Before the resident abnormal termination routine
is entered, the CPU must be masked for all
maskable interruptions but the machine check
interruption, and registers 0, 1, and 14 must
contain the following:
• Register 0 contains the address of the TCB of
the task to be terminated.
• Register 1 contains the following informa-
tion:
Bit 0 is a 1 if you want a dump taken.
Bit 1 is a 1 if yeu want to terminate a job
step.
Bits 2-7 are zero.
Bits 8-19 contain the error code.
Bits 20-31 are zero.
• Reqister 14 contains the return address. The
resident abnormal termination routine exits
by branching to the address contained in
register 14.
The contents of register 15 are destroyed by the
abnormal termination routine.

36
INSERTING SVC ROUTINES INTO THE CONTROL PROGRAM
You insert SVC routines into the control program during the system
generation process.
Before yo~r SVC routine can be inserted into the control program, the
routine must be a member of a cataloged partitioned data set. You must
name this data set SYS1.name.
The following text gives a description of the information you must
supply during the system generation process. You will find a descrip-
tion of the macro-instructions required during the system generation
process in the publication IBM System/360 Operating System: System
Generation, Form C28-6554.
Specifying SVC Routines

You use the SVCTABLE macro-instruction to specify the SVC number, the
type of SVC routine, and, for type 2, 3, or 4 routines, the number of
double words in the extended save area.
Inserting SVC Routines During the System Generation Process
To insert a type 1 or 2 SVC routine into the resident control
program, you use the RESMODS macro-instruction. You must specify the
name of the partitioned data set and the names of the members to be
inserted into the control program. Each member can contain more than
one SVC routine.
To insert a type 3 or 4 SVC routine into the SVC library, you use the
SVCLIB macro-instruction. You must specify the name of the partitioned
data set and the names of members to be included in the SVC library.
The member names must conform to the conventions for naming type 3 and 4
routines, i.e., IGCOOnnn and IGCssnnn.

Adding SVC Routines to the Control Program 37


ADDING AN ACCOUNTING ROUTINE TO THE CONTROL PROGRAM

This chapter provides detailed informa-


tion on how to write an accounting rcutine
and insert it into the control program
portion of System/360 Operating System.
Before reading this section, you should
be familiar with the information contained
in the prerequisite publications listed
below.
Documentation of the internal lcgic of
the scheduler can be obtained through your
IBM Branch Office.

PREREQUISITE PUBLICATIONS
The IBM System/360 Operating Systew:
Assemtler Lan~ publication (Forrr
C28-6514) contains the information neces-
sary to code programs in the assemtler
language.
The IBM System/360 Operating System:
Control Program Services publication (Forrr
C28-6541) descrites the system macro-
instructions that can be used in prograws
coded in the assembler language.

Adding an Accounting Routine to the Control Program 39


~RITING AN ACCOUNTING ROUTINE
The conventions that you must follow when writing an accounting
routine and the accounting informaticn that is supplied by the operating
system are described in the following text.

Entry to the Accounting Routine: Your accounting routine receives


control during job and step terrrination. The entry point of your
accounting routine must be named IEFACTRT. You can specify this name in
either a CSECT staterrent or an ENTRY statement.
The first sequence of instructions in your routine must save the
contents of registers 0 through 14. You can use the SAVE macro-
instruction to perform this function; register 13 contains the address
of a register save area.

Input to the Accounting Routine: Register 1 contains the starting


address of a list of pointers to accounting information. Each pointer
is on a full-word boundary. The items in the list ana the order in
which they appear are as follows:
1. 4-byte pointer to the 8-byte jot name area.
2. 4-byte pointer to the 8-byte step name area. The pointer to the
step name is zero when the job is terminated.
3. 4-byte pointer to the 20-byte prograrrmer's name area.
4. 4-byte pointer to the job running time. 1 The job running time is
contained in the first three bytes of a 4-tyte area. The last byte
contains the number of jeb accounting data fielas.
5. 4-byte painter to the job accounting data fields. If the JOB
statement did not contain accounting information this pointer
indicates a four-byte field whose last byte is zeroed. These data
fields contain the accounting information that was specified in the
JOB statement. The first byte of each data field contains the
number of bytes of data that follow. All job accounting data
fields are contiguous in main storage. The last data field is
followed by a byte of zeros.
6. 4-byte painter to the step running tirre. 1 The step running time is
contained in the first three bytes of a 4-byte area. The last byte
contains the number of step accounting data fields. The pointer to
the step running time is zero when the job is terminated.
7. 4-byte pointer to the step accounting data fields. These fields
contain the accounting information that was specified in the EXEC
statement. The first byte of each data field contains the number
of bytes of data that follow. All step accounting data fields are
contiguous in main storage. The last data field is followed by a
byte of zeros. If the EXEC statement did not contain an
ACCT=parameter, the pointer ind~cates a one-byte field of zeros.
The pointer to the step accounting data fields is zero when the jot
is terminated.

1Job running time and step running time are not supplied unless you have
selected multiprogramming with a variable nurrter of tasks and intsrval
timing. However, if only timing is selected, you can use the timer
macro-instructions in your accounting routine. An explanation of these
features is contained in the publication IBM System/360 Operating
System: Storage Estimates, Form C28-6551.

40
Output from the Accounting Routine: You can write output in two ways:
by issuing console messages or by using the standard systerr output.
1. Console messages -- You can use Write to Operator (WTO) or Write to
Operator with Reply (WTOR) macro-instructions.
2. System output -- You must assemble the following calling sequence
into your routine. The contents of register 12 must be the saThe as
when your accounting routine was entered, and register 13 must
contain the address of an area cf 64 full words.

r---------T----------T-------------------------------------------------,
I Name I Operation I Operand I
t---------+-----------+-------------------------------------------------~
I I MVC I 36(4,12),MSGADDR MOVE MESSAGE ADDRESS AND I
I I MVC I 42(2,12),MSGLEN LENGTH TO SYSTEM TABLE. I
I I L I REG15,VCONYS BRANCH AND LINK TO MESSAGE I
I I BALR I REG14,REG15 ROUTINE I
I I I I
I I I I
I MSGADDR I DC I A(MSG) I
I MSG I DC I C'text of message' I
I MSGLEN I DC I H'two character length of ~essage' I
IL- VCONYS
________ I ___________
~
DC ~
I _________________________________________________
V(IEFYS) JI

Exit from the Accounting Routine: You can use the RETURN macro-
instruction to restore the contents of registers and return control to
the operating system.

INSERTING AN ACCOUNTING ROOTINE INTO THE CeNTROl PROGRAM

You can insert your accounting routine into the control prograrr
either before or after the systere generation process. In either caSE,
you must specify that you have an accounting routine. This is done
during the system generation process ty using the ACCTRTN option in the
SCHEDULR macro-instruction.
Inserting an Accounting Routine Befcre System Generation

To insert your accounting routine tefore systerr, generation, you link


edit it into the module library (SYS1.MODLIB) to replace the existing
ffiodule narred IEFACTRT. Detailed information atout using the linkage
editor is contained in the putlication IBM System/360 Operating System:
Linkage Editor, Form C28-6538.
Inserting an Accounting Routine After Systerr Generation

To insert your accounting routine after system generation, you link


edit your routine into the IEFSTERM and IEFJTERM modules of the 18K
scheduler; the IEFSTERM and IEFCNTRL nodules of the 44K scheduler; and
the IEFCNTRL module of the lOOK scheduler. You will be replacing the
existing control section IEFACTRT in these rrodules. The scheduler
modules are in the linkage litrary (SYS1.LINKLIB). The linkage editor
control statements you must use to insert your accounting routine in the
step ana job termination modules of each scheduler follow.

18K Scheduler
Step Termination Job Termination
ALIAS GO,IEFYN ALIAS IEFZA,IEFW23SD
ENTRY IEFSDOll ENTRY IEFZA
NAME IEFSTERM(R) NAME IEFJTERM(R)

Adding an Acccunting Routine to the Control Program 41


44K Scheduler

step Termination Joe Termination


ALIAS GO,IEFYN,IEFSD009 ALIAS IEFKA,IEFMC,IEFSD008,
ENTRY IEFSDOll IEFZA,IEF5DDHD
NAME IEFSTERM(R) ENTRY IEFKA
NAME IEFCNTRL(R)

lOOK Scheduler

Step and Job Termination


ALIAS GO,IEFKA,IEFYN
ENTRY IEFSDOll
NAME IEFCNTRL(R)

The following sequence of job control language and linkage editor


statements shows insertion of your accounting routine into the 18K
scheduler modules. Card input is assumed.

//jobname JOB (parameters)


//stepname EXEC PGM=IEWL, (pararr,eters)
//SYSPRINT DD SYSOUT=A
//SYSUTl DD UNIT=SYSDA,SPACE=(parameters)
//SYSL~OD DD DSNAME=SYS1.LINKLIB,DISP=OLD
//SYSLIN DD *

(accounting routine otject deck)

INCLUDE SYSLMOD(IEFSTERM)
ALIAS GO,IEFYN
ENTRY IEFSDOll
NAME IEFSTERlvJ (R)

(accounting routine object deck)

INCLUDE SYSLMOD(IEFJTERM)
ALIAS IEFZA,IEFW23SD
ENTRY IEFZA
NAME IEFJTERM(R)

This same statement sequence, with substitution of proper parallieters,


can be used with the 44K scheduler. The lOOK scheduler requires only
the one set of linkage editor statements ana one object deck.

42
NONSTANDARD LABEL PROCESSING ROUTINES;
VOLUME LABEL AND DUAL-DENSITY TAPE DEVICE
EDITOR ROUTINES

Section 1 of this chapter explains how


to write routines to process nonstandard
labels on magnetic tape, and how to add
them to the control program.
Section 2 of this chapter explains how
to write tape volume label and dual-density
tape device editor routines and insert them
in the control program in place ef IBM
supplied editor routines.
Before reading this chapter, you should
be familiar with the information contained
in the prerequisite publications listed
below. Documentation of the internal logic
of the standard label processing routines
can be obtained through your IBM Branch
Office.

Prerequisite Publications
The IBM System/360 Operating System:
Assembler Language publication (Forrr
C28-6514) contains the information neces-
sary to code programs in the assemtler
language.
The IBM System/360 Operating system:
Control Prograrr Services publication (For~
C28-6541) describes the macro-instructions
that are used to request services from the
control program.
The IBM System/360 Operating System:
System control Block publication (Form
C28-6628) contains format illustraticns and
field descriptions of the system control
blocks referred to in this chapter. This
publication also describes the format and
fields of standard magnetic tape latels.
The IBM System/360 Operating Systen~:
Data Management publication (Ferm C28-6537)
discusses magnetic tape labeling.

Label Processing Routines 43


SECTION 1: WRITING NONSTANDARD LABEL PROCESSING ROUTINES
For magnetic tape voluroes with nonstandard latels <i.e., input or
output header or trailer labels that do not conform to the standard
label format), you must write your own label processing routines. You
must also perform such functions as volume identification and volurr,e
positioning.
The appropriate nonstandard label processing routine is selected,
brought into main storage, and executed when the data control block is
either opened or closed, or when an end-of-volume or end-of-data set
condition occurs. When a nonstandard label processing routine has
completed, it must return control to the OPEN, CLOSE, or EOV routine,
which then continues its norrral processing. The following paragraphs
explain this flow of control between the control program and each type
of nonstandard label processing routine. Information on tape position-
ing and volume identification is also provided.
Input Header Label Routines
An input header label routine is brought into main storage when
either the OPEN or EOV routine is executed. Your routine ~s entered
after the control program has determined that a tape does not have
standard labels. When your routine receives control, the tape will have
been positioned at the interrecord gap preceding the nonstandard label.
If your routine determines that the wrong volume is mounted, you must
place a 1 in the high-order bit position of the SRTEDMCT field of the
unit control block (UCB), and return control to the control program.
The control program then issues a message to the operator requesting
that the correct volume be mounted. When the new volume is mounted,
your routine is entered again after the contrcl program has checked the
initial label.
Before returning control to the control program, you should, for
forward read operations, position the tape at the interrecord gap that
precedes the initial record of the data set; for backward read
operations, the tape should be positioned after the last record of the
data set.
Input ~railer Label Routine
An input trailer label routine is brought into main storage when the
EOV routine is executed. Your routine is entered when a tape mark is
encountered. When your routine receives control, the tape will have
been positioned, for forward read operations, immediately after the tape
mark at the end of the data set; for backward read operations,
immediately before the tape mark at the beginning of the data set.
You need not reposition the tape before returning control to the
control program.
Output Header Label Routines
An output header label routine is brought into main storage when
either the OPEN or EOV routine is executed. Your routine is entered
after the control program has determined that a tape does not have
standard labels. When your routine receives control, the tape will have
been positioned at the interrecord gap preceding the nonstandard label.
If your routine determines that the wrong volume is mounted, you must
place a 1 in the high-order bit position of the SRTEDMCT field of the
unit control block (UCB), and return control to the control program.
The control program issues a wessage to the operator requesting that the
correct volume be mounted. When the new volume is mounted, your routine

44
is entered again after the control program has checked the initial label
and positioned the tape.
You need not: reposition the tape before returning control to the
control program.

Output Trailer Label Routines


An output trailer label routine is brought into main storage when
either the EOV or CLOSE routine is executed. When your routine receives
control, the tape will have been positioned at the interrecora gap
following the last data set record that was written. After you have
written the tape mark and label, you need not reposition the tape before
returning control to the control program.
The output trailer label routine is also brought into main storage
when input data sets are closed. This allows ycu to position the tapes
if necessary.

Programming Conventions
This section describes the conventions to be followed when writing
your routines.

• Size of the routine - Nonstandard label processing routines are not


limited in size. However, if the size of such a routine exceeds
1024 bytes, you must divide the routine into load modules, each of
which is 1024 bytes or less. To pass control between load modules,
you must use the XCTL macro-instruction.

• Design of the routine - Nonstandard label processing routines must


be reenterable. Relocatable address constants cannot be used in
coding these routines or in coding any channel command words (CC~)
to be used in the routine; nor can macro-instructions be used whose
expansions contain relocatable address constants.
• Register usa(~ - The contents of registers 2 through 14 must be
saved when your routine receives control from the control progran,.
The contents of these registers must be restored before your routine
returns control.
• Entry Point of the routine - The entry point of the routine must be
the first byte of the load module, and must be on a double-word
boundary.
• Exit from the routine - The XCTL roacro-instruction (E-form) must be
used to exit from your routine and return control to a specific
cont"!:'ol program module. These modules differ depending both upon
the control program routine from which control was received, and the
type of label processing being perforrred.
Module names are shown below for each control program routine and
for each type of label processing routine.
Label Processing Routine Control Program Routine Module Name
Input Header OPEN IGG0190B
EOV IGG0550D
Input Trailer EOV IGG0550B
Output Header OPEN IGG0190R
EOV IGG0550H
output Trailer EOV IGGG550F
CLOSE IGG0200B

Label Processing Routines 45


• Work areas The GETMAIN macro-instruction must be used to obtain
main storage for all of your work areas, including those areas used
to read in or create a label. The FREEMAIN macro-instruction must
be used to release this main storage.
Program Functions

In processing nonstandard labels, you must perform many of the


functions that the control program performs in processing standard
labels. All I/O operations, as, for example, those required to read
labels, to write labels, and to position volumes, must be performed by
using the execute channel program (EXCP) macro-instruction. The use of
EXCP normally requires that you build several control blocks in your
work area. However, you can save much coding effort by using existing
control blocks built by the control program.
When your routine receives control from the OPEN or CLOSE routine,
the status of control information and pointers is as shown in Figure 1.
When your routine receives control from the EOV routine, register 2
contains the address of a DCB, and register 4 contains the address of a
combined work and control block area. The format of this area is shown
in Figure 2.

46
r----------------------------------------------------------------------,
Data
Control
Block

Data
Control
Block

Data
Control
Block

Data
Control
Block

~. Work
and
Control
Block
Area

Work
and
Control
Block
Area

Work
and
Control
Block
Area

Work
and
Control
Block
Area

~---------------,-------------------------------------------------------~
Register 5 contains the starting address of a list of DCB addresses.
Each DCB specified in the OPEN or CLOSE macro-instruction has a
4-byte entry in the list. The DCBs to which the entries point are
in the problem prograro.
For each DCB specified in the OPEN or CLOSE macro-instruction, a
combined work and control block area is built. Register 6 contains
the starting address of a table that contains an address for each
work and control block area. The addresses of the areas are
contained in t~he low-order three bytes of 8-byte entries. The list
of 8-byte entries begins 32 bytes from the starting address of the
table. The format of the combined work and control block area is
shown in Figure 2.
- -__________________________________ - _________________________________ J

Figure 1. Status of Control Inforroation and Pointers

Label Processing Routines 47


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

Work Area
(100 bytes)

Job File Control Block (JFCB)


(176 bytes)

Event Control Block (ECB) - 4 bytes

Input Output Block (lOB)


(40 bytes)

Data Extent Block (DEB)


(44 bytes)

Abbreviated DCB - (4 bytes)

Channel Command Words (CCW)


(96 bytes)

~----------------------------------------------------------------------~
I Each of the fields within the work and control block area can be I
I addressed by your nonstandard label processing routines. The I
I IECDSECT macro-instruction defines the symbolic names of all these I
I fields. (The macro-definition and how to add it to the macro- I
I library are in the Appendix of this chapter.) Code this macro- I
I instruction (with a null operand field and immediately preceded by a I
I DSECT statement) in the list of constants for each of your I
I nonstandard label processing routines. Using the starting address I
I of the work area as a base, you are able to address any field I
IL ______________________________________________________________________
symbolically. JI

Figure 2. Format of Combined Work and Control Block Area

48
General Logic Flow of a Nonstandard Label Processing Routine: The
general flowcharts in Figures 3, 4# and 5 show the logic that you could
use in your routines. Each block in the flowcharts is numbered, and the
number corresponds to an item in the list of explanations of the blocks.

Figure 3. General Flow of a Nonstandard Label Processing Routine After


RecE:d ving Control From the OPEN Routine

Label Processing Routines 49


(1)

(20)
Obtain Restore
Main Registers
Storage

(3) (21)
Save Release
Registers Main
Storage
B
(22)
Return to
Control Program

No

(13)
Set Up Set Up
CCW CCW

(16) (18)
Adjust Create
for Next Label
DCB

(18)

Figure 4. General Flow of a Nonstandard Label Processing Routine After


Receiving Control From the CLOSE Routine

50
Entry from (1)
Control Program

(20)
Obtain (2)
Restore
Main Registers
Storage

(3) (21)
Save Release
Registers Main
Storage

(9) (22)
Set Bit
in UCB
to 0

(10)
Determine
Type of I/O
Operation

(13)
Set Up
CCW

(14)

. - - - - - - . . , (16)
Yes Process
Label

.----...1....-.--, (\9)
Set Bit
in UCB
to 1

Figure 5. GenE=ral Flow of a Nonsta~dard Label Processing Routine After


RecHiving Control From the EOV Routine

Label Processing Routines 51


Explanations of Logic Blocks

1. The entry is in the form of an XCTL macro-instruction issued by the


control program.

2. Use the GETMAIN macro-instruction to obtain main storage.

3. Use the store mUltiple instruction (STM).

4. TO locate the address of the data control block (DCB) , use the
contents of register 5. To determine if the DCB is open, test bit
3 of the DCBOFLGS field of the DCB; if this bit is zero, the DCB
has not been opened. (The symbolic names of all fi¢lds in the DCB
are defined by the DCBD macro-instruction.)

5. To determine if a tape data set is being processed, test the


UCB3TAPE field of the unit control block (UCB); this bit is one for
a tape data set. The symbolic names of all fields in the UCB are
defined by the IEFUCBOB macro-instruction. (The macro-definition
and how to add i t to the macro-library are in the Appendix of this
chapter.) The address of the UCB is contained in the DXDEBUCB
field of the data extent block (DEB) as defined by the IECDSECT
macro-instruction. (The macro-definition and how to add it to the
macro-library are in the Appendix of this chapter.)

6. To determine if nonstandard labels have been specified, test the


JFCBLTYP field of the job file control block (JFCB); this field
contains a hexadecimal 04 when nonstandard labels have been
specified.

7. The final DCB entry in the list of DCB addresses contains a one in
its high-order bit position.

8. Add 4 to the contents of register 5; add 8 to the contents of


register 6.

9. Set the high-order bit to zero in the SRTEDMCT field of the UCB.

10. To determine the type of I/O operation specified in the OPEN


macro-instruction, check the bit configuration of the high-order
byte of the DCB entry in the list of DCB addresses. The bit
configuration for each type of I/O operation is shown below. (The
high-order four bits correspond to the disposition of the data set;
the low-order four bits correspond to the I/O operation itself.
For example, the bit configuration xOll0000 indicates a data set
opened for input whose disposition is LEAVE.)

Bits o 1 2 3 4 5 6 7
x 0 o 1 x x x x REREAD
x 0 1 1 x x x x LEAVE
x 0 o 0 x x x x Neither REREAD nor LEAVE

x x x x 0 0 o 0 INPUT
x x x xli 1 1 OUTPUT
x x x x 0 0 1 1 INOUT
x x x x 0 1 1 1 OUTIN
x x x x 0 0 o 1 RDBACK
x x x x 0 1 o 0 UPDAT

11. To determine the mode of the data set, test the high-order bit of
the DCBOFLGS field of the DCB. If this bit is one, the data-set
mode is output; if this bit is zero, the data-set mode is input.
(The symbolic names of all fields in the DCB are defined by the
DCBD macro-instruction.)

52
12. You may want to position the tape if you have closed an input data
set before all data has been read.
13. Move your CCW into the channel program area of the control
program's work area. (The symbolic name of the first entry in the
channel program area is DXCCW.)

14. Issue an EXCP macro-instruction specifying the address of the


control prograro's lOB. (The sywtolic name of the lOB is DXIOB.)

15. Techniques used to check for correct volume will differ depending
on the label formats used in the installation.
16. Label processing routines will differ ty label format.
17. If a write operation is requirea, this block can be used.
18. Issue an EXCP macro-instruction specifying the address of the
control program's lOB. (The symbolic name of thE lOB is DXIOB.)

19. Set the high-order bit to 1 in the SRTEDMCT field of the UCB.

20. Use the load multiple instruction (LM).


21. Use the FREEMAIN macro-instruction to free the work area obtained
in step 2.
22. Use the XCTL macro-instruction, specifying the appropriate operand.

The following coding sequence ill~strates an exit from your routine


during OPEN or CLOSE operations.
MVC
1. o (a, 6) , MODNArJjE
LA 2 15,DXCCW12
XCTL EPLOC=(6),DCB=O,SF=(E, (15»
MODNAME DC C'IGGxxxxx'

1. The name of the module you are transferring tc is ffioved to the first
8 bytes of the table pointed to by register 6 (see Figure 1).

2 DXCCW12 addresses an eight-byte field that way be used for the remote
supervisor parameter list required by the E-form of the XCTL
macro-instruction.
The following coding sequence illustrates an exit from your routine
during end-of-volume operations.
MVC DXCCW12+16(8),MODNAME
LA 15,DXCCW12+8
LA 0, DXCCW12+16
XCTL EPLOC=(O) ,DCB=O,SF=(E, (15»
MODNAME DC C'IGGxxxxx'
- --
The IECDSECT macro-instruction, discussed in the appendix to this
chapter, defines the name DXCCW12. The DCB= parameter of the XCTL
macro-instruction must be coded DCB=O in this application.

INSERTING NONSTANDARD LABEL ROUTINES INTO THE CONTROL PROGRAM


Nonstandard label processing routines must be included in the control
program as part of the SVC library (SYS1.SVCLIB), since they are load
modules of type 4 SVC routines. You insert nonstandard label processing
routines into the control program during the system generation process.

Label Processing Routines 53


Before your nonstandard label routine can be inserted into the
control program, each load module of the routine must be a member of a
cataloged partitioned data set. You must name this data set SYS1.name.
To insert your nonstandard latel routine load modules into the svc
library, you use the SVCLIB macro-instruction. Using this macro-
instruction, you must specify the name of the partitioned data set and
the names of members to be included in the SVC library. Member names
for the first load module of each type of label processing routine are
shown below. (Member names for additional load modules must begin with
the letters NSL or IGC.) The format of the SVCLIB macro-instruction is
contained in the publication IBM System/360 Operating System: System
Generation, Form C28-6554.

Nonstandard Label
Processing Routine Control Program Routine Member Name

Input header OPEN NSLOHDRI


EOV NSLEHDRI
Output header OPEN NSLOHDRO
EOV NSLEHDRO
Input trailer EOV NSLETRLI
Output trailer EOV NSLETRLO
CLOSE NSLCTRLO

54
SECTION 2: VOLUME LABEL AND DUAL-DENSITY TAPE DEVICE EDITOR ROUTINES
When writing data sets on magnetic tape (OUTPUT or OUTIN specified in
the OPEN macro-instruction) conflicts may be detected between:

1. The label type specified by the program and the label type on the
currently mounted volume.

2. The recording density specified by the program, and the density at


which a dual-density tape device is set to record.
These volume label and density conflicts are detected by the OPEN or
EOV control program routines during label verification procedures. IBM
supplies editor routines that function when these conflicts are
detected, resolving the conflicts by requesting dismounting of the
currently mounted tape volume and the mounting of a new tape volume
whose label and/or density conform to the program specifications. The
editor routines you write replace the IBM supplied routines, and can be
designed to resolve the label and density conflicts without operator
intervention (i.e., tape handling).
Your editor routines can resolye label and density conflicts by
writing labels, "cancelling labels," and by performing write operations
to set the desired density on a dual-density tape device. Or, your
editor routines can reset system control blocks (in effect, change the
program specifications) to agree with the label type and/or density of
the currently mounted volume. Or, your installation may desire a
combination of these actions, including dismounting under certain
conditions. All these possible actions way be included in your editor
routines.
You may replace the standard IBM editor routine associated with the
OPEN routine; the standard IBM editor routine associated with the EOV
routine, or both.
The balance of this section provides you with the information
necessary to write editor routines; progra~ming conventions, entry
conditions, a suggested logic for your OPEN and/or EOV editor routines,
and how to insert your routines in the control program.

PROGRAMMING CONVENTIONS
Your editor routines must conform to the same general programming
conventions as the nonstandard label processing routines discussed in
section I of this chapter (see section I - Programming Conventions) in
so far as size, design, register usage, entry points, and work areas are
concerned.
You must name the first (or only) module of your routines as follows:
OMODVOL1 the editor routine associated with OPEN
EMODVOL1 the editor routine associated with EOV
If your editor routines consist of more than one load module, nawes
for the additional modules must begin with the prefix OMODVOL for the
OPEN routine. EMODVOL for the EOV routine. Transfer between the modules
must be by name.
As discussed in Section I of this chapter, you must use EXCP
prograrrming to perform the needed input/output operations.

Label Processing Routines 55


ENTRY CONDITIONS AND GENERAL LOGIC FLOW OF ~HE EDITOR ROUTINES

Figure 6 Editor Routine Entry Conditions and the logic


flowcharts (Figures 7 and 8) with their accompanying text present the
basic information necessary to design and write your editor routines.
The logic charts depict a suggested logic -- oriented towards resolving
label and density conflicts by altering the characteristics of the
mounted volume.

ENTRY CONDITIONS
Figure 6 presents the four conditions under which the control program
OPEN or EOV routines transfer control to your editor routines, and the
general action the editor routine takes to permit processing on the
current volume to continue. The first two conditions arise only when
the tape voluwe is mounted on a dual-density tape device.
Entry from the EOV routines occurs when a volume switching operation
is necessary and any condition noted in Figure 6 is present.

')6
r-------------T---------------T------~-T-------------------------------,
I I ITransferl I
I Program IMounted Volume IOccurs I I
ISpecificationlCharacteristicslon a IPossible Editor Routine Action I
~-------------+-.--------------+--------+-------------------------------~
ISL - 800 or ISL -- CD I DC1 I Overwrite the standard labell
11600 BPI 1 I Iwith a standard latel. Thel
I density I I Ifirst write from loadpoint sets 1
I I I Ithe recording density on al
I I I Idual-density device. (See Fig-I
I I I lure 7 or 8 -- blocks 15b, 161
I I I land explanation). I
~-------------+---------------+--------+-------------------------------~
INSL2 - 800 orlNSL O~ NL -- COl DC1 IWrite a tapemark to set den-I
11600BPI 1 I Isity. The prograre specifica-I
I density I I Ition NSL will cause control tol
I I I Ibe given to your nonstandard I
I I I I label routines after return tol
I I 1 IOPEN or BOV. (See Figure 7 -I
I I I I blocks 15, lSb, 16. If your I
I I I linstallation supports protec-I
I I I Ition and retention data check-I
I I I ling NSL volumes, see block 6). I
t-------------+---------------+--------+--------------------------------~
ISL INSL or NL3 I LC IWrite a standard volume label. I
I I I I (See Figure 7 - blocks 15, lSa,1
I I I 11 6. If your installation sup-I
I I I Iports protection and retention I
I I I Idate checking on NSL volumes, I
I I I I see block 6). I
~-------------+---------------+--------+-------------------------------~
INL or NSL ISL3 I LC IOverwrite standard label with al
I I I Itapemark, i.e. "cancel." (Seel
I I I IFigure 7 - blocks 15, 15a, 16).1
I I I IDepending on whether NL or NSLI
I I I I is specified by the program, I
I I I IOPEN or EOV will either posi-I
I I I Ition tape (NL) or transfer con-I
I I I Itrol to your nonstandard labell
I I I I routines (NSL) when control isl
I I I I returned to them. I
~-------------~--,-------------~--------~-------------------------------~
Legend:
SL - standard volume label
NSL - nonstandard volume label
NL - no volume label
DC - density check
LC - label check
CD - Conflicting density. The volume has teen previously written
on, or in a, recording density other than that specified by the
program. The recording density on a dual-density device is set
by sensing the density of the mounted volume.

1Dual-Density devices only.


2If NL is specified, no density check is performed. For NL volumes,
tape is positioncQ at load point and recording density is set by the
first write command. .
3If the volume is mounted on a dual-density device a density condition
way also exist. If will Le corrected ny the write operation.
Note: The OPEN and EOV routines position the tape at load point before
IL_____________________________________
transferring control to the editor routines.
________________________________
~ J

Figure 6. Editor Routine Entry Conditions

Label Processing Routines 57


GENERAL LOGIC FLOW
Figures 7 and 8 depict a suggested logic you can use to develop your
editor routines. Note that Figuze 8 (the EOV editor routine) does not
contain logic blocks corresponding to blocks 5, 18, ,and 19 in Figure 7
(the OPEN editor routine). These blocks represent fUnctions that you
must program when receiving control froIT the OPEN routine. You must
test all the DeBs defined by the OPEN macro-instruction before returning
control to the OPEN routine. When receiving control from the EOV
routine, you only have to process one DCB.
Note: If your installation does not support protection and retention
data checking on nonstandard label volumes and does not desire to
maintain retention date checking on standard latel volumes, you need not
implement the functions of logic blocks 6 through 13 in Figures 7 and 8.

58
(1)

Entry From
Control Program

(2)
Obtain
Main
Storage

Establish
Addressibil ity
of Control
Information

8--~ (15b)
(15a)
Get Label Type
Test Bits 1-2 From
in JFCBLTYP
JFCBMASK+5
Field

Write a
Standard
Volume Label
or Tapemark

(17)

Zero UCB
Vol Ser No. and
Set Mount
Switch "ON"

Rewind and
Unload
Current
Volume

Return to
(13)
Control Program
Issue
Mount
Message

Figure 7. General Flow of an Editor Routine After Receiving Control


From the OPEN Routine

Label Processing Routines 59


(1)
Entry From
Control Program

...-_ _--'-_ _---, (2)


Obtain
Main
Storage

...-_ _--'-_ _---. (3)

(4)

0---
...--_ _-L-_ _- ,

Establish
Addressibil ity
of Control (ISb)
Information
Get Label Type
Test Bits 1-2
From
in
JFCBLTYP
JFCBMASK+S
Field.

Write a
Standard
Vol ume Label
or Tapemark

(17)

Zero UCB Vol


Ser No. and Set
Mount Switch
"ON"

(20)

Restore
Registers
Insert X'03'
in Reg 8

(21)

Release
Main
Rewind and Storage
Unload Current
Volume
(22)
Return to
Control Program

Figure 8. General Flow of an Editor Routine After Receiving Control


From the End-of-Volume Routine

60
LOGIC BLOCK EXPI,ANATIONS

1. Your exception routine receives control via an XCTL macro-


instruction issued by the OPEN or EOV routines of the control
prograIP.

2. Use the GETMAIN macro-instruction. The main storage you obtain


must contain all your work areas, including those used to read in a
label or write a label.

3. Use the store mUltiple instruction (STM).

4. Figure 1 in Section I of this chapter provides the information you


need to establish addressability of the DCB address list and work
and control block area for each DCB defined by the OPEN macro-
instruction.

When you receive control from the EOV routine, general register 2
contains the address of the DCB for the oata set and general
register 4 contains the address of the work and control block area
associated with the DCB.

The IECDSECT macro-instruction shown in the Appendix of this


chapter symbolically defines the fields of the work and control
block area (see Figqre 2 in Section I).

You will also need to address the unit control block (UCB) for the
device on which the tape volume is mounted. The address of the UCB
may be obtained from the DXDEBUCB field of the data extent block
defined by the IECDS£CT macro-instruction. The IEFUCBOB macro-
instruction (see Appendix) defines the fields of the unit control
block.

5. Bit configurations in the byte addressed by JFCBMASK+5 incicate


whether label checks or density checks have occurred, and, in the
case of a label check, the condition that caused the check. At
this point, you test bits 0 and 3. If Eit\er cit is set to 1,
processing is required.

The field JFCBMASK is defined by the IECDSECT macro-instruction.


Bit settings in the byte at JFCBMASK+5 are defined as:
Bits setting Meaning
o 1 Label check has occurred.
1 1 Standard label (SL) specified; no label/
nonstandard label on mounted volume.
2 1 No label (NL) or nonstandard label (NSL) speci-
fied; standard label on mounted volume.
3 1 Density check has occurred.
4-7 Reserved for future use.

6. If your installation supports a protection and retention date


scheme involving nonstandard labels, and/or you want to maintain
retention date and protection checking on standard labels, you must
incorporate code in your editor routines to check for protEcticn
and retention date expiration.

If checking is desired, you must, at this point, read the first


record and determine the label type.

To perform t:he I/O operation, move your CCWs into the channel
progran; field of the work and control tlock area. The synibolic
name for the first entry in this field is DXCCW. Then issue an
EXCP macro-instruction specifying trle address of the control

Label Processing Routines 61


programs inputloutput block (lOB). The syrooolic name for the lOB
is DXIOB. These fields (DXCCW, DXIOB) are defined by the IECDSECT
macro-instruction. Note: There are twelve CCW locations in the
DXCCW field. Do not place a CCW at the location defined by DXCCW7
in your editor routine for OPEN. Do not place a CCW in locations
DXCCWll or DXCCW12 in your editor routine for EOV.

7. To check the retention date andlor protection fields in a standard


label you must read the data set header 1 record into a workarea.
The format of the nonstandard label defined by your installation
determines how you access the protection and retention date fields
in the nonstandard label. Step 6 provides directions for handling
the 1/0 operation.
8. Write a message to the operator to inform him that the volume is
protected and to determine if it is to be used.
9. See step 7 above.
10. Write a message to the operator to inform him that the expiration
date fer the mounted volume has not elapsed and to determine if it
is to be used.

11. If the volume is to be used, continue precessing to resolve label


or density conditions.
12. Rewind and unload the currently mounted volume. Step 6 provides
directions for handling the 1/0 operation.
13. Write a rressage to the operator requesting dismounting of the
current volume and mounting of a new volume. The device name (in
EBCDIC) may be obtained from the UCBNAME field of the unit control
block.
14. Step 6 provides directions for handling the 1/0 operation.
15. Test bit 3 of the byte at JFCB~ASK+5. If set to one, control was
received as a result of a density check.
Test bit 0 of the byte at JFCBMASK+5. If set to one, control was
received as the result of a label check.
lSa. If control was received as the result of a label check, test bits 1
and 2 of the byte at JFCBMASK+5. See step 5.
lSb. If control is received as the result of a density check, use the
JFCBLTYP field in the job file control block (JFCB) to ascertain
the type of label specified in the program. A hexadecimal 04
indicates a nonstandard label (NSL) has been specified, a hexadeci-
mal 02 indi~ates that a standard label has teen specified.
16. When correcting a density check or label check condition, and a
nonstandard label (NSL) or no label (NL) is specified by the
program, you must write some kind of record on the tape that will
be interpreted by the OPEN or EOV routines as a nonstandard label
or no label, i.e., it does not contain VOLl in the first four bytes
of the record. The easiest way to do this is to write a tapemark.
Upon return to OPEN or EOV and re-verification of the label, the
specification for label type and density will have been met, the
OPEN or EOV will transfer control to your nonstandard label
routines if NSL is specified or position the tape for writing if NL
has been specified.
The System Control Block publication contains the format and field
descriptions for standard tape volume labels. You must supply

62
information for the label identifier (VOLIABI), the label sequence
number (VOLNO), and the volume serial number (VOLSERNO) fields, and
record the balance of the label as blanks.
You enter VOL in the label identifier field, a 1 in the label
sequence number field, and a six character serial number in the
volume serial number field. Note: To ensure that two or more tape
volumes carrying the same serial number are not produced, write to
the operator at this point for assignment of a serial number.
Data set header labels 1 and 2 are constructed by the OPEN or EOV
routines after control is returned to them.
Note: If you desire, at this point, you may change the control
block settings to conform to the characteristics of the tape volume
mounted, i.e., reset the label type field in the JFCB to conform
with the type of label on the volume mounted, and change the
density field in the DCB to the density of the tape mounted.
17. The syrrbolic name for the volume serial number field in the unit
control block is SRTEVOLI. The "mount switch" is the high order
bit of the field named SRTEDMCT in the unit control block. These
fields are defined by the IEFUCBOB macro-instruction. Exclusive
OR(XC) the SRTEVOLI field with itself. OR(OI) the SRTEDMCT field
with X'80'.
18. When receiving control from the OPEN routine, you must process the
entire DCB list. The last entry in the list can be recognized by a
"1" in bit 0 of the first byte in the entry.
19. You increment the pointer to the DCB address list by four bytes.
You must also increment the pointer to the work and control block
area for each DCB. You increment this pointer by 8 bytes.
20. Use the load multiple instruction (LM). Note: When preparing to
return to EOV you must insert a hexadecimal 03 in Register 8.
21. Use the FREEMAIN macro-instruction.
22. Return control to the OPEN or EOV routines via an XCTL macro-
instruction, specifying the module to be given control as follows:
Return From To Module
OMODVOL1 IGG0190A (OPEN)
EMODVOLl IGG0550P (EOV)

Note: OPEN and EOV will rewind the volume upon receiving control from
OMODVOL1 or EMODVOL1.
Return is via the XCTL macro-instruction (E-form). See Section 1
Explanation of Logic Blocks -- item 22.

INSERTING YOUR LABEL EDITOR ROUTINES INTO THE CONTROL PROGRAM


You insert your editor routines into the control program after system
generation by making a linkage editor run against the system library
named SYS1.SVCLIB. You will be replacing the IBM supplied editor
routines OMODVOLl and/or EMODVOLl with your routines.

Label Processing Routines 63


The setup for making the linkage editor run is shown below.
//jobname JOB (parameters)
//stepname EXEC PGM=IEWL. (parameters)
//SYSPRINT DD SYSOUT=A
//SYSUTl DD UNIT=SYSDA,SPACE=(parameters)
//SYSLMOD DD DSNAME=SYS1.SVCLIB,DISP=OLD
//SYSLIN DD
*

(object deck for OPEN)

ENTRY OMODVOLl
NAME OMODVOL1(R)

(object deck for EOV)

ENTRY EMODVOLl
NAME EMODVOL1(R)
/*

Caution: You should not attempt to insert routines into the SVC library
when you are running in a multi-tasking environment. Also, if your
label editor routines (for OPEN or EOV) consist of more than one module
you must have requested space for the SVC library directory entries for
the additional modules at the time the system was generated.

64
APPENDIX: IECDSECT,IEFJFCBN, AND IEFUCBOB MACRO-INSTRUCTIONS
If you want to use the IECDSECT,IEFJFCBN and IEFUCBOB macro-
instructions, you must either add these roacro-definitions to the
macro-library (SYSi.MACLIB) or place them in a separate partitioned data
set and concatenate this data set to the macro-library. This section
contains the following:
• The forn,ats of the macro-instructions.
• The Job Control and utility stateroents needed to add the rnacro-
definition to the library.
• The macro-definition to be added to the library.

IECDSECT MACRO-INSTRUCTION
This macro-instruction defines the syrrbolic names of all fields in
the work area used by the OPEN, CLOSE, TCLOSE, and EOV routines. Code
this macro-ins"truction with blank name and operand fields, and precede
it with a DSECT statement. Note: The IEFJFCBN rracro-instruction is used
in the assembly of IECDSFCT. The macro-definition for IEFJFCBN nlust be
present in the macro-library (SYSi.MACLIB) for successful definition of
all fields in the work area.

r------T-----------T---------------------------------------------------,
I Name ~ Operation I Operand I
~------+-----------+---------------------------------------------------i
I
L ______ I ____________
~
IECDSECT I ___________________________________________________ JI
~

Control Statements Reguired

r----------------------------------------------------------------------,
//jobnaroe JOB {parameters}
//stepname EXEC PGM=IEBUPDAT,PARM=NEW
//SYSPRINT DD SYSOUT=A
//SYSUT2 DD DSNAME=SYSi.MACLIB,DISP=OLD
//SYSIN DD DATA
./ ADD IECDSECT,OO,O,l

IECDSECT Macro-Definition

./ ENDUP
/*
L ___________________________________ ~ __________________________________ J

IECDSECT Macro-Definition
MACRO
IECDSECT
SPACE 1
* THIS MACRO IS USED TO DEFINE THE WORK AREA
FOR ALL MODULES OF OPEN,CLOSE,TCLOSE
* AND END OF VOLUME FOR O/S 360
* SPACE 1
THIS MACRO DEFINES A WORK AREA WITH THE
* FOLLOWING FORMAT
* SPACE 1
1.LABELS AND DSCB
*
Label processing Routines 65
LABELS
* VOLUME LABEL
* FILE LABEL 1
* FILE LABEL 2
* DSCB
* FORMAT 1
* FORMAT 3 KEY
* FORMAT 3 DATA
* CORE ADDRESS OF NEXT DSCB
*
>I< MESSAGE AREA ••••••••••••••. 100 BYTES
2.JFCB •••••••.•••••••.••••.••••. 176 BYTES
* 3.ECB ••••.••••••••••.••••.•••••••• 4 BYTES
01< 4.IOB •.•.••••••••••••..•••••••••• 40 BY_TES
S.DEB ••••••.••••••••••••••••••.•• 44 BYTES
* 6.DCB •.••••••.••..•.•••.•••••••.•. 4 BYTES
* 7 • CCW S ••••••.•••••••••••••••.••• 96 BYTES
* SPACE 1
* TOTAL *** 464 BYTES
SPAC.E 2
* ***
-* ***
* ***
* ***
SPACE 1
* VOLUME LABEL
SPACE 1
DXLBL DS OCL80
VOLLABI DS CL3 LABEL IDENTIFIER
VOLNO DS CLl VOLUME LABEL NUMBER
VOLSERNO DS CL6
VOLSEC DS CLl
DS OCLI0 RESERVED
VOLVTOC DS CL5
DS CLS
DS CLI0 RESERVED
DS CLI0 RESERVED
VOLOWNER DS CLI0 OWNER NAME AND ADDRESS CODE
DS CL29 RESERVED
SPACE 1
FILE LABEL 1
* SPACE 1
ORG DXLBL
FLILABI DS CL3 LABEL IDENTIFIER
FLINO DS CLl FILE LABEL NUMBER
FLIID DS CL17 FILE IDENTIFIER
FLIFILSR DS CL6 FILE SERIAL NU~BER
FLIVOLSQ DS CL4 VOLUME SEQUENCE NUMBER
FLIFILSQ DS CL4 FILE SEQUENCE NUMBER
FLIGNO DS CL4 GENERATION NUMBER
FLIVNG DS CL2 VERSION NUMBER OF GENERATION
FLICREDT DS CL6 CREA'rION DATE
FLIEXPDT DS CL6 EXPIRATION DATE
FLIFSEC DC C'O' FILE SECURITY INDICATOR
FLIBLKCT DS CL6 BLOCK COUNT
FLlSYSCD DS CL13 SYSTEM CODE
FLIRES DS OCL7 RESERVED FOR FUTURE USE
DS CLl
FLlRESl DS C~6
SPACE 1
FILE LABEL 2
* SPACE 1
ORG FLIID
FL2RECFl-j DS CLl RECORD FORMAT
FL2BLKL DS CLS BLOCK LENGTH
FL2LRECL DS CLS BLOCKING FACTOR/RECORD LENGTH

66
FL2DEN DS CLl DENSITY
FL2FILP DS CLl FILE POSITION
FL2JSID DS OCL17 JOB/STEP IDENTIFICATION
FL2JOBD DS CL8 JOB IDENTIFICATION
FL2JSSP DC C'/' SLASH
F'L2STEPD DS CL8 STEP IDENTIFICATION
FL2TRTCH DS CL2 TAPE RECORDING TECHNICUE
FL2CNTRL DS CLl CARRIAGE CONTROL CHARACTER
FL2RES DS CL43 RESERVED FOR FUTURE USE
SPACE 1
* DATA SET CONTROL BLOCK
SPACE 1
ORG DXLBL
DXDSCB DS OCL96
DSCFMTID DC C'l'
DSCFILSR DS CL6 FILE SERIAL NU~BER'
DSCVOLSR DS CL2
DSCCREDT DS CL3 CREATION DATE IN DISCONTINUOUS BIN
DSCEXPDT DS CL3 EXPIRATION DATE IN DISCONTINUOUS BIN
DSCNOEXT DS CLl
DSCBLDBL DS CLl
DS CLl
DSCSYSCD DS CL13 SYSTEM CODE
DS CL7
DSCFILTY DS CL2 FILE TYPE
DSCi{BCFr~ DS CLl RECORD FORMAT
DSCOPTCD DS CLl OPTION CODE
DSCBLKL DS CL2 BLOCK LENGTH
DSCLRECL DS CL2 RECORD LENGTH
DSCKEYL DS CLl KEY LENGTH
DSCRKP DS CL2 KEY LOCATION
DSCDSIND DS CLl
DSCSCALO DS CL4
DSCLSTAR DS CL5
DSCTRBAL DS CL2
DSCEXTYP DS eLl EXT~NT TYPE INDICATOR
DSCEXTSQ DS CLl EXTENT SEQUENCE NUMB~R
DSCLOWLM DS CL4
DSCUPPLM DS CL4
DSCEXTl DS CLiO
DSCEXT2 DS CLiO
DSCNEXT DS CL5 POINTER TO NEXT RECORD
DSCCORE DS CL4 CORE ADDRESS OF NEXT DSCB RECORD
DSCBEND EQU
SPACE
*
1
* DATA SET CONTROL BLOCK -FORMAT 3- KEY PORTION
SPACE 1
ORG DXDSCB
DXDSCB3K DS OCL40
DSCBF3C DC X'03030303'
DSCBEXSK DS OCL40
DSCBEXTY DS CLl EXTENT TYPE INDICATOR
DSCBEXSQ DS CLl EXTENT SEQUENCE NUMBER
DSCBLLMT DS CL4 CCHl-i LOWER LIMIT
DSCBULMT DS CL4 CCHH UPPER LIMIT
DSCBEX2 DS CLiO ADDITIONAL EXTENT
DSCBEX3 DS CLiO ADDITIONAL EXTENT
DSCBEX4 DS CLiO ADDITIONAL EXTBNT
SPACE 1
* DATA SET CONTROL BLOCK -FORMAT 3- RECORD PORTION
SPACE 1
ORG DXDSCB
DSCBFMID DC C'3' FORMAT ID
DSCBEXSD DS OCL90 ADDITIONAL EXTENTS
DSCBEX5 DS CLiO ADDITIONAL EXTENT

Label Processing Routines 67


DSCBEX6 DS CLiO ADDITIONAL EXTENT
DSCBEX7 DS CLiO ADDITIONAL EXTENT
DSCBEX8 DS CLiO ADDITIONAL EXTENT
DSCBEX9 DS CLiO ADDITIONAL EXTENT
DSCBEXA DS CLiO ADDITIONAL EXTENT
DSCBEXB DS CLiO ADDITIONAL EXTENT
DSCBEXC DS CLiO ADDITIONAL EXTENT
DSCBEXD DS CLiO ADDITIONAL EXTENT
DSCBNEXT DS CL5 CCHHR OF NEXT FORMAT 3 DSCB
SPACE 1
'*' MESSAGE AREA
SPACE 1
ORG DXDSCB
HEPLYLTH DS CLl
REPLYADR DS CL3
HEPLYECB DS CL4
l'1SGLSTSZ DS CL4
iVlESSAGEA DS CL60
REPLY DS CLiO
* ORG MESSAGEA
* DEFINITION OF LENGTH OF MESSAGE COMPONENTS
*
MSERL EQU 3 MESSAGE SERIAL NUMBER LENGTH
MINSTL EQU 6 MSG INSTRUCTION LTH INC MSG SER
NUNL EQU 3 MESSAGE UNIT NAME LENGTH
I"JVCLL EQU 6 MESSAGE VOLUME SERIAL LENGTH
* MTXTL LENGTH MAY BE DEFINED BY EACH MODULE TO FIT REQUIREMENT
* MSGLTH LENGTH OF FULL MSG DEFINED BY EACH MODULE
* MESSAGE FORMAT IS 'IECOOOA M 000,00000 (TEXT)
MSGIOSUP DC CL3'IEC' I/O SUPPORT MESSAGE IDENTITY
MSGSER DS OCL3 MESSAGE SERIAL NUMBER
ORG MSGSER+MSERL-l
MSGSERLO DS CLl VOLUME SERIAL LO ORDER BYTE
ORG MSGSER
I"lSGINSTR DC CL6'000A M' MESSAGE INSTRUCTION INCL MSGSER
ORG MSGINSTR+MINSTL-l
MSGACTN DS CLl MESSAGE ACTION REQD BY OPERATOR
DC C' ,
MSGUN DC CL3'000' UNIT NAME THAT MSG REFERS TO
DC C' , '
MSGVOLSR DC CL6'000000' VOLUME SERIAL THAT MSG REFERS TO
DC C' , '
MSGTEXT DS OCL38
SPACE 1
JOB FILE CONTROL BLOCK
* SPACE 1
ORG DSCBEND
DXJBF DS OCL176
IEFJFCBN
SPACE 1
* EVENT CONTROL BLOCK
SPACE 1
DXECB DS OCL4
DC X'OOOOOOOO'
SPACE 1
* INPUT/OUTPUT BLOCK
SPACE 1
DXIOB DS OCL32
IOBFLAGl DC X'OO'
IOBFLAG2 DC X'OO'
:[OBSENSE DS OH
IOBSENSO DS CLl
IOBSENSl DS CLl SENSE BYTE 1
IOBECBPT DS XLi

68
DC AL3(DXECB)
IOBCSW DS 00
IOBCOMAD DC X'OOOOOOOO' KEY,OOOO,COMMAND ADDRESS
IOBSTATO DC X'OO' STATUS BYTE 0
IOBSTATl DC X'OO' STATUS BYTE 1
IOBCNT DC X'OOOO' COUNT
IOBSIOCC DS XLi
IOBSTART DC AL3(DXCCW)
IOBWGHT DS XLi
IOBDCBPT DC AL3(DXDCB)
DS XLi
DS XL3
IOBINCAN DC X'OOOO'
IOBERRCT DS XL2
DXDAADDR DS D DIRECT ACCESS ADDRESS (MBBCCHHR)
SPACE 1
DATA EXTENT BLOCK
* SPACE 1
DYYYY DS OCL44
DXDEB EQU DYYYY-4
DXDEBDEB DC X'OOCOOOOO'
DXDEBOFL DS OCLl
DXDEBIRB DC X'OOOOOOOO'
DXDEBSYS DC X'OOOOOOOO'
DXDEBUSR DC X'OOOOOOOO'
DXDEBECB DC X'OOOOOOOO'
DXDEBID DS OCLl
DXDEBDCB DC AL4(DXDCB)
DXDCBAD EQU DXDEBDCB
DXDEBAPP DS CL4
DXDEBMOD DS OCLl
DXDEBUCA DS F
DXDEBBIN DS H
DXDEBSCC DS H
DXDEBSHH DS H
DXDEBECC DS H
DXDEBEHH DS H
DXDEBNTR DS H
SPACE 1
DATA CONTROL BLOCK
* SPACE 1
DXXXX DS OF
DXDCB EQU DXXXX-44 POINTER TO RELATIVE BEGINNING OF DCB
DXDBDEB DC A (DXDEB)
SPACE 1
CHANNEL CONTROL WORDS
* SPACE 1
CNOP 3,8
DXCCW DS OCL96
DXCCWl DS D
DXCCW2 DS D
DXCCW3 DS D
DXCCW4 DS D
DXCCW5 DS D
DXCCW6 DS D
DXCCW7 DS D
DXCCW8 DS D
DXCCW9 DS D
DXCCW10 DS D
DXCCWll DS D
DXCCW12 DS D
SPACE 1
DSECTSIZ EQU 464 CORE AREA REQUIRED FOR THIS MACRO
MEND

Label Processing Routines 69


IEFUCBOB MACRO-INSTRUCTION

This macro-instruction defines the symtolic names of all fields in


the unit control block (UCB). Code this macro-instruction with blank
name and operand fields, and precede it with a DSECT statement.

r------T-----------T---------------------------------------------------,I
I Name I Operation I Operand
~------+-----------+---------------------------------------------------~
IL ______ I ___________
~
IEFUCBOB I ___________________________________________________ JI
~

Control Statements Required

r----------------------------------------------------------------------,
I //jobname JOB {Farameters}
I//stepname EXEC PGM=IEBUPDAT,PARM=NEW
I//SYSPRINT DD SYSOUT=A
I//SYSUT2 DD DSNAME=SYSi.MACLIB,DISP=OLD
I//SYSIN DD DATA
1./ ADD IEFUCBOB,OO,O,l
I
I
I
i IEFUCBOB Macro-Definition
I
I
I
J./ ENDUP
lI _____________________________________________________________________
/* _

IEFUCBOB Macro-Definition

MACRO
IEFUCBOB
UCBOB EQU * UNIT CONTROL BLOCKS
DS OF
SRTEJBNR DS XLi JOB INTERNAL NUMBER
SRTECHAN DS XLi ALLOC.CHANNEL MASK
UCBID DS XLi UCB IDENTIFICATION
SRTESTAT DS XLi STATUS BITS
SRTEONLI EQU 128 ONLINE
SRTECHGS EQU 64 CHANGE ONLINE/OFFLINE
SRTERESV EQU 32 RESERVED DEVICE
SRTEUNLD EQU 16 UNLOAD THIS DEVICE
SRTEALOC EQU 8 BIT 4 ALLOCATED
SRTEPRES EQU 4 BIT 5 PERf\ilANENTLY RESIDENT
SRTESYSR EQU 2 BIT 6 SYSRBS
OR PRIMARY CONSOLE
*
SRTEDADI EQU 1 BIT 7 DADSM INTERLOCK
OR TAPE CONTAINS
* STANDARD LABELS, OR
* ALTERNATE CONSOLE
*
UCBCHA DS XLi FLAGi AND CHANNEL ADDRESS
UCBUA DS XLi UNIT ADDRES3
UCBFL2 DS XLi FLAG2
UCBDTI DS XLi DEVIC:E TABLE
UCBETI DS XLi ERROR TABLE
UCBSTI DS XLi STATUS TABLE
UCBLCI DS XLi LOGICAL CHANN~L TABLE
UCBATI DS XLi ATTENTION TABLE
UCBWGT DS XLi ~7EIGHT

70
UCBNAME DS CL3 UNIT NAME IN 3 EBCDIC CHARACTERS
UCBTYP DS XL4 DEVICE TYPE.
UCBTBYTl EQU UCBTYP BYTE 1 OF UCBTYPE-MODEL
UCB1FEAO EQU 128 BIT 0 OF OPTION FIELD
UCB1FEA1 EQU 64 BIT 1 OF OPTION FIELD
UCB1FEA2 EQU 32 BIT 2 OF OPTION FIELD
UCB1FEA3 EQU 16 BIT 3 OF OPTION FIELD
UCB1FEA4 EQU 8 BIT 4 OF OPTION FIEIL
UCB1FEA5 EQU 4 BIT 5 OF OPTION FIELD
UCB1FEA6 EQU 2 BIT 6 OF OPTION FIELD
UCB1FEA7 FQU 1 BIT 7 OF OPTION FIELD
UCBTBYT2 EQU UCBTYP+l BYTE 2 OF UCBTYPE-OPTIONS
UCBTBYT3 EQU UCBTYP+2 BYTE 3 OF UCBTYPE-CLASS
UCB3TAPE EQU 128 BIT 0 OF CLASS - TAPE
UCB3COMM EQU 64 BIT 1 OF CLASS - COMMUNIC.
UCB3DACC EQU 32 BIT 2 OF CLASS - DIRECT AC
UCB3DISP EQU 16 BIT 3 OF CLASS - DISPLAY
UCB3UREC EQU 8 BIT 4 OF CLASS - UNIT REC.
UCB3CHAR EQU 4 BIT 5 OF CLASS - CHAR. READ
UCBTBYT4 EQU UCBTYP+3 BYTE 4 OF UCBTYPE-DEVICE
UCBLTS DS XL2 LAST 12*
UCBSNS DS XL6 SENSE INFORMATION
SRTEVOLI DS CL6 VOLUME SERIAL
SRTESTAB DS XLi STATUS B
SRTEBSVL EQU 128 BIT 0 SHARED VOLUME
SRTEBVSC EQU 64 BIT 1 VOLUME SECURITY
SRTEBALB EQU 32 BIT 2 ADDIT.VOL.LABEL PROC
SRTEBPRV EQU 16 BIT 3 PRIVATE
SRTEBPUB EQU 8 BIT 4 PUBLIC
SRTEBVQS EQU 4 BIT 5 VOLUME TO BE QUIESCE
* BIT TO MOUNT ANOThER
SRTEBJLB EQU 2 BIT 6 JOBLIB VOLUME
SRTEBNUL EQU 1 BIT 7 CONTROL VOLUME
SRTEDlvJCT DS XLi DATA MANAGEMENT COUNT
SRTEFSCT DS XL2 FILE SEQ. COUNT
SRTEFSEQ DS XL2 FILE SEQ. NUMBER
UCBSQC DS 2F SEEK QUEUE CONTROL WORD
UCBSKA DS 2F MBBCCHHR FOR LAST SEEK
SRTEUSER DS XLi CURRENT NUMBER OF USERS
SRTEECBA DS XL3 DA E<:;B ADDRESS
DATACEIL EQU * 9 OF THESE BLOCKS WILt BE P~ESENT
DCELJBNR DS XLi JOB INTERNAL
DCELUSER DS XLi CURRENT NUMBER OF USERS
DCELSTAB DS XLi STATUS B
DCELSTAT DS XLi STATUS A
DCELVOLI DS CL6 VOLUME SERIAL
DCELVTOC DS XL3 VTOC ADDRESS
DCELECBA DS XL3 DA ECB ADDRESS
MEND

IEFJFCBN MACRO-INSTRUCTION

This macro-instruction defines the symtolic names of all fields in


the job file control block (JFCB). Code this macro-instruction with
~lank name and operand fields, and precede it with a DSECT statement.

r------T-----------T---------------------------------------------------,I
I Name I Operation I Operand
~------+-----------+---------------------------------------------------i
I
L ______ I IEFJFCBN
~----- ______ I ___________________________________________________ JI
~

label Processing Routines 71


Control Statements Required

r----------------------------------------------------------------------,
I //jobname JOB <parameters)
I //stepname EXEC PGM=IEBUPDAT,PARM=NEW
I //SYSPRINT DD SYSOUT=A
//SYSUT2 DD DSNAME=SYS1.MACLIB,DISP=OLD
//SYSIN DD DATA
./ ADD IEFJFCBN,OO,O,l

IEFJFCBN macro-definition

./ ENDUP
______________________________________________________________________ J

IEFJFCBN Macro-Definition

MACRO
IEFJFCBN
INFMJFCB EQU *
JFCBDSNM DS CL44 DATA SET NAME
JFCBELNM DS CL8 ELEMENT NAME OR VERSION
JFCBISDM DS CLl TASK SCHEDULER - DATA
* MANAGEMENT INTERFACE BYTE
.JFCBSYSC DS CL13 SYSTEM CODE
.JFCBLTYP DS CLl LABBL TYPE AND USER'S-LABEI
INDICATOR
* DS CLl NOT USED
JFCBFLSQ DS CL2 FILE SEQUENCE NUMBER
JFCBVLSQ DS CL2 VOLUME SEQUENCE NUMBER
JFCBMASK DS CL8 DATA MANAGEMENT MASK
JFCBCRDT DS CL3 DATA SET CREATION DATE
JFCBXPDT DS CL3 DATA SET EXPIRATION DATE
JFCBINDl DS CLl INDICATOR BYTE 1
JFCBRLSE EQU 64 BITS 0 AND 1 - EXTERNAL
* STORAGE RELEASE INDICATOR
JFCBLOCT EQU 16 BITS 2 AND 3 - DATA SET
* HAS BEEN LOCATED
JFCBNEWV EQU 4 BITS 4 AND 5 - NEW VOLUME
ADDED TO DATA SET
*
.JFCBPMEM EQU 1 .BITS 6 AND 7 - DATA SET IS
* A M~MBER OF A PODS OR GDG
JFCBIND2 DS CLl INDICATOR BYTE 2
JFCBSTAT EQU 64 BITS 0 AND 1 - DATA SET
STATUS (NEW, OLD, OR MOD)
*
JFCBSCTY EQU 16 BITS 2 AND 3 - DATA SET
* SECURITY INDICATOR
JFCBUFNO DS ~ALl
JFCBUFRQ DS ALl
JFCBFTEK DS OBLl
.JFCBF ALN DS BLl
JFCBUFL DS AL2
JFCEROPT DS BLl
JFCTRTCH DS OBLl
JFCKEYIE DS ~ALl
JFCMODE DS OBLl
.JFCCODE DS OBLl
.JFCSTACK DS OBLl
JFCPRTSP DS BLl

72
JFCDEN DS BLl
JFCLIMCT DS AL3
JFCDSORG DS BL2
JFCRECFI-1 DS BLl
JFCOPTCD DS BLl
JFCBLKSI DS AL2
JFCLRECL DS AL2
JFCNCP DS ALl
JFCNTM DS ALl
JFCRKP DS AL2
JFCCYLOF DS ALl
JFCDBUFN DS ALl
JFCINTVL DS ALl
JFCCPRI DS BJ.Jl
JFCSOWA DS AL2
JFCBNTCS DS CLl NUMBER OF OVERFLOW TRACKS
JFCBNVOL DS CLl NUMBER OF VOLUME SERIAL
NUJ.VJBERS
*
JFCBVOLS DS CL30 VOLUME SERIAL NUMBERS (THE
FIRST FIVE)
*
JFCBEXTL DS eLl LENGTH OF BLOCK OF EXTRA
VOLUME SERIAL NUMBERS
* (BEYOND FIVE)
*JFCBEXAD DS CL3 TRACK ADDRESS OF BLOCK OF
EXTRA VOLUME SERIAL NUMBERS
*
JFCBPQTY DS CL3 PRIMARY QUANTITY OF D.A.
STOHAGE REQUIRED
*
JFCBCTRI DS CLl INDICATES WHETHER CYLINDERS
TRACKS, OR RECORDS ARE
* PSECIF~ED IN JFCBPQTY AND
* JFCBSQTY
*
J" FCBSQTY DS Cl,3 SECONDARY QUANTITY OF D.A.
STORAGE REQUIRED
*
JFCBIND3 DS CLl INDICATOR BYTE 3
JFCBCNTG EQU 64 BITS 0 AND 1 - CONTIGUOUS
STORAGE INDICATOR
*
JFCBMXIG EQU 16 BITS 2 AND 3 - MAXIMUM
AVAILABLE EXTENT IMJICATOR
*
JFCBALXI EQU 4 BITS 4 AND 5 - ALL EXTENTS
* INDICATOR
JFCBRNDC EQU 1 BITS 6 AND 7 ROUND
CYLINDER INDICATOR
*
JFCBDQTY DS CL3 QUANTITY OF D.A. STORAGE
REQUIRED FOR A DIRECTORY
*
J"FCBSPNM DS CL3 CORE ADDRESS OF THE JFCB
* WITH WHICH CYLINDERS ARE
SPLIT
*
JFCBABST DS CL2 RELATIVE ADDRESS OF FIRST
TRACK TO BE ALLOCATED
*
JFCBSBNM DS CL3 CORE ADDRESS OF THE JFCB
FROM WHICH SPACE IS TO BE
* SUBALLOCATED
*
JFCBDRLH DS CL3 AVERAGE DATA RECORD LENGTH
JFCBVLCT DS CLl VOLUME COUNT
JFCBSPTN DS CLl NUMBER OF TRACKS PER
CYLINDER TO BE USED BY THIS
* DATA SET WHEN SPLIT
* CYLINDERS IS INDICATED
*
JFCBLGTH EQU 176 LENGTH OF JFCB
JFCBEND EQU *
MEND

label Processing Routines 73


EXECUTE CHANNEL PROGRAM (EXCP) MACRO-INSIRUCTION

This chapter contains a general


description of the function and application
of the Execute Channel Program (EXCP)
macro-instruction, accompanied by descrip-
tions of specific control blocks and macro-
instructions used with EXCP. Factors that
affect the operation of EXCP, such as
device variations and program modification,
are also discussed.
The EXCP macro~instruction provides you
with a device-dependent means of performing
the I/O operations. Before reading this
chapter, you should be familiar with system
functions and with the structure of control
blocks, as well as with the operational
characteristics of the I/O devices required
by your channel programs. Operational
characteristics of specific I/O devices are
contained in IBM System Reference Library
publications for each device.
Documentation of the internal logic of
the input/output supervisor can be obtained
through your IBM Branch Office.

PREREQUISITE PUBLICATIONS

The IBM System/360 Operating System:


Data Management publication (Form C28-6537)
explains the standard procedures for I/O
processing under the operating system.
The IBM System/360 Operating System:
Assemtler Language publication (Form
C28-6514) contains the information neces-
sary to code programs in the assembler
language.
The IBM System/360 Operating System:
Control Program Services publication (Form
C28-6541) describes the system macro-
instructions that can be used in programs
coded in the assembler language.
The IBM System/360 Opezating System:
System Control Block publication (Forro
C28-6628) contains format and field de-
scriptions of the system control clocks
referred to in this chapter.

74
EXECUTE CHANNEL PROGRAM (EXCP) MACRO-INSTRUCTION

Execute Channel Program (EXCP) is a macro-instruction of System/360


Operating System that causes a supervisor-call interruption to pass
control to the input/output supervisor. EXCP also provides the
input/output supervisor with control information regarding a channel
program to be executed. When the IBM standard data access methods are
being used, the access method routines are responsible for issuing BXCP.
If you are not using the standard access methods, you may issue EXCP
directly. Direct use of EXCP provides you with device dependence in
organizing data and controlling I/O devices.
You issue EXCP primarily for I/O programming situations to which the
standard access methods do not apply. When you are writing your own
data access methods, you must include EXCP for I/O operations. EXCP
must also be used for processing of nonstandard labels, including the
reading and writing of labels and the positioning of magnetic tape
volumes.
To issue EXCP, you must provide a channel program (a list of channel
command words) and several control blocks in your program area. The
input/output supervisor then schedules I/O requests for the device you
have specified, executes the specified I/O commands, handles I/O
interruptions, directs error recovery procedures, and posts the results
of the I/O requests.

USE OF EXCP IN SYSTEM AND PROBLEM PROGRAMS


This section briefly explains the procedures performed by the system
and the programmer when the EXCP macro-instruction is issued by the
routines of the standard data access methods. The additional procedures
that you must perform when issuing the EXCP macro-instruction yourself
are then described by direct comparison.

SYSTEM USE OF EXCP


When using a standard data access method to perform I/O operations,
the programmer is relieved of coding channel programs, and of
constructing the control blocks necessary for the execution of channel
programs. To permit I/O operations to be handled by an access method,
the programrr.er need only issue the fcllowing macro-instructions:
• A DCB macro-instruction that produces a data control block (DCB) for
the data set to be retrieved or stored.
• An OPEN macro-instruction that initializes the data control block
and produces a data extent block (DEB) for the data set.
• A macro-instruction (e.g. GET, WRITE) that requests I/O operations.

Access method routines will then:


1. Create a channel program that contains channel commands for the I/O
operations on the appropriate device.
2. Construct an input/output block (lOB) that contains information
about the channel program.
3. Construct an event control block (ECB) that is later supplied with
a completion code each time the channel program terminates.

Execute Channel Program (EXCP) Macro-Instruction 75


4. Issue an EXCP roacro-instruction to pass the address of the IOB to
the routines that initiate and supervise the I/O operations.
The input/output supervisor will then:
5. Schedule the I/O request.
6. Issue a start input/output (SIO) instruction to activate the I/O
device.
7. Process I/O interruptions and schedule error recovery procedures,
when necessary.
8. Place a completion code in the event control block after the
channel program has been executed.
The programmer is not concerned with these procedures and does not
know the status of I/O operations until they are completed. Device-
dependent operations are limited to those provided by the macro-
instructions of the particular access method selected.

PROGRAMMER USE OF EXCP


If you wish to issue the EXCP macro-instruction directly, you must
perform the procedures that the access methods perform, as summarized in
items 1 through 4 of the preceding discussion. You must, in addition to
constructing and opening the data control block with the DCB and OPEN
macro-instructions, construct a channel prograrr, an input/output block,
and an event control block before you can issue the EXCP macro-
instruction. The input/output supervisor always handles items 5 through
8.

After issuing the EXCP rr.acro-instruction, you should issue a WAIT


macro-instruction specifying the event control block to determine
whether the channel program has terminated. If volume switching is
necessary, you rrlust issue an EOV macro-instruction. When processing of
the data set has been completed, you must issue a CLOSE macro-
instruction to restore the data control block.

EXCP REQUIREMENTS
This section describes the channel prograrr1 that you must provide in
order to issue thE EXCP macro-instruction. The control blocks that you
must either construct directly, or cause to be constructed by use of
macro-instructions, are also described.

CHANNEL PROGH.AM
The channel program supplied Ly you and executed through EXCP is
composed of channel command words (CCWs) on double-word boundaries.
Each channel command word specifies a corrmand to be executea and, for
commands initiating data transfer, the area to or from which the data is
to be transferrert. Channel corrmand word formats used with specific I/O
devices can be found in IBM Systems Reference Library publications for
each device. All channel comrrand words described in these publications
can be used, with the exception of REWIND and UNLOAD (RWU).
Data and Command Chaining
Chaining is the successive loading of channel command words into a
channel from contiguous douDle-word locations in main storage. Data
chaining occurs when a new channel command word loaded into the channel

76
defines a new storage area for the original I/O operation. Command
chaining occurs when the new channel comwand word specifies a new I/O
operation. For detailed information about chaining, refer to the IBM
System/360: principles of Operation publication (Form A22-6821).

To specify either data chaining or commanQ chaining, you must set


appropriate bits in the channel command word, and indicate the type of
chaining in the input/output ~lock. Both data and command chaining
should not be specified in the same channel comwand word; if they are,
data chaining takes precedence.
When a channel program includes a list of channel command words that
chain data for reading operations, no channel command word may alter the
contents of another channel command word in the same list. (If such
alteration were allowed, specifications could be placed into a channel
command word without being checked for validity. If the specifications
were incorrect, the error could not be detected until the chain was
completed. Data. could be read into incorrect locations and the systew
could not correct the error.)

CONTROL BLOCKS
When using the EXCP macro-instruction, you wust be familiar with the
function and structure of an input/output block (lOB), an event control
block (ECB), a data control block (DCB), and a data extent block (DEB).
Brief descriptions of these control blocks follow. Their fields are
illustrated in the section "EXCP Programming Specifications."
Input/Output Block (lOB)

The input/output block is used for corrmunication between the problew


program and the system. It provides the addresses of other control
blocks, and maintains inforwation abcut the channel prograro, such as the
type of chaining and the progress of I/O operations. You ITust define
the input/output block and specify its address as the only parameter of
the EXCP macro-instruction.
Event Control Block (ECB)
The event control block provides you with a completion code that
describes whether the channel prograrr was completed with or without
error. A WAIT macro-instruction for synchronizing I/O operations with
the problem program must be directed to the event control block. You
must define the event control block and specify its address in the
input/output block.
Data Control Block (DCB)
The data control block provides the system with information about the
characteristics and processing requirements of a data set to be read or
written by the channel program. A data control block must be produced
by a DCB macro-instruction that includes parameters for EXCP. You
specify the address of the data control block in the input/output block.
Data Extent Block (DEB)
The data extent block contains one or more extent Entries for the
associated data set, as well as other control information. An extent
defines all or part of the physical tounjaries cn an I/O device occupied
by, or reserved for, a particular data set. Each extent entry contains
the address of a unit control block (UCB), which provides information
about the type and location of an I/O device. More than one extent
entry can contain the same UCB address. (Unit control blocks are set up
at system generation time and need not concern you.) For all I/O

Execute Channel Program (EXCP) Macro-Instruction 77


devices supported by the operating system, the data extent block is
produced during execution of the OPEN macro-instruction for the data
control block. The system places the address of the data extent block
into the data control block.

CHANNEL PROGRAM EXECUTION


This section explains how the system uses your channel program and
control blocks after the EXCP macro-instruction has been issued.

INITIATION OF CHANNEL PROGRAM


By issuing the EXCP macro-instruction, you request the execution of
the channel program specified in the input/output block. The
input/output supervisor checks the request for validity by ensuring that
the required control blocks contain the correct information. If they do
not, abnormal termination procedures are initiated. A program check
occurs if the control blocks are not on correct boundaries.
The input/output supervisor obtains "the address of the data control
block from the input/output block and the address of the data extent
block from the data control block. From the data extent block, the
system obtains the address of the unit control block (UCB) for the
desired I/O device. To protect and facilitate reference to the
addresses of the lOB, DEB, and UCB, the input/output supervisor places
these addresses, along with other information about the channel program,
into an area called a request element. The request element is used by
the input/output supervisor for forming queues to keep track of I/O
requests. A channel program's request element is "available" if the
information it contains is no longer to be used by the input/output
supervisor and if it is ready to receive information about another
request. When a request element is "made available", it is removed from
all request queues and placed on a queue of available request elements.
You are not concerned with the contents of the request element unless
you have provided appendage routines, as explained in the section
"Appendages."
After completing the request element for the channel program, the
input/output supervisor deterITines whether a channel and the requested
I/O device are ready for the channel prograrr·. If they are not ready,
the request element is placed into the appropriate queue, and control is
returned to the problem program. The channel program is subsequently
executed when the channel and device are ready.
To initiate execution of the channel program, the system obtains its
address from the input/output block, places this address into the
channel address word (CAW), and issues a start input/output (SIO)
instruction.
Before issuing the SIO instruction for direct-access devices, the
system issues the initial seek, which is overlapped with other
operations. You specify the seek address in the input/output block.
When the seek has completed, the system constructs a command chain to
reissue the seek, set the file mask specified in the data extent block,
and pass control to your channel program. (When using the operating
system, you cannot issue the initial seek cr set the file mask
yourself. )
Before issuing SIO for magnetic tape devices, the system constructs a
command chain to set the mode specified in the data extent block and
pass control to your channel prograIT. (When using the operating system,
you cannot set the mode yourself.)

78
COMPLETION OF CHANNEL PROGRAM
The system considers the channel program completed when it receives
an indication of a channel end conditien. When channel end occurs, the
request element for the channel prograrr is ~ade available, and a
completion code is placed into the event contrcl block. The completion
code indicates whether errors are associated with channel end. If
device end occurs simultaneously witl) channel end, errors associated
with device end (i.e., unit exception or unit check) are also accounted
for.
Device End Errors
If device end occurs after channel end and an error is associated
with device end, the completion code in the event control block does not
indicate the error. However, the status of th~ unit and channel is
saved in the unit control block (UCB) fer the device, and the UCB is
marked as intercepted. The input/output block for the next request
directed to the I/O device is also rrarked as intercevted. The error is
assurLied to be permanent, and the completion code in the event control
block for the intercepted request indicates interception. The IFLGS
field of the data control block is also flagged to indicate a permanent
error. It 3hould be noted that when a Write T2pe Mark or Erase Long Gap
CCW is the last (or only) CCW in your channel progran', the I/O
Supervisor will not attempt recovery procedures for Device End errors.
In these circumstances, cOITrrand chaining a NOPCCW to your Write Tape
Mark or Erase Long Gap CCW ensures initiation of device end error
recovery procedures.
To be prepared for device end errors, you should be familiar with
device characteristics that can cause such errors. After one of your
channel programs has terminated, you should not release buffer space
until you have determined that your next request for the device has not
been interceptea. You may reissue an intercepted request.

INTERRUPTION HANDLING AND ERROR RE:CCVERY PROCEDURES


An I/O interruption allows the CPU to respond to signals from an I/O
device which indicate either terrrination of a phase of I/O operations or
external action on the device. A complete explanation of I/O interrUp-
tions is contained in the IBM Systerr./360: Principles of Operation
publication. For descriptions of interruptions by specific devices,
refer to IBM Systerrs Reference Library publications for each device.
If error conditions are associated with an interruption, the
input/output supervisor schedules the appropriate device-dependent error
routine. The channel is then restarted with another request that is not
related 1 to the channel program in error. If the error recovery
procedures fail to correct the error, the system places ones in the
first two bit positions of the IFLGS field of the data control block.
You are inforwed of the error by an error code that the system places
into the event control block.
Error Recovery Procedures for Related Channel Programs
Related channel programs are requests that are associated with a
particular data control block and data extent block in the same job
step. They must be executed in a definite erder, i.e., the order in
which the requests are received by the input/output supervisor. A
channel program is not started until all previous requests for related

1Related channel programs are discussed in the next section.

Execute Channel Program (EXCP) Macro-Instruction 79


channel programs have been completed. You specify, in the input/output
block, whether the channel prograw is related to others.
If a permanent error occurs in a channel program that is related to
other requests, the request elements for all the related channel
programs are removed from their queue and made available. This process
is called purging. The addresses of the input/output blocks for the
related channel programs are chained together, with the address of the
first input/output block in the chain placed into the "User Purge lOB
Address" field of the data extent block. The address of the second
input/output block is placed into the "Restart Address" field of the
first input/output block, and so on. The last input/output block in the
chain is indicated by all ones in its Restart Address field. The chain
defines the order in which the request elements for the related channel
programs are removed from the request queue.
For all requests that are related to the channel program in error,
the system places completion codes into the event control blocks. The
IFLGS field of the data control block is also flagged. Any requests for
a data control block with Error flags are posted complete without
execution. If you wish to reissue requests that are related to the
channel program in error, you rrust reset the first two bits of the IFLGS
field of the data control block to zeros. You then issue a RESTORE
macro-instruction, specifying, as the only parameter, the address of the
"User Purge lOB Address" field of the data extent block. This causes
execution of all the related channel programs. (The RBSTORE macro-
definition and how to add it to the wacro-library are in the Appendix of
this chapter.) Alternatively, if you wish to restart only particular
channel programs rather than all of them, you may reissue the EXCP
macro-instruction for each channel program desired.

APPENDAGES
This section discusses the appendages that you may optionally code
when using the EXCP macro-instruction. Before a programmer-written
appendage can be executed, it must be included in the SVC library.
These procedures are explained first; descriptions of the routines
themselves and of their coding specifications follow.

DEFINING APPENDAGES
An appendage must be defined in a DD statement as a member of a SYSl
partitioned data set. The full member narre of an appendage is eight
bytes in length, but the first six bytes are required by IBM standards
to be the characters IGG019. The last two characters must be provided
by you as an identification; they may range in collating sequence from
WA to Z9.

ENTERING APPENDAGES INTO SVC LIBRARY


The SVC library is a partitioned data set named SYS1.SVCLIB. You can
insert an appendage into the SVC library during the system generation
process. In either case, the routine rr.ust te a member of a cataloged
partitioned data set whose name begins with SYS1.
To enter a routine into the SVC library during system generation, you
use the SVCLIB macro-instruction. The format of this macro-instruction
is given in the publication IBM System/360 Operating System: System
Generation, Form C28-6554.

80
CHARACTERISTICS OF APPENDAGES
An appendage is a programmer-written routine that provides additional
control over I/O operations during channel program execution. By
providing appendages, you can examine the status of I/O operations and
determine the actions to be taken for various conditions. An appendage
may receive control before a start input/output (SIO) instruction is
issued, or ~hen one of the following occurs:

• Program controlled interruption.


• End of extent.
• Channel end.
• Abnormal encl.

Appendages are executed in supervisor state. However, you must not


issue, in an appendage, any SVC instructions or instructions that change
the status of the computing or operating system (e.g., WTO, LPSW, SSM,
etc.). Since appendages are disabled for all types of interruptions
except machine checks, you also must not enter loops that test for
completion of I/O operations. An appendage must not alter storage used
by either the supervisor or the input/output supervisor.
The identification of an appendage, which consists of the last two
characters of its 8-character name, ~ust be specified in the DCB
macro-instruction, as described in the section "EXCP Programming
Specifications. '" When the OPEN macro-instruction for the data control
block is issued, any appendages specified in the DCB macro-instruction
are loaded into main storage. The appendages are linked to the
input/output supervisor when their addresses are placed into a table of
addresses called an appendage vector table. This table is always
constructed by the system when OPEN is issued; if an appendage is not
provided, the t~able contains the address of a return branch instruction
to the input/output supervisor. Using the appendage vector table, the
input/output supervisor branches and links to an appendage at the
appropriate timE~. The address of the starting location of the appendage
is placed into register 15.
Parameters are passed to appendages by the input/output supervisor.
These parameters are contained in registers, and are as follows:
• Reqister 1 contains the address of the request element for the
channel program. The request element contains the following infor-
mation:
Bytes 1 and 2
are a field used by the system for linking the request element
into a queue.
Bytes 3 and 4
indicate the address of the unit ccntrol block (UCB) for the
I/O device.
Byte 5
indicates the identification of the task control block (TCB)
for the task. (In a multitasking environment, this field is
not used. It contains all zeros if the request element is not
available and all ones when the request element is available.)
Bytes 6, 7, and 8
indicate the address of the input/output block.
Byte 9
indicates the priority of the request.

Execute Channel Program (EXCP) Macro-Instruction 81


Bytes 10, 11, and 12
indicate the address of the data extent block.
The request element is normally 12 bytes in length; however, in
a multitasking environment, it includes 4 wore bytes that
indicate the address of the TCB.
• Register 2 contains the address of the input/output block (lOB).
• Register 3 contains the address of the data extent block (DEB).

• Register 4 contains the address of the data control block (DCB).


• Register 7 contains the address of the unit control block (UCB).
The system places, into register 14, the address of the location in
the input/output supervisor to which control is to be returned after
execution of the appendage. When passing control from an appendage to
the system, you may use displacements to the return address in register
14 for optional return procedures. Some of these procedures differ in
their treatment of the request element associated with the channel
prograrr.

You may not change register 1 in an appendage. Register 9, if used,


must be set to binary zero before control is returned to the system.
All other registers, except those indicated in the descriptions of each
appendage, must be saved and restored if they are used.
The types of appendages are listed in the following paragraphs, with
explanations of when they are entered, how they return control to the
system, and which registers they may use without saving and restoring.

start Input/Output (SIO) Appendage

This appendage is entered before the input/output supervisor issues a


start input/output (SIO) instruction for an I/O operation.
If the return address in register 14 is used to return control to the
input/output supervisor, the I/O operation is executed normally. You
may optionally bypass the SIO instruction and prevent execution of the
channel progra~ by using the contents of register 14 plus 4 as the
return address. In this case, the thannel program is not posted
complete, but its request element is made available.
You may use registers 10 and 11 in a start input/output appendage
without saving and restoring their contents.
Program Controlled Interruption (PCI) AEEendage
This appendage is entered when a program controlled interruption
occurs. At the time of the interruption, the contents of the channel
status word will not have been placed in the "channel status word" field
of the input/output block. The channel status word can be obtained from
location 64. You must use the return address in register 14 to allow
the system to proceed with normal interruption processing.
You may use registers 10 through 13 in a program controlled
interruption appendage without saving and restoring their contents.
End-of-Extent Appendage
This appendage is entered when the seek address specified in the
input/output block is outside the allocated extent limits indicated in
the data extent block.

82
If you use the return address in register 14 to return control to the
system, the abnormal end appendage is entered. An end-of-extent error
code is placed in the "ECB code" field of the input/output block for
subsequent posting in the event control block.
You may use the following optional return addresses:

• Contents of register 14 plus 4 The channel program is posted


complete, and its request element is made available.
• contents of register 14 plus 8 - The request is tried again.
You may use registers 10 through 12 in an end-of-extent appendage
without saving and restoring their contents.
Note: If an end-of-cylinder or file-protect condition occurs, the
input/output supervisor updates the seek address to the next higher
cylinder or track address, a~d re-executes the request. If the new seek
address is within the data s~t's extent, the request is executed; if the
new seek address is not within the data set's extent, the end-of-extent
appendage is entered.
If a file protect condition occurs and was caused by a full seek
(command code=07) imbedded within a channel program, the request is
flagged as a permanent error, and the abnormal end appendage is entered. '~

Channel End Appendage


This appendage is entered when a channel end, channel end with unit
exception, or channel end with wrong length record occur without any
other abnormal end conditions.
If you use the return address in register 14 to return control to the
system, the channel program is posted complete, and its request element
is made available. In the case of unit exception or wrong length
record, the error recovery procedure is perforrred before the channel
prograrr is posted complete.
You may use the following optional return addresses:
• Contents of register 14 flus 4 - The channel program is not posted
complete, but its request element is made available.

• Contents of register 14 plus 8 - The channel program is not posted


complete, and its request element is placed back on the request
queue so that the request can be retried. For correct re-execution
of the channel program, you must re-initialize the "Flags 1" and
"Flags 2" fields of the input/output tlock and set the "Error
Counts" field to zero.
• Contents of register 14 plus 12 - The channel program is not posted
complete, and its request elerrent is not made available. (The
request element is assumed to be used in a subsequent asynchronous
exit routine.)
You may use registers 10 through 13 in a channel end appendage
without saving and restoring their ccntents.
Abnormal End Appendage
This appendage is entered when a unit check, channel chaining check,
program check, or protection check is detected with normal ending
conditions. In the case of error conditions that can be retried by the
system's error routines, the appendage is entered a second time when the
input/output supervisor deterrrines that the error is permanent.

Execute Channel Program (EXCP) Macro-Instruction 83


To determine if an error is permanent, you should check the "ECB
code" field of the input/output block. To determine the type of error,
check the channel status word and the sense information. If you use the
return address in register 14 to r.eturn control to the system, the
channel program is posted complete, and its request element is made
available. You may use the following optional return addresses:
• Contents of register 14 plus 4 - The channel program is not posted
complete, but its request element is made available.
• Contents of register 14 plus 8 - The channel program is not posted
complete, and its request eleITent is placed back on the request
queue so that the request can be retried. For correct re-execution
of the channel program, you rrust re-initialize the "Flags~" and
"Flags 2" fields of the input/output block and set the "Error
Counts" field to zero.
• Contents of register 14 plus 12 - The channel program is not posted
complete, and its request element is not made available. (The
request element is assumed to be used in a subsequent asynchronous
exit. )
You may use registers 10 through 13 in an abnormal end appendage
without saving and restoring their contents.

EXCP PROGR8MMING SPECIFICATIONS


This section describes the parameters of the macro-instructions that
you must use with EXCP, and the fields of the required control blocks.

MACRO-INSTRUCTIONS
If you are using the EXCP macro-instruction you must also use DCB,
OPEN, CLOSE, and, in some cases, the EOV macro-instruction. The
parameters of these macro-instructions, and of the EXCP macro-
instruction itself, are listed and explained here. A diagram of the
data control block is included with the description of the DCB
macro-instruction.
DCB -- Define Data Control Block for EXCP
The EXCP form of the DCB macro-instruction produces a data control
block that can be used with the EXCP macro-instruction. You must issue
a DCB macro-instruction for each data set to be processed by your
channel programs. Notation conventions and format illustrations of the
DCB macro-instruction are given in the publication IBM System/360
Operating System: Control Program Services, Form C28-6S41. DCB parame-
ters that apply to EXCP may be divided into four categories, depending
on the following portions of the data control block that are generated
when they are specified:
• Foundation block. This portion is required and is always 12 bytes
in length. You must specify the two parameters in this category.
• EXCP interface. This portion is optional. If you specify any
parameter in this category, 20 bytes are generated.
• Foundation block extension and cowmon interface. This portion is
optional and is always 20 bytes in length. If this portion is
generated, the device dependent portion is also generated.
• Device dependent. This portion is optional and is generated only if
the foundation block extension and common interface portion is

84
generated. Its size ranges from 4 to 20 bytes, depending on
specifications in the DEVD parameter of this category. However, if
you do not specify the DEVD parameter (and the foundation extension
and common interface portion is generated), the maximum 20 bytes for
this portion are generated.
Some of the procedures performed by the system when the data control
block is opened and closed (such as writing file marks for output data
sets on direct-access volumes) require information from optional data
control block fields. You should rrake sure that the data control block
is large enough t:o provide all information necessary for the procedures
you want the system to handle.
Figure 9 shows the relative position of each portion of an opened
data control block. The fields corresponding to each parameter of the
DCB macro-instruction are also designated, with the exception of DDNAME,
which is not included in a data control block that has been opened. The
fields identified in parentheses represent system inforrr.ation that is
not associated with parameters of the DCB macro-instruction.
Sources of information for data control block fields other than the
DCB macro-instruction are data definition (DD) statements, data set
labels, and data control block modification routines. You may use any
of these sources to specify DCB parameters. However, if a portion of
the data control block is not generated by the DCB macro-instruction,
the system does not accept information intended for that portion from
any alternative source.
FOUNDATION BLOCK PARAMETERS:
DDNAME=symbol
specifies the name of the data definition (DD) statement that
describes the data set to be processed.
MACRF=(E)
specifies that the EXCP macro-instruction is to be used in
processing the data set.
EXCP INTERFACE PARAMETERS:
EOEA=symbol
specifies the 2-byte identification of an end-of-extent appendage
that you have entered into the SVC library.
PCIA=symbol
specifies the 2-byte identification of a program controlled
interruption (PCI) appendage that you have entered into the SVC
library.
SIOA=symbol
specifies the 2-byte identification of a start I/O (SIO) appendage
that you have entered into the SVC library.
CENDA=symbol
specifies the 2-byte identification of a channel end appendage that
you have entered into the SVC library.
XENDA=symbol
specifies the 2-byte identification of an abnormal end appendage
that you have entered into the SVC library.
Note: The full name of an appendage is eight bytes in length, but the
first six bytes are required by IBM standards to be the characters
IGG019. You provide the last two characters as the 2-byte identifi-
cation; they may range in collating sequence from WA to Z9.

Execute Channel Program (EXCP) Macro-Instruction 85


DCB
r-------------------------------------------,
Address The device dependent portion of
the data control block varies
+ 4 in length and format according
to specifications in the DSORG
and DEVD parameters. Illustra- Device
+ 8 tions of this portion for each Dependent
device type are included in
the description of the DEVD
+12 parameter.

+16
~----------T--------------------------------1
I I I
+20 I BUFNO I BUFCB I
~----------L----------T---------------------1
I I I Common
+24 I BUFL I DSORG I Interface
~---------------------L---------------------i
I I
+28 I IOBAD I
~----------T--------------------------------~
I BFTEK, I I
+32 I BFALN I EO DAD I
~----------+--------------------------------i Foundation Block
I I I Extension
+36 I RECFM I EXLST I
~----------L----------T---------------------i
I I I
+40 I (TIOT) I MACRF I
~----------T----------L---------------------1
I I I
+44 I (IFLGS) I (DEB Address) I Foundation Block
~----------+--------------------------------1
I I I
+48 I (OFLGS) I Reserved I
~----------L--------------------------------~
I I
+52 I Reserved I
~-------------------------------------------i
I I
+56 I Reserved I
~---------------------T---------------------i
I I I
+60 I EOEA I PCIA I EXCP Interface
~---------------------+---------------------~
I I I
+64 I SIOA I CENDA I
~---------------------+---------------------~
I I I
+68 IL _____________________
XENDA LI _____________________
Reserved JI

Figure 9. Data Control Block Format fer EXCP (After OPEN)

FOUNDATION BLOCK EXTENSION AND COMMON INTERFACE PARAMETERS:


EXLST=relexp
specifies the address of an exit list that you have written for
exceptional conditions. The format of this exit list is given in
Appendix D of the publication IBM System/360 Operating System:
Control Program Services.

86
EODAD=relexp
specifies the address of your end-of-data set routine. If this
routine is not available when it is required, the task is
abnormally terminated.
DSORG=code
specifies the data set organization as one of the following codes.
Each code indicates that the format of the device dependent portion
of the data control block is to be similar to that generated for a
particular access method:

Code DCB Format for


PS QSAM or BSAM
PO BPAM
DA BDAM
IS QISAM or BISAM

Note: For direct-access devices, if you specify either PS or PO, you


must maintain the following fields of the device dependent portion of
the data control block so that the system can write a file mark for
output data sets:
• The track balance (TRBAL) field, which contains a 2-byte binary
nuwber that indicates the remaining numter of bytes on the current
track •
• The full disk address (FDAD-MBBCCHHR) field, which indicates the
location of the current record.

IOBAD=relexp
specifies the address of an input/output block (lOB). If a pointer
to the current lOB is not required, you may use this field for any
purpose.
The following parameters are not used ty the EXCP routines but
provide cataloging information about the data set. This information can
be used later by access method routines that read or update the data
set.
RECFM=code
specifies the record format of the data set. Record format codes
are given in the IBM System/360 Operating System: Control Program
Services publication.
BFTEK={SIE}
specifies the buffer technique as either simple or exchange.
BFALN={FID}
specifies the word boundary alignment of each buffer as either full
word or double word.
BUFL=absexp
specifies t.he length in bytes of each tuffer; the maxiwum length is
32,767.
BUFNO=absexp
specifies the nurober of buffers assigned to the associated data
set; the maximum number is 255.
BUFCB=relexp
specifies the address of a buffer pool control block, i.e., the
8-byte field preceding the buffers in a buffer pool.

Execute Channel Program (EXCP) Macro-Instruction 87


DEVICE DEPENDENT PARAMETERS:

DEVD=code
specifies the device on which the data set may reside as one of the
following codes. The codes are listed in order of descending space
requirements for the data control block:
Code Device

DA Direct-access
TA Magnetic tape
PT Paper tape
PR Printer
PC Card punch
RD Card reader

~ote: If you do not wish to select a specific device until job set up
1:ime, you should specify the device type requiring the largest area.

The following diagrams illustrate the device dependent portion of the


data control block for each devi.ce type specified in the DEVD pararoeter,
and for each data set organization specified in the DSORG parameter.
Fields that correspond to device dependent parameters in addition to
DEVD are indicated by the para~eter name. For special services, you may
have to maintain the fields shown in parentheses. The special services
are explained in the note that follows the diagram.

Device dependent portion of data control block when DEVD=DA and


DSORG=PS or po:

DCB r-------T---------------------,
Address + 4 IReservdl I
~ _______ J I
I I
+ 8 I (FDAD - MBBCCHHR) I
I I
I r---------------------~
+12 I I Reserved I
~-------+-------T-------------~
+16 LI KEYLEN ReservQ I _____________
_______ I _______
~
(TRBAl)
~ JI

Note: For cutput data sets, the system uses the contents of the full
disk address (FDAD-MBBCCHHR) field plus one to write a file mark when
the data control block is closed, provided the track balance lTRBAL)
field indicates that space is availatle. You must maintain the contents
of these two fields yourself if the system is to write a file mark.
Device dependent portion of data control block when DEVD=DA and
DSORG=IS or DA:

DCB r-------T---------------------,
_______ LI _____________________
Address +16 LIKEYLEN Reserved JI

Device dependent portion of data control block when DEVD=TA and


DSORG=PS:

DCB
Address +12 I
r-----------------------------,
(BLKCT) I
~------T-------T-------T------~
+16 LITRTCH IReservdlDEN IResrvdl
______ _______ _______ ______ J
~ ~ ~

88
Note: For output data sets, the system uses the contents of the block
count (BLKCT) field to write the block count in trailer labels when the
data control block is closed, or when the EOV macro-instruction is
issued. You must maintain the contents of this field yourself if the
system is to write the correct block count.

Device dependent portion of data control block when DEVD=PT and


DSORG=PS:

DCB r------T----------------------,
Address +16 LICODE
______ I ______________________
~
Reserved JI

Device dependent portion of data control block when DEVD=PR and


DSORG=PS:

DCB r------T----------------------,
Address +16 LIPRTSP
______ LI __________
Reserved
- ___________ JI

Device dependE~nt portion of data control block when DEVD=PC or RD and


DSORG=PS:

DCB r-----------T-----------------,
L ___________ I _________________
Address +16 IMODE,STACK Reserved
~ JI

The following parameters pertain to specific devices and may be


specified only when the DEVD parameter is specified.

KEYLEN=value
specifies, for direct-access devices, the length in bytes of the

The following parameters pertain to specific devices and may be


specified only when the DEVD parameter is specified.

KEYLEN=value
specifies, for direct-access devices, the length in bytes of the
key of a physical record, with a maximum value of 255. When a
block is read or written, the number of bytes transmitted is the
key length plus the record length.

CODE=value
specifies, for paper tape, the code in which records are punched as
follows:

Value
I IBM BCD
F Friden
B Burroughs
C National Cash Register
A ASCII
T Teletype
N no conversion
(forrrat F records
only)

If this parameter is omitted, N is assumed.

DEN=value
specifies, for magnetic tape, the tape recording density in bits
per inch as follows:

Execute Channel Program (EXCP) Macro-Instruction 89


r----------------------------------T-----------------------------------,
I I Density I
I Value ~-----------------T-----------------~
I I
Model I Model I
I I
2400 I 2400 I
I I
7-track I 9-track I
~----------------------------------+-----------------+-----------------~
I 0 I 200 I I
I 1 I 556 I I
IL __________________________________
2 I _________________
~ 800 I _________________
~ 800 JI

If this parameter is omitted, the lowest density is assumed.

TRTCH=value
specifies, for 7-track magnetic tape, the tape recording technique
as follows:
Value, Tape Recording Technique
C Data conversion feature is available.

E Even parity is used. (If omitted, odd parity is


assumed. )

T BCDIC to EBCDIC translation is required.


MODE=value
specifies, for a card reader or punch, the mode of operation.
Either C (column binary mode) or E (EBCDIC code) may be specified.

STACK=value
specifies, for a card punch or card reader, the stacker bin to
receive cards as either 1 or 2.
PRTSP=value
specifies, for a printer, the line spacing as either 0, 1, 2, or 3.

OPEN -- Initialize Data Control Block


The OPEN macro-instruction initializes one or more data control
blocks so that their associated data sets can be processed. You must
issue OPEN for all data control blocks that are to be used by your
channel programs. Some of the procedures performed when OPEN is
executed are:
• Construction of data extent block (DEB).
• Transfer of information from DD statements and data set labels to
data control block.
• Verification or creation of standard labels.
• Tape positioning.
• Loading of programmer-written appendage routines.
The three parameters of the OPEN macro-instruction are:
dcb-addr
specifies the address of the data control block to be initialized.
(More than one data control block may be specified.)

specifies the intended method of I/O processing of the data set.


You may specify this parameter as either INPUT, RDBACK, or OUTPUT.
For each of these, label processing when OPEN is executed is as
follows:

90
INPUT - Header labels are verified.
RDBACK - Trailer labels are verified.
OUTPUT - Header labels are created.

If this parameter is omitted, INPUT is assumed.

specifies the volume disposition that is to te provided 'Nhen volume


switching occurs. The operand values and rreanings are as follows:

REREAD Reposition the volume to process the data set again.

LEAVE No additional positioning is performed at end-of-volume


processing.

DISP The disposition indicated on the DD statement is tested


and appropriate positioning provided. This service is
assumed if this operand is omitted and volume position-
ing is applicable. If there is no disposition specified
in the DD statement when this operand is specified,
LEAVE is assurred.

EXCP -- Execute Channel Program

The EXCP macro-instruction requests the initiation of the I/O


operations of a channel program. You must issue EXCP whenever you 'Nant
to execute one of your channel programs. The only parameter of the EXCP
macro-instruction is:

iob-addrx
specifies the address, or a register that contains the address of
the input/output block of the channel program to be executed.

EOV End of Volume

The EOV macro-instruction identifies end-of-volume and end-of-data


set conditions. For an end-of-volume condition, EOV causes s'Nitching of
volumes and verification or creation of standard labels. For an
end-of-data set condition, EOV causes your end-of-data set routine to be
entered. You issue EOV if switching of ~agnetic tape or direct-access
volumes is necessary, or if secondary allocation is to be performed for
a direct-access data set opened for output.

For magnetic tape, you must issue EOV when either a tape mark is read
or a reflective spot is written over. In these cases, bit settings in
the i-byte OFLGS field of the data control block determine the action to
be taken when EOV is executed. Before issuing EOV for magnetic tape,
you must make sure that appropriate bits are set in OFLGS. Bit
positions 2,3,6, and 7 of OFLGS are used only by the system; you are
concerned with bit positions 0,1,4, and 5. The use of these OFLGS bit
positions is as follows:

Bit 0
indicates that a tape mark is to be written.

Bit 1
indicates that a backwards read was the last I/O operation.

Bit 4
indicates that data sets of unlike attributes are to be concatenat-
ed.

Bit 5
indicates that a tape mark has been read.

Execute Channel Program (EXCP) Macro-Instruction 91


If'Bits 0 and 5 of OFLGS are both off when EOV is executed, the tape
is spaced past a tape rrark, ana standard latels, if present, are
verified on both the old and new volumes. The direction of spacing
depends on Bit 1. If Bit 1 is off, the tape is spaced forward; if Bit 1
is on, the tape is backspaced.

If Bit 0 is on when EOV is executed, a tape roark is written


immediately following the last data record of the data set, standard
labels, if specified, are created on the old and the new volurre.
When issuing EOV for sequentially organized output data sets on
direct-access volumes, you can determine whether additional space has
been obtained on the same or a different volume. You do this by
checking the volume serial number in the unit control block (UCB) both
before and after issuing EOV.
The only parameter of the EOV macro-instruction is:
dcb-addrx
specifies the address of the data control block that is opened for
the data set. If this pararoeter is specified as (1), register 1
must contain this address.

CLOSE -- Restore Data Control Block


The CLOSE macro-instruction restores one or rrore data control blocks
so that processing of their associated data sets can be terminated. You
must issue CLOSE for all data control blocks that were used by your
channel programs. Some of the procedures performed when CLOSE is
executed are:
• Release of data extent block (DEB).
• Removal of information transferred to data control block fields when
OPEN was executed.
• Verification or creation of standard latels.
• Volume disposition.
• Release of programmer-written appendage routines.
The two parameters of the CLOSE macro-instruction are:
dcb-addr
specifies the address of the data control block to be restored.
More than one data control block rray te specified.
opt
specifies the type of volume disposition intended for the data set.
You may specify this parameter as either LEAVE or REREAD. The
corresponding volume disposition when CLOSE is executed is as
follows:
LEAVE Volume is positioned at logical end of data set.
REREAD - Volume is positioned at logical beginning of data set.
DISP - The disposition indicated on the DD statement is tested,
and appropriate positioning is provided. This service is
assumed if this operand is omitted and volume positioning
is applicable. If there is no disposition specified in
the DD statement when this operand is specified, LEAVE is
assumed.
This parameter is ignored if specified for volumes other than
magnetic tape or direct-access.

92
Note: When CLOSE is issued for data sets on magnetic tape volumes,
labels are processed according to bit settings in the OFLGS field of the
data control block. Before issuing CLOSE for magnetic tape, you must
set the appropriate bits in OFLGS. The OFLGS bit positions that you are
concerned with are listed in the description of the EOV macro-
instruction.

CONTROL BLOCK FIELDS


The fields of the input/output block, event control block, and data
extent block are illustrated and explained here; the data control block
fields have been described with the parameters of the DCB macro-
instruction instruction in the section "EXCP Programming
Specifications."
Input/Output Block Fields
The input/output block is not automatically constructed by a macro-
instruction; it must be defined as a series of constants and must be on
a full-word boundary. For nondirect-access devices, the input/output
block is 32 bytes in length. For direct-access devices, 8 additional
bytes must be provided.
In Figure 10, the shaded areas indicate fields in which you must
specify information. The other fields are used by the system and must
be defined as all zeros. You may not place information into these
fields, but you may examine them.

lOB
Address

+4

+8

+12 All
Devices
+16

+20

+24

+28

+32 Direct-
Access
Devices
+36
Only

Figure 10. Input/Output Block Format


Flags 1 (1 byte)
specifies the type of channel program. You must set bit positions
0, 1, and 6. One bits in positions 0 and 1 indicate data chaining
and command chaining, respectively. (If both data chaining and
command chaining are specified, the system does not use error
recovery routines except for the 2311, 2671, 1052, and 2150.) A
one bit in position 6 indicates that the channel program is not
related to any other channel prograrr. Bit positions 2, 3, 4, 5,
and 7 are used only by the system.

Execute Channel Program (EXCP) Macro-Instruction 93


Flags 2 (1 byte)
is used only by the system.

First Two Sense Bytes (2 bytes)


are placed into the input/output block by the system when a unit
check occurs.
ECB Code (1 byte)
indicates the first byte of the conpletion code for the channel
program. The system places this code in the high order byte of the
event control block when the channel program is posted complete.
The completion codes and their meanings are listed under "Event
Control Block Fields."
ECB Address (3 bytes)
specifies the address of the 4-byte event control block that you
have provided.
Flags 3 (1 byte)
is used only by the system.
Channel status Word (7 bytes)
indicates the low order seven bytes of the channel status word,
which are placed into this field each time a channel end occurs.
SIO Code (1 byte)
indicates, in the four low-order bits, the instruction length and
condition code for the SIO instruction that the systerr issues to
start the channel program.
Channel Program Address (3 bytes)
specifies the starting address of the channel program to be
executed.
Reserved (1 byte)
is used only by the system.
DCB ~ddress (3 bytes)
specifies the address of the data control block of the data set to
be read or written by the channel program.
Reposition Modifier (1 byte)
is used by the system for volume repositioning in error recovery
procedures.
Restart Address (3 bytes)
is used by the system to indicate the starting address of a channel
prograro that performs special functions for error recovery
procedures. The system also uses this field in procedures for
making request elements available, as explained under "Error
Recovery Procedures for Related Channel Prcgrams."
Block Count Increment (2 bytes)
specifies, for magnetic tape, the amount by which the block count
(BLKCT) field in the device dependent portion of the data control
block is to be incremented. You may alter these bytes at any time.
For forward operations, these bytes should contain a binary
positive integer (usually + 1); for backward operations, they
should contain a binary negative integer. When these bytes are not
used, all zeros must be specified.
Error Counts (2 bytes)
indicates the number of retries attempted during error recovery
procedures.

94
Extent M (1 byte)
specifies, for direct-access or telecorr.munications devices, which
extent entry in the data extent block is associated with tne
channel program. (0 indicates the first extent; 1 indicates the
second, etc.)
BBCCHER (7 bytes)
specifies, for direct-access devices, the seek address for tne
programmer's channel program.
Event Control Block Fields
You must define an Event control tlock as a 4-byte area on a
full-word boundary. When the channel program has been completed, the
input/output supervisor places a' completion cede containing status
information into the event control block (Figure 11). Before examining
this information, you must test for the setting of the "Complete Bit."
If the complete bit is not on, and the problem program cannot perform
other useful operations, you should issue a WAIT macro-instruction that
specifies the event control block. Under no circumstances may you
construct a program loop that tests for the complete bit.

r----------T----------T------------------------------------------------,
I WAIT I Complete I Remainder of Completion Cede I
J Bi t=O I I I
IL __________ I __________
~ Bit=l I ________________________________________________ JI
~

o 1 2 31

Figure 11. Event Control Block After Posting of Completion Code


WAIT Bit
A one bit in this position inJicates that the WAIT macro-
instruction has been issued, but that the channel program has not
teen completed.
Complete Bit
- A one cit in this position indicates that the channel program has
teen completed; if it has not been comfleted, a. zero bit is in this
position.

Completion Code
This code, which includes the WAIT and Complete bits, may be one of
the following 4-byte hexadecimal expressions:
Code Interpretation
7FOOOOOO Channel program has terminated without error.
41000000 Channel program has terminated with permanent
error.
42000000 Channel program has terminated because a
direct-access extent address has been violated.
44000000 Channel program has been intercepted because of
perrranent error associated with device end for
previous request. You may reissue t~~ inter-
cepted request.
48000000 Request element for channel program has been
maoe availatle aftEr it has been purged.
4FOOOOOO Error r~covery routines have been entered
because of direct-access error but are unable
to read horoe address or record O.

Execute Channel Program (EXCP) Macro-Instruction 95


Data Extent Block Fields
The data extent block is constructed by the system when an OPEN
macro-instruction is issued for the data control block. You may not
modify the fields of the data extent block, but you may examine them.
The Data Extent Block format and field description is contained in the
System Control Block publication.

96
APPENDIX: RESTORE MACRO-INSTRUCTION
If you want to use the RESTORE macro-instruction, you must either add
the macro-definition to the macro-litrary (SYS1.MACLIB) or place it in a
separate partitioned data set and concatenate this data set to the
macro-library. This section contains the following:

• The format of the macro-instruction.


• The Jot Control and utility statements needed to add the macro-
definition to the library.
• The macro-definition to be added to the litrary.

RESTORE Macro-Instruction

This macro-instruction is used to return purged request elements to


the request queues. The format of this macro-instruction is as follows:

r------T-----------T---------------------------------------------------,I
I Name I Operation I Operand
~------+-----------+---------------------------------------------------~
IL ______ LI ___________
RESTORE LI ___________________________________________________
User Purge lOB Address JI

The user purge lOB address is in the data extent tlock (DEB).

Control Statements Required

r----------------------------~-----------------------------------------,
//jobname JOB {parameters}
//stepname EXEC PGM~IEBUPDAT,PARM=NEW
//SYSPRINT DD SYSOUT=A
//SYSUT2 DD DSNAME=SYS1.MACLIB,DISP=OLD
//SYSIN DD DATA
./ ADD RESTORE,OO,O,l

RESTORE Macro-Definition

./ ENDUP
/*

RESTORE Macro-Definition
MACRO
&NAME RESTORE &LIST
AIF ('&LIST' EQ ").E1
&NAME IHBINNRA &LIST LOAD REG 1
SVC 17 ISSUE SVC FOR RESTORE
MEXIT
.El IHBERMAC 01,150 LIST ADDR MISSING

Execute Channel Program (EXCP) Macro-Instruction 97


EXECUTE DIRECT ACCESS PROGRA~ (XDAP) MACRO-INSTRUCTION

This chapter explains what the Execute


Direct-Access Program (XDAP) macro-
instruction does and how yeu can use it.
The control block generated when XDAP is
issued and the rracro-instructions uSEd with
XDAP are also discussed.
The XDAP macro-instruction provides you
with a roeans of reading, verifying, or
updating blocks on direct-access volumes
without using an access method and without
writing your own channel frogram. SincE
most of the specifications for XDAP are
similar to those for the Execute Channel
program (EXCP) macro-instructicn, it is
recommended that you be falliiliar with the
"EXCP Macro-Instruction" chapter of this
putlication, as well as with the
information contained in the required fut-
lication.

PREREQUISITE PUBLICATION
The IBM Systero/360 Operating System:
Data Managewent putlication (Form C28-6537)
explains the standard procedures fer I/O
processing under the operating system.

98
EXECUTE DIRECT ACCESS PROGRAM (XDAP) MACRO-INSTRUCTION

Execute Direct Access Program eXDAP) is a roacro-instruction of


System/360 Operating System that you rray use to read, verify, or update
a block on a direct-access volume. If you are not using the standard
IBM data access methods, you can, by issuing XDAP, generate the control
information and channel program necessary for reading or updating the
records of a data set.
You cannot use XDAP to add blocks to a data set, but you can use it
to change the keys of existing blocks. Any block configuration and any
data set organization can be read or updated.
Although the use of XDAP requires much less main storage space than
do the standard access methods, it does not provide many of the control
program services that are inc~uded in the access methods. For example,
when XDAP is issued, the system does not block or deblock records and
does not verify block length.
To issue XDAP, you must provide the actual device address of the
track containin:j the block to be processed. Yeu roust also provide
either the block identification or the key of the tlock, and specify
which of these is to be used to locate the block. If a block is located
by identification, both the key and data portions of the block may be
read or updated. If a block is located by key, only the data portion
can be processed.

REQUIREMENTS FOR EXECUTION OF DIRECT-ACCESS PROGRAM


Before issuing the XDAP macro-instruction, you roust issue a DCB
macro-instruction, which produces a data control block (DCB) for the
data set to be read or ppdated. You must also issue an OPEN
macro-instruction, which initializes the data control block and produces
a data extent block (DEB).
When the XDAP macro-instruction is issued, another control block,
containing both control information and executable code, is generated.
This control block may be logically divided into three sections:

• An event control block (ECB), which is supplied with a completion


code each time the direct access channel program is terminated.
• An input/output block (lOB), which contains information about the
direct access channel program.
• A direct access channel program, which consists of three channel
command words (CCWs). The type of channel program generated depends
on specifications in the parameters of the XDAP macro-instruction.

After this XDAP control block is constructed, the direct-access channel


program is executed. A block is located by either its actual address or
its key, and is either read or updated.
When the channel program has terminated, a completion code is placed
into the event control block. After issuing XDAP, you should therefore
issue a WAIT macro-instruction specifying the event control block to
determine whether the direct-access program has terminated. If voluwe
switching is necessary, you must issue an EOV macro-instruction. When
processing of the data set has been completed, you must issue a CLOSE
macro-instruction to restore the data control block.

Execute Direct Access Program (XDAP) Macro-Instruction 99


XDAP PROGRAMMING SPECIFICATIONS
MACRO-INSTRUCTIONS
When you are using the XDAP macro-instruction, you must also issue
DCB, OPEN, CLOSE, and, in some cases, the EOV macro-instruction. The
parameters of the XDAP macro-instruction are listed and described here.
For the other required macro-instructions, special requirements or
options are explained, but you should refer to the "EXCP
Macro-Instruction" section of this publication for listings of their
parameters.
DCB -- Define Data Control Block
The EXCP form of the DeB macro-instruction produces a data control
block that can be used with the XDAP macro-instruction. You must issue
a DCB macro-instruction for each data set to be read or updated by the
direct-access channel program. The "EXCP Macro-Instruction" section of
this publication contains a diagram of the data control block, as well
as a listing of the parameters of the DCB macro-instruction.
OPEN -- Initialize Data Control Block

The OPEN macro-instruction initializes one or more data control


blocks so that their associated data sets can be processed. You must
issue OPEN for all data control blocks that are to be used by the direct
access program. Sonte of the procedures performed when OPEN is executed
are:

• Construction of data extent block (DEB).

• Transfer of information from DD statements and data set labels to


data control block.

• Verification or creation of standard labels.


• Loading of programrr.er-written appendage routines.
The two parameters of the OPEN macro-instruction are the addressees)
of the data control block(s) to be initialized, and the intended method
of I/O processing of the data set. The method of processing may be
specified as either INPUT or OUTPUT; however, if neither is specified,
INPUT is assumed.
XDAP -- Execute Direct-Access Prograrr
The XDAP macro-instruction produces the XDAP control block (i.e., the
ECB, lOB, and channel program) and executes the direct-access channel
program. The format of the XDAP macro-instruction is:

r-----------T----------------------------------------------------------,I
I Operation I Operand
.-----------+----------------------------------------------------------~
I XDAP I ecb-symbol,type-{RIWIV}{IIK},dcb-addr,area-addr I
L I
I ___________ L __________________________________________________________
,length-value,[(key-addr,keylength-value)],blkref-addr JI

ecb-symbol
specifies the symbolic name to be assigned to the XDAP control
block.
type-{RIWIV}{IIK}
specifies the type of I/O operation intended for the data set and
the method by which blocks of the data set are to be located. The
codes and their meanings are as follows:

100
R - Read a block.
W- Write a block.
V - Verify contents of a block but do not transfer data.
I - Locate a block by identification. (The key portion, if
present, and the data portion of the block are read or
written. )
K - Locate a block by key. (Only the data portion of the
block is read or written.)
dcb-addr
specifies the address of the data control tlock of the data set.
area-addr
specifies the address of an input or output area for a block of the
data set.
length-value
specifies the number of bytes to be transferred to or from the
input or output area. If blocks are to be located by identifi-
cation and the data set contains keys, the value must include the
length of the key. The maximum number of bytes transferred is
32767.

key-ador
specifies, when blocks are to be located by key, the address of a
main storage field that contains the key of a block to be read or
overwritten.
keylength-value
specifies, when blocks are to be located by key, the length of the
key. The maximum length is 255 tytes.
blkref-addr
specifies the address of a main storage field containing the actual
device addrless of the track containing the 1::lock to be located.
When blocks are to be located by key, this field is seven bytes in
length; when blocks are to be located by identification, an eighth
byte indicating block identification must be included in this
field. (The actual address of a block is in the form MBBCCHHR,
where M indicates which extent entry in the data extent block is
associated with the direct-access program; BB indicates the bin
number of direct-access volurre; CC indicates the cylinder address;
HH indicates the actual track address; and R indicates the block
identification.)
EOV End of Volume
The EOV mac:ro-instruction identifies end-of-volume and end-of-data
set conditions. For an end-of-volume condition, EOV causes switching of
volumes and verification or creation of standard labels. For an
end-of-data set condition, EOV causes your end-of-data set routine to be
entered. When using XDAP, you issue EOV if switching of direct-access
volumes is necessary, or if secondary allocation is to be performed for
a direct-access data set opened for output.
The only parameter of the EOV macro-instruction is the address of the
data control block of the data set.
CLOSE -- Restore Data Control Block
The CLOSE macro-instruction restores one or more data control blocks
so that processing of their associated data sets can be terminated. You
must issue CLOSE for all data sets that were used by the direct access
channel program. Some of the procedures performed when CLOSE is
executed are:

Execute Direct Access Program (XDAP) Macro-Instruction 101


• Release of data extent block (DEB).

• Removal of information transferred to data control block fields when


OPEN was executed.

• Verification or creation of standard labels.


• Release of programmer-written appendage routines.

The only parameter of the CLOSE macro-instruction is the address of


the data control block to be restored. (More than one data control
block may be specified.)

THE XDAP CONTROL BLOCK


The three portions of the control block generated during execution of
the XDAP macro-instruction are described here.
Event Control Block (ECB)

The event control block begins on a full word boundary and occupies
the first 4 bytes of the XDAP control block. Each time the direct-
access channel program terminates, the input/output supervisor places a
completion code containing status inforrr.ation into the event control
block (Figure 12). Before examining this information, you must test for
the setting of the "Complete Bit" by issuing a WAIT macro-instruction
specifying the event control block.

r--------------T------------------T------------------------------------,
IL ______________ I __________________ I ____________________________________
WAIT Bit=O ~
Complete Bit=l ~
Remainder of Completion Code JI

o 1 2 31

Figure 12. Event Control Block After Posting of Completion Code

WAIT Bit
A one bit in this position indicates that the WAIT macro-
instruction has been issued, but that the direct-access channel
program has not been completed.

Corrplete Bit
A one bit in this position indicates that the channel program has
been completed; if it has not been completed, a zero bit is in this
position.

Completion Code
This code, which includes the WAIT and Complete bits, may be one of
the following 4-byte hexadecimal expressions:

Interpretation
7FOOOOOO Direct-access program has terminated without
error.

41000000 Direct-access program has terminated with


permanent error.
42000000 Direct-access program has terminated because a
direct-access extent address has been violated.
44000000 Channel program has been intercepted because of
perrranent errcr associated with device end for
previous request. You may reissue the inter-
certed request.

102
48000000 Request elerrent for channel program has been
made availatle after it has been purged.
4FOOOOOO Error recovery routines have been entered
because of direct-access error but are unable
to read howe address or record O.

Input/Output Block (lOB)

The input/output block is 40 bytes in length and immediately follows


the event control block. The section "EXCP MacrO-Instruction" of this
publication contains a diagram of the input/output block. The only
fields with which the user of XDAP is concerned are the "First Two Sense
Bytes" and "Channel status Word" fields. You may wish to examine these
fields when a unit check condition or an I/O interruption occurs.

Direct-Access Channel Program

The direct-access channel program is 24 bytes in length and irrmedi-


ately follows the input/output clock. Depending on the type of I/O
operation specified in the XDAP macro-instruction, one of four channel
programs may be generated. The three channel corrmand words for each of
the four possible channel programs are shown in Figure 13.

r----------------.----------T-----T-------------------------------------,
I Type of I/O Operation I CCW I Coromand Code I
~--------------------------+-----+-------------------------------------~
I Read by Identification I 1 I Search ID Equal I
I I 2 I Transfer in Channel I
I Verify by Identification 1 1 3 I Read Key and Data I
~----------------.----------+-----+-------------------------------------~
I Read by Key I 1 I Search Key Equal I
I I 2 I Transfer in Channel I
I Verify by Key1 I 3 I Read Data I
~----------------.----------+-----+-------------------------------------~
I I 1 I Search ID Equal I
I Write by Identification I 2 I Transfer in Channel I
I I 3 I Write Key and Data I
~--------------------------+-----+-------------------------------------~
I I 1 I Search Key Equal I
I write by Key I 2 I Transfer in Channel I
I I 3 I Write Data I
~----------------.----------i-----i------------------- __________________ ~
I 1For verifying operations, the third CCW is flagged to suppress the I
IL ______________________________________________________________________
transfer of information to main storage. JI

Figure 13. The XDAP Channel Programs

XDAP OPTIONS
CONVERSION OF RELATIVE TRACK ADDRESS TO ACTUAL ADDRESS
To issue XD1~P, you must provide the actual device address of the
track containing the block to be processed. If you know only the
relative track address, you can convert it to the actual address by
using a resident system routine. The entry point to this conversion
routine is labeled IECPCNVT. The address of the entry point is in the
communication veGtor table (CVT). The address of the CVT is in location
16. (The CVT maGro-instruction defines the symtolic names of all fields
in the CVT. The macro-definition and how to add it to the macro-library
are in the Appendix of this chapter.)

Execute Direct Access Program (XDAP) Macro-Instruction 103


The conversion routine does all its work in general registers. You
must load registers 0, 1, 2, 14, and 15 with input to the routine.
Register usage is as follows:

Register Use
o Must be loaded with a 4-byte value of the form
TTRN, where TT is the number of the track
relative to the ceginning of the data set, R is
the identification of the block on that track,
and N is the concatenation number of the data
set. (0 indicates the first or only data set
in the concatenation, 1 indicates the second,
etc. )
1 Must ce loaded with the address of the data
extent block (DEB) of the data set.

2 Must be loaded with the address of an 8-byte


area that is to receive the actual address of
the clock to De processed. The converted
address is of the form MBBCCHHR, where M
indicates which extent entry in the data extent
block is associated with the direct-access
program (0 indicates the first extent, 1 inal-
cates the second, etc.); BB indicates the bin
nunber of the direct-access vol un,e; CC indi-
cates the cylinder address; hE indicates the
actual track address; and R indicates the block
identification.
3-8 Are not used by the conversion routine.
9-13 Are used by the conversion routine and are not
restored.
14 Must be loaded with the address to which
contrel is to te returned after execution of
the conversion routine.
15 Is used by the conversion routine as a base
register and IToust te loaded with the address at
which the conversion routine is to receive
control.

APPENDAGES

For additional control over I/O oferations, you may write appendages,
which must be entered into the SVC library. Descriptions of these
routines and their coding specifications are contained in the "EXCP
Macro-Instruction" section of this publication.

L- AND E- FORMS OF XDAP MACRO-INSTRUCTION

You may use the L- form of the XDAP macro-instruction for a


macro-expansion consisting of only a parameter list, or the E- form for
a macro-expansion consisting of only executable instructions. The L-
and E- forms are described in Appendix B of the IBM Systero/360 Operating
System: Control Program Services, Form C28-6S41.

Note: The BLKREF parameter is ignored ty the "L" form of the XDAP
macro-instruction. The field may be supplied in the E-form of the
macro-instruction or moved into the lOB by you.

104
APPENDIX: CVT MACRO-INSTRUCTION
If you want to use the CVT macro-instruction, you must add the
macro-definition to the macro-library (SYS1.MACLIB). This secticn
contains the following:
• The format of the CVT macro-instruction.
• The Job Control and Utility statements needed to add the rnacro-
definition to the library.
• The macro-definition to be added to the library.
Format of the CVT Macro-Instruction
This macro-instruction defines the symbolic names of all fields in
the communication vector table (CVT). When coding this macro-
instruction, you must precede it with a DSECT statement. The format of
the macro-instruction is as follows:

r------T--------'---T---------------------------------------------------,
I Name I Operation I Operand I
~------+--------,---+---------------------------------------------------~
I I I VMS I
I I CVT SYS= INT
I I
L MIN
I ______ LI ___________ LI ___________________________________________________ JI

You specify, in the operand field, the control program that you are
using.
VMS
designates mUltiprogramming with a variable number of tasks.
INT
designates multiprogramming with a fixed number of tasks.
MIN
designates the primary control program.
If the operand field is blank, it is assumed that you are using
multiprogramming with a variable number of tasks.
Control Statements Reguired

r----------------------------------------------------------------------,
//jobname JOB {parameters}
//stepname EXEC PGM=IEBUPDAT,PARM=NEW
//SYSPRINT DD SYSOUT=A
//SYSUT2 DD DSNAME=SYS1.MACLIB,DISP=OLD
//SYSIN DD DATA
./ ADD CVT,OO,O,l

CVT Macro-Definiticn

./ ENDUP
/*
L _______________________________________________________________________ J

CVT Macro-Definition
MACRO
&NAME CVT t~SYS=VMS, &FETCH=, &SCHED=PSS, &OPTIONS= (QTAM, INTERVAL)

Execute Direct Access Program (XDAP) Macro-Instruction 105


* THIS IS A KEY WORD MACRO GENERATED SET OF
* CODE. THE STANDARD FORMAT IS DEFINED AS-
SPACE
* CVT SYS=VMS
SPACE
* THE THREE POSSIBLE VALUES OF THE KEYWORD
* SYS ARE-
* VMS OPTION 4.MULTIPROGRAMMING
* WITH VARIABLE NO.
* OF TASKS
* INT OPTION 2.MULTIPROGRAMMING
* WITH FIXED NO. OF
* TASKS
* MIN PCP PRIMARY CONTROL
PROGRAM
* SPACE
CVTPTR EQU 16 LOCATION OF THE CVT POINTER
SPACE
&NAME DS OF
CVTTCBP DC V (IEATCBP) ADDRESS OF A DOUBLE WORD, THE FIRST CON-
* TAINING THE NEXT-TO-BE DISPATCHED TCB
* ADDRESS, THE SECOND CONTAINING THE LAST
(CURRENT) TCB ADDRESS.
*CVTOEFOO DC V(IEAOEFOO) ADDRESS OF ROUTINE TO SCHEDULE ASYNC.
EXITS.
*
CVTLINK DC V(IEFLINK) ADDRESS OF THE LINK LIBRARY DCB.
CVTJOE DC V (IEFJOB) JOB SCHEDULER OPEN'ED DCB ADDRESS.
CVTBUF DC A(O)
CVTXAPG DC V (IECXAPG) lOS APPENDAGE TABLE ADDRESS.
CVTOVLOO DC V(IEAOVLOO) ENTRY POINT ADDRESS OF THE SUPERVISOR'S
* ADDRESS VALIDITY CHECKING ROUTINE.
CVTPCNVT DC V (IECPCNVT) ENTRY POINT ADDRESS OF THE ROUTINE WHICH
CONVERTS RELA'l'IVE TRACK ADDR. TO ABSOLUTE
*
CVTPRLTV DC V (IECPRLTV) ENTRY POINT ADDRESS OF THE ROUTINE WHICH
* CONVERTS ABSOLUTE TRACK ADDR. TO RELATIVE
CVTILK1 DC V(IECILK1) ADDRESS OF THE CHANNEL AND CONTROL UNIT
* PORTIONS OF THE TABLE LOOKUP.
CVTILK2 DC V(IECILK2) ADDRESS OF TWO BYTE UCB POINTERS
CVTXTLER DC V (IECXTLER) ENTRY POINT OF THE XCTL ROUTINE FOR THE
* ERROR TRANSIENT AREA.
CVTSYSAD DC A(O) SYSTEM RESIDENCE VOLUME ENTRY IN THE UCB
* TABLE.
CVTBTERM DC V(IEAOABOO) ENTRY POINT ADDRESS OF THE ABTERM ROUTINE
CVTDATE DC F'O' CURRENT DATE IN PACKED DECIMAL.
CVTMSLT DC V (IEEMSLT) ADDRESS OF MASTER SCHEDULER LINKAGE TABLE
CVTZDTAB DC V(IECZDTAB) AODR. OF I/O DEVICE CHARACTERISTIC TABLE.
CVTXITP DC V(IECXITP) ADDR. OF ERROR INTERPRETER ROUTINE.
CVTXWTO DC V(IECIWTST) AD DR OF CONSOLE OUTPUT ROUTINE
CVTOFNOO DC V(IEAOFNOO) ENTRY POINT ADDRESS OF THE FINCH ROUTINE.
CVTEXIT SVC 3 AN SVC EXIT INSTRUCTION.
CVTBRET BCR 15,14 A BCR 15,14 INSTRUCTION FOR DATA MGMNT.
CVTSVDCB DC V (IEASVOCB) ADDRESS OF THE SVC LIBRARY DCB.
AIF ('&OPTIONS(2), EQ 'INTERVAl').NEXT1
CVTTPC DC A(O)
AGO .NEXT2
.NEXT1 ANOP
CVTTPC DC V(IEATPC) ADDR OF TIMER PSEUDO CLOCKS (SHPC FIRST)
.NEXT2 ANOP
CVTPBLDL DC V (IECPBLDL BRANCH AND LINK ENTRY TO THE BLOL ROUTINE
CVTSJQ DC V (IEESJQ) POINTER TO SELECTED JOB QUEUE.
CVTCUCB DC V (IEECUCB) POINTER TO UCB FOR CURRENT CONSOLE.
AIF ('&OPTIONS(2), EQ 'INTERVAl').NEXT3
CVTQTEOO DC A(O)
CVTQTDOO DC A(O)
AGO .NEXT4

106
.NEXT3 ANOP
CVTQTEOO DC V(IEAQTEOO) ADDR OF TIMER ENQUEUE ROUTINE
CVTQTDOO DC V (IEAQTDOO) ADDR OF TIMER DEQUEUE ROUTINE
.NEXT4 ANOP
CVTSTB DC V(IECSTB) ADDRESS OF I/O DEVICE STATISTICS TABLE.
CVTDCB DC V (IFBDCB) DCB ADDR.FOR LOGR~C DATA SET USED BY SER.
CVTIOQET DC V(IECIOQET) ADDRESS OF I/O QUEUE ELEMEN~ TABLE.
CVTIXAVL DC V (IECIXAVL) POINTER TO NEXT AVAILABLE I/O QUEUE ELMNT
CVTNUCB DC A (0) LOWES~ ADDRESS NOT IN THE NUCLEUS--- AT
A 2K BOUNDARY IF PROTECTION---AT A DOUBLE
* WORD BOUNDARY IF NO PROTECTION.
*
CVTFBOSV DC V (IEWFBOSV) ADDRESS OF PROGRAM FETCH ROUTINE.
CVTODS DC V(IEAODS) ENTRY POINT ADDRESS OF THE DISPATCHER.
CVTILCH DC V(IECILCH) ADDRESS OF THE LOGICAL CHANNEL TABLE.
CVTIERLC DC v (IECIERLC) ADDRESS OF THE ERROR LOGICAL CHAN. QUEUE.
AIF ('&SCHED' EQ 'PPS' OR '&SCHED' EQ 'PSS').NEXTS
CVTl\ljSER DC A(O)
AGO .. NEX'I'6
.NEXTS ANOP
CVTMSER DC V(IEEMSER)
.NEXT6 ANOP
CVTOPT01 DC V(IEAOPT01) BRANCH ENTRY POINT TO POST ROUTINE.
AIF ('&OPTIONS(l)' EQ 'QTAM').NEXT7
CVTTRMTB DC A(O)
AGO .. NEXTB
.NEXT7 ANOP
CVTTRMTB DC v ( IECTRl.VJTB ) ADDR OF TERMINAL TABLE PRESENT IN SYSTEMS
WITH QTAM
*.NEXTB ANOP
CVTHEAD DC V (IEAHEAD)ADDRESS OF THE FIRST (HIGHEST PRIORITY)
* TCB IN THE READY QUEUE.
CVTMZOO DC F'O' MACHINE SIZE (HIGHEST STORAGE ADDRESS FOR
* THIS MACHINE).
AIF ('&SYS' EQ 'MIN').SKPEND
*** THE FOLLOWING ENTRIES ARE FOR INTERMEDIATE SYSTEMS ***
DC A(O) UNUSED, FORMERLY CIRBLINKAGE
CVTQOCR DC V (IEAQOCR) ENTRY POINT TO OPERATOR COMMUNICATIONS
* QUEUE PURGING ROUTINE.
CVTQMWR DC V (IEFQMWR) SYSOUT-CDA AREA ADDR USED BY THE NON-
* RESIDENT QUEUE MGR
AIF ('&SYS' EQ 'INT').SKPEND
*** THE FOLLOWING ENTRIES ARE FOR VMS SYSTEMS ***
CVTPKTBL DC V(IEAPKTBL) PROTECT KEY TABLE ADDk
CVTQCDSR DC V (IEAQCDSR) ADDR OF CONTENTS DIRECTORY SEARCH ROUTINE
CVTQLPAQ DC V (IEAQLPAQ) ADDR. OF THE TOP C.D. ENTRY IN LPA QUEUE.
CVTQERA DC V (IEAQERA) ENTRY POINT TO EaT ERASE PHASE.
CVTQPGTM DC V (IEAQPGTM) ENTRY POINT ~O EOT PURGE TIlYjER ELMNTS. R'rN
CVTQPIE DC V(IEAQPIE) ENTRY PT TO EOT PIERMVE RT.
CVTQABL DC V(IEAQABL) ENTRY PT TO rOT CDABDEL RT.
CVTQSPET DC V (IEAQSPET) ENTRY PT TO EOT SPEOT RT.
CVTQABST SVC 13 SVC TO ABEND
DC H'O' FIll CUT TO FULL WORD
.SKPEND ANOP
MEND

Execute Direct Access Program (XDAP) Macro-Instruction 107


HOW TO USE THE TRACING ROUTINE

This chapter describes the function of


the tracing routine, and provides a
detailed description of the inforwation
made availatle ty the tracing routine.

Before reading this chapter, you should


be familiar with the information contained
in the prerequisite putlication.

PREREQUISITE PUBLICATION
The IBM System/360: Principles of Opera-
tion publication (Form A22-6821) ccntains
inforrration about the SIO instruction and
the I/O and SVC interruptions.

108
HOW TO USE THE TRACING ROUTINE

The tracing routine is an Operating System/360 optional feature which


you can use as a debugging and maintenance aid. The tracing routine
stores, in a table, information pertaining to the following conditions:
• SIO instruction execution.
• SVC interruption.
• I/O interruption.
You can include the tracing routine and its table in the control
program during the system generation process. This is done using the
TRACE option in the SUPRVSOR macro-instruction. The format of this
option requires you to supply the number of entries in the table. Each
table entry can contain information relating to one of the traced
conditions. When the last entry in the table is filled, the next entry
will overlay the first.

Table Entry Forrrats


Table entry formats are as follows:

SIO Instruction

o 23 13 21 31 0 31 0 3110 31
J
Device Channel Channel Status Word
0
Address Address Word (Meanin9ful onlylwhen bits 2-3 = 01)
"-. S
10 Condition Code

I/O Interruption

0 13- 1619 310 310 3110 31

1 0000 Channel
.I
Status Word
I
~--------------v---------------~

I/O Old PSW

SVC Interruption

0 13 16 19 310 310 310 31

Contents of Contents of
1 0001
Register 0 Register 1

\~--------------~y---------------~
SVC Old PSW
Location of the Table
The addresses of the last entry made in the table, the beginning of
the table, and the end of the table are contained in a 12-byte field.
The address of this field is contained in the full word starting at
location 20. The format of the field is as follows:

How to Use the Tracing Routine 109


10 3110 3110 311
~-----------------------+-----------------------+----------------------~
I Address of the I Address of the I Address of the I
IL_______________________
Last Entry I _______________________
~ Table Beginning I ______________________
~ Table End JI

The tracing routine is bypassed during acnormal termination proce-


dures, except when incorporated in MFT or MVT configurations of the
operating system.

110
IMPLEMENTING DATA SET PROTECTION

To use the data set protection feature


of the operating system, you must create
and maintain a data set, named PASSWORD,
consisting of records that associate the
names of protected data sets with the
password designated for each data set.
This chapter provides the informaticn you
need to create the PASSWORD data set, and
describes operating characteristics of the
data set protection feature.

Recommended Publications
The IBM System/360 Operating System:
Data Management publication (Form C28-6537)
contains a general description of the data
set protection feature.
The IBM System/360 Operating System:
Operator's Guide publication (Form
C28-6540) contains a description of the
operator messages and replies associated
with the data set protection feature.
The IBM System/360 Operating System: Job
Control Language publication (Form
C28-6539) contains a description of the
data definition (DD) statement parameter
used to indicate that a data set is to be
placed under protection.
Documentation of the operating systerr
routines supporting data set protection can
be obtained through your IBM Branch Office.

Irr.plementing Data Set Protection 111


IMPLEMENTING DATA SET PROTECTION

To prepare for use of the data set protection feature of the


operating system, you place a sequential data set, named PASSWORD, on
the system residence volume. This data set must contain one record for
each data set placed under protection. In turn, each record contains a
data set name, the password for that data set, a counter field, a
protection wode indicator, and a field for recording any information you
desire to log. On the system residence volumei these records are
formatted as a "key area" (data set name and password) and a "data area"
(counter field, protection mode indicator, and logging field). The data
set is searched on the "key area."

You must write routines to create and maintain the PASSWORD data set.
These routines may be placed in your own litrary or the system's linkage
editor library (SYS1.LINKLIB). You may use a data management access
method or EXCP programming to handle the PASSWORD data set.

If a data set is to be placed under protection, it must have a


protection indicator set in its lacel (DSCB or header 1 tape label).
This is done by the operating system when the data set is created. The
protection indicator is set in response to an entry in the LABEL=
Darameter of the DD statement associated with the data set being placed
under protection. The Job Control Lan~ publication describes the
entry Note: Data sets on magnetic tape are protected only when standard
labels are used.

The balance of this chapter discusses the PASSWORD data set charac-
-teristics and record format, the creation of protected data sets, and
operating characteristics of the data set protection feature.

PASSWORD DATA SET CHARACTERISTICS AND RECORD FORMAT

The PASSWORD data set ITust reside en the same voluwe as your
operating system. The space you allocate to the PASSWORD data set must
be contiguous, i.e., its DSCB must indicate only one extent. The amount
of space you allocate is dependent on the number of data sets your
installation desires to place under protection. The organization of the
PASSWORD data set is physical sequential, and the content is unblocked
format-F records, 132 bytes in length (key area plus data area). The
following illustration shows the password records as you would build
them in a 132 byte work area. Explanation of the fields follows the
illustration.

. 80 byte 'data area "


~52 byte "key"

~
/3 bytes
44 bytes .. ~
-
.... 8 .- 77 bytes
bytes
fully qualified pass- logging field
data set name word (optional informa-
tion)

j~ ~ protect10n

mode indi-
cator - ] byte
'----- b1nary counter -2 b yte s

The name of the protected data set being opened and the password
entered by the operator are watched against the 52-byte "key area." The

112
data set name and the password must be left-justified in their areas and
any unused bytes filled with blanks (X'40'). The password assigned may
be from one to eight alphameric characters.
The operating system increments the binary counter by one each time
the data set is successfully opened (except for performance of SCRATCH
or RENAME functions on the data set). When you originate the password
record, the value in the counter may be set at zero (X'OOOO') or any
starting value your installation desires.
The protection mode indicator is set to indicate that the data set is
to be read-only, or that it may be read or written. You set the
indicator as follows:
• To zero (X'OO') if the data set is to be read-only •
• To one (X'Ol') if the data set may be read or written.
You may use the 77-byte logging field to record any information about
the data set under protection that your installation may desire, e.g.,
date of counter reset, previous password used with this data set, etc.

PROTECTING THE PASSWORD DATA SET


You protect the PASSWORD data set itself by creating a password
record for it when your program initially builds the data set.
Thereafter, the PASSWORD data set cannot be opened (except by the
operating system routines that scan the data set) unless the operator
enters the password.

CREATING PROTECTED DATA SETS


A data definit:ion (DD) statement parameter (LABEL=) is used to
indicate that a data set is to be placed under protection. You may
create a data set:, and set the protection indicator in its label,
without entering a password record for it in the PASSWORD data set.
However, once the data set is closed, any subsequent opening results in
termination of the program attempting to open the data set, unless the
password record is available and the operator can honor the request for
the password. Operating procedures at your installation must ensure
that password records for all data sets currently under protection are
entered in the PASSWORD data set.

PROTECTION FEATURE OPERATING CHARACTERISTICS


This section provides informaticn concerning actions of the protec-
tion feature in relation to termination of processing, volume switching,
data set concatE~nation, SCRATCH and RENAME functions, and counter
maintenance.
Termination of Processing
Processing is terminated when:
1. The operator cannot supply the correct password for the protected
data set being opened.
2. A password l:ecord does not exist in the PASSWORD data set for the
protected data set being opened.
3. The protection mode indicator setting in the password record, and
the method of I/O processing specified in the open routine do not

Implementing Data Set Protection 113


agree, e.g., OUTPUT specified against a read-only protection mode
indicator setting.

4. There is a mismatch in riata set names for a data set involved in a


volume switching operation. This is discussed in the next section.
Volume switching

The operating system end-of-volume routine does not request a


password for a data set involved in a volume switch. Continuity of
protection is handled in the following ways:

Input Data sets - Tape and Direct-Access Devices


Processing continues if there is an equal cOffiparison between the
data set name in the tape label or DSCB on the volume switched to,
and the name of the data set opened with the password. An unequal
comparison terminates processing.

output Data Sets - Tape Levices

The protection indicator in the tape label on the volume switched


to is tested.:

1. If the protection indicator is set ON, an equal comparison


between the data set name in the label and the name of the data
set opened with the password allows processing to continue. An
unequal comparison results in a call for another volume.

2. If the protection indicator is OFF, processing continues, and a


new label is written with the protection indicator set ON.
3. If only a volume label exists on the volun,e switched to,
processing continues, and a new label is written with the
protection indicator set cn.
output Data Sets - Direct-Access Devices

For existing data sets, an equal comparison between the data set
name in a DSCB on the volume switched to, and the name of the data
set opened with the password allows processing to continue. For new
output data sets, the mechanism used to effect volume switching
ensures continuity of protection and the DSCB created on the new
volume will indicate protection.
Data Set Concatention

A password is requested for every protected data set that is involved


in a concatentation of data sets, regardless of whether the other data
sets involved are protected or not.
SCRATCH and RENAME Functions

An attempt to perform the SCRATCH or RENAME functions on a protected


data set results in a request for the password. The protection feature
issues an operator's message when a protected data set is the object of
these functions. The Operator's Guide publication discusses the mes-
sage.
counter Maintenance
The operating system does not maintain the counter in the password
record and no overflow indication will be given (overflow after 67,535
openings). You must provide a counter maintenance routine to check and,
if necessary, reset this counter.

114
THE RESIDENT BLDL TABLE AND RESIDENT ACCESS METHOD OPTIONS

This chapter discusses the resident BLDI


table and resident access method options
and provides guidelines for their use.

Prerequisite Publications
The IBM System/360 Operating Systero:
Data Management publication (Form C28-6537)
contains a general discussion of the BLDL
routine.
The IBM Svstem/360 Operating System:
System Generation publication (Forn
C28-6554) describes how you specify the
resident BLDL table and resident access
method option in the SUPRVSOR macro-
instruction at system generation time.
The IBM Systern/360: Operating System:
utilities publication (Form C28-6586)
contains a description of the IEBUPDAT
utility which you use to construct lists of
load module names in the procedure liqrary
(SYS1.PROCLIB).
The IBM System/360 Operating System:
storage Estimates publication (Forro
C28-6551) provides storage requirement
information for the resident access method
option and resident BLDL table option.

The Resident BLDL Table and Resident Access Method Options 115
THE RESIDENT BLDL TABLE AND RESIDENT ACCESS METHOD OPTIONS

These options, when included in an Operating System/360 configu-


ration, provide you with the capabilities of placing in the system
nucleus:

1. All, or any selection of linkage library directory entries (40


bytes per entry).

2. A selected group of access method routines.

Placement occurs during the initial program load (IPL) process. You
include either or both of these options when the system is generated.
Parameters for specification of these options are provided in the system
generation SUPRVSOR macro-instruction. Operator communication with
these options may also be specified.

System issued ATTACH, LINK, LOAD, or XCTL macro-instructions request-


ing load modules in partitioned data sets require direct-access storage
device accesses to search the data set directory for the location of the
requested module (the BLDL table operation) and to fetch the module.
The resident BLDL table option reduces the number of accesses required
during execution of these macro-instructions when a load module (whose
directory entry is resident) is requested from the linkage library. The
resident access method option eliminates such accesses during execution
of a system issued LOAD macro-instruction that requests any of the group
of resident access method routines.

You specify the linkage library directory entries and the access
method routines to be made resident through lists of linkage library or
access method load module names placed in the procedure library
(SYS1.PROCLIB). A standard list and alternative lists may exist for
each option. IBM provides a standard list for the resident access
method option. The stanaard lists are processed without operator
intervention when the operator communication facility is not included
with the options. When the operator communication facility is included,
the operator must indicate the action to be taken. Selection of
alternative lists may not be made unless the operator corrmunication
facility is included. The Operator's Guide publication describes the
messages and replies associated with the two options.

The balance of this chapter discusses the function of each option,


the creaticn of the procedure library lists, the use of the operator
communication facility, and, in Appendix A, lists the content of the
resident access method standard list.

~rHE RESIDENT BLDL TABLE OprION

This option builds, in the system nucleus, a list of linkage library


directory entries for use by ATTACH, LINK, LOAD, or XCTL macro-
instructions requesting linkage library load modules. During execution
of the BLDL operation in the ~acro-instruction routines, the linkage
library directory is searched only when the directory entry for the
~equested load module is not present in the resident BLDL table.

You list, in a member of SYS1.PROCLIB, the load module name of


linkage library load modules whose directory entries are to be made
resident. The member name for the standard list is IEABLDOO. Creation
of procedure library lists is discussed later in this chapter. The next
section provides gUidelines for choosing the content of the list.

~ote: Directory entries in the resident table are not updated as a


result of updating the load wodule in the linkage library. The old

116
version of the load module is used until an IPL operation takes place
and the new directory entry for the module is made resident.

SELECTING ENTRIES FOR THE RESIDENT BLDL TABLE

Any load module in the linkage library may have its directory entry
placed in the resident BLDL table. Other items you should consider are:

1. Table size (each entry requires 40 bytes of storage).

2. Frequency of use of the load module.

Table Size
The resident BLDL table is incorporated in the system nucleus. The
additional storage required is governed by the number of table entries
and is acquired by reducing the amount of dynamic storage area
available, i.e., the system nucleus expands. Each installation using
the resident BLDL table option must determine the amount of storage it
can afford for the resident BLDL table.

Frequency of Use
Short of placing the entire linkage library directory in the resident
BLDL table, you make the option effective by selecting directory entries
representing the load modules which are called most frequently. Your
choice will depend on th~ system configuration and the operating
practices of your installation. You should give loaa modules of the
scheduling components of the system, linkage editor, and language
processor(s) thorough consiueration.

THE RESIDENT ACCESS METHOD OITION

This option places access rrethod load modules in the system nucleus
and creates a resident list cf the loaded modules. A LOAD macro-
instruction requesting any access method mCQule first scans the resident
list. If the module is listed, no fetch operation is required.
You list, in a member of SYS1.PROCLIB, the load module names of
access method load modules to be made resident. ThE:; member name for tne
standard list is IEAIGGOO. A standard list of rrost frequently used
access method roodules is supplied by IBM, and is in SYS1.PROCLIB of the
~tarter system under the standard member name.

The creation of procedure library lists and the content of the IBM
supplied standard list is discussed later in this chapter. The next
section discusses some considerations pertaining to the use of the
aCCESS method option.

CONSIDERATIONS FOR USE


The storage space requirea fOT each access method module consists of
the byte requirements of the module and its associated load request
block (LRB). The storage Estimates publication provides storage
requirements for'the resident access method option when used with the
standard procedure library list provided by IBM.

All access method modules placed in the system nucleus are "only
loadable". ATTACH, LINK, and XCTL macro-instructions cannot refer to
the resident modules.

The Resident BLDL Table and Resident Access Method Options 117
You may alter the standard access reethod list (or create alternative
lists) to include access method modules supporting program controlled
interrupt scheduling (PCI), exchange buffering, track overflow, and the
UPDAT function of the OPEN macro-instruction.
To te· el igible for use with the resident access method option, access
method load modules must be reenteratle. The IToodule name must be of the
form IGG019xx, where xx can be any two alphanurreric characters.

CREATING PROCEDURE LIBRARY LISTS


You use the IEBUPDAT utility program to construct the required lists
of load module names in the procedure library. Standard rrember names
for these lists are:

IEABLDOO for the BLDL tatle option


IEAIGGOO for the access method option

These are the member names that the nucleus initialization program
will recognize at IPL time in the atsence of any other specification,
i.e., the operator communication facility was not incorporated.

Your input format (to IEBUPDAT) for the lists is the same for either
option, consisting of library identification followed by the load module
names. You use eighty character records with the initial or only record
containing the library identification.. Continuation is indicated ty
placing a comma after the last name in a recora and a non-blank
character in column 72. Subsequent records must start in column 16.
The initial record forrrat (with continuation) is:

1 72
SYS1.LINKLIB
[b ••• ] SYS1.SVCLIB b ... namel,name2,name3, .•. X

Subsequent records do not contain the library name.


SYS1.lINKLIB indicates that linkage library load module names follow.
SYS1.SVCLIB indicates that SVC library module names follow. You list
linkage-library load rrodule names in the same order that they appear in
the linkage library directory.

You may construct alternative lists for either option and place them
in the procedure library. Member names for these alternate lists are of
the form:

IEABLDxx for the BLDL option


IEAIGGxx for the resident access method option
where xx can be any twc alphanumeric characters.
Use of the alternative lists is indicated by the operator at IPL time
and requires that the corrmunication facility be present. When the
operator communication facility is present, the operator must indicate
for either or both options that the standard list is to be used; that
alternative lists are to be used; or that, for this IPL, the option(s)
will not b~used. In the latter case, no resident BLDL table or access
method routines will be placed in the nucleus.

EXAMPLE
The following coding illustrates the format and content of a BLDL
option list that might be used to support the resident BLDL table
option. The operator, at IPL time, would have to indicate the member

118
name, IEABLDAE, to the system. The load module names listed are from
the Assembler (E), Linkage Editor, and scheduler components of the
operating system.

//BLDLIST EXEC PGM=IEBUPDAT,P~RM=NEW


//SYSPRINT DD SYSOUT=A
//SYSUT2 DD DSNAME=SYS1.PROCLIB,DISP=OLD
//SYSIN DD *
./ ADD IEABLDAE,OO,O,l
./ NUMBR 00000000,00000000,00000000,00000010
SYS1.LINKLIB GO,IEEGESTO,IEEGK1GM,IEEICIPE,IEEIC2NQ,IEEIC3JF, X
IEEQOTOO,IEFINrQS,IEFK1,IEFSD008,IEFW21SD,IEFXA, X
IETASM,IETDI,I~TE1,IETE2,IETE2A,lETE3,IETE3A,IETE4M, X
IETE4P,IETE4S,IETE5,IETE5A,IETE5E,IETE5P,IETINP,IETMAC, X
IETPP,IETRTA,IETRTB,IET07,IET071,IET08,IET09,IET09I, X
IET10,IET10B,IET21A,IET21B,IET21C,IET21D,IEWL,IEWSZOVR
./ ENDUP
/*

Note: The operator reply "L" may be used in conjunction with a list
specification and causes the content of the list to be printed. You
should use this feature initially (especially with extensive lists> so
that format errors, e.g., a 9 character name, and incorrect name
specifications way be easily identified.

The Resident BLDL Table and Resident Access Method Options 119
APPENDIX' A: RESIDENT ACCESS METHOD OPTION - STANDARD LIST IEAIGGOO

The content of the IBM supplied standard list for the resident access
method option is shown below. The modules are listed in an ascending
sequence by frequency of use, i.e., the least frequently used module is
first in the list. This arrangement ensures efficient scanning of the
resident list developed in storage.

J:.Jodule Name Access Method Functicn

IGG019AV QSAM (SB) PUT Locate for DUffITY Data Set


IGG019AN QSAM <SB) Backward Move - Format F, FB, U Records
IGG019Ar-J QSAM (SB) Backward Locate - Format F, FB, U Records
IGG019AH QSAM (SB) GET Move with CNTL - Format V Records (Card
Reader)
1GG019BE BSAM Magnetic Tape Forward Space or Backspace
IGG019AG QSAM (SB) GET Move with CNTL - Format V Recoras (Card
Reader)
IGG019CB SAM Space or Skip Printer
1GG019CA SAM Stacker Select (Card Reader)
IGG019AK QSAM (SB) PUT Move, Format F, FB, U Records
IGG019AJ QSAM (SB) PUT Locate, Format V, VB Records
1GG019AI QSAM (SB) PUT Locate, Format F, FB, U Records
IGG019AC QSAM (SB) GET MOVE, Format F, FB, U Records
IGG019AB QSAM (SB) GET Locate, Format V, VB Records
J.GG019AA QSAM (SB) GET Locate, Format F, FB, U Records
IGG019AR QSAM (SB) PUT Synchronization Routine
IGG019AQ QSAM (SB) GET Synchronization Routine
IGG019AL QSAM (SB) PUT Move, Format V, VB Records
IGG019AD QSAM (SB) GET Move, Forrrat V, VB Records
IGG019BD BSAM NOTE/POINT Tape
IGG019BC BSAM NOTE/POINT Disk
1GG0198B BSAM CHECK (all devices)
IGG019BA BSAM READ/WRITE (all devices)
IGG019CK SAr-l SYSIN Delimiter Check (Appendage)
IGG019CJ SAM Read length Check, Forrr.at V Records
(Appendage)
IGG019CI SAM Length Check, Format FB Records (Appendage)
IGG019CH SAM End-of-Extent Check (Data Extent Block)
(Appendage)
IGG019CL SAM Printer Test Channels 9,12 (Appendage)
IGG019CF SAM ASA Character to Corrmand Code
(Printer-Punch)
IGG019CE SAL>:] End-of-Block (Printer-Punch)
IGG019CD SAM Schedules I/O for Direct-Access output
IGG019CC SAM Schedules I/O for Tape, Direct-Access
Input, Card Reader, Paper Tape Reader

SB=simple buffering
SAM=common sequential aCCESS method routines

120
CONSTRUCTING A DUMMY WAITR ROUTINE

This chapter discusses the preparation


of a dummy WAITR routine for use with
Option 2 (multiprogramming with a fixEd
number of tasks) of Operating System/360.

Recommended Publications
The IBM System/360 Oper~ting System:
Control Program Services publication (Form
C28-6541) describes the. WAITR rracro-
instruction.
The IBM System/360 Operating System:
Assembler Lanquage publication (Form
C28-6514) describes the assembler language
used to code the duwmy WAITR routine.

Constructing a Durorry ~AITR Routine 121


CONSTRUCTING A DUMMY WAITR ROUTINE

The multiprogramming with a fixed number of tasks option (MFT) of


operating System/360 requires programs scheduled into any higher
partitions to release the scheduler as soon after initiation as
possible. The mechanism for release is the WAITR macro-instruction
which causes the required scheduler shift to the next lower paitition.
You may desire to run programs not originally designed for the MFT
environment, i.e., not containing the WAITR macro-instruction, in one of
the higher partitions. In this circumstance you must provide a routine
that will cause the required scheduler shift; invoke the program you
desire to execute; and pass parameters to the invoked program. Your
routine is executed as the first portion of any job with which it is
associated.
The balance of this chapter discusses the functions of a dummy WAITR
routine, provides a coding example, and discusses the job control
language statements and programming considerations pertinent to use of a
dummy WAITR routine.

FUNCTIONS OF THE DUMMY WAITR ROUTINE


When coding a dummy WAITR routine, your code must:
1. Issue a WAITR macro-instruction.
2. Dynamically invoke a specified program.
3. Restore the PARM= field of the EXEC statement that initiated
execution of the WAITR routine, deleting only the name of the
program to be invoked.
You use the WAITR instruction to initiate the desired scheduler
shift. You dynamically invoke the program to be executed, i.e.,
transfer control via the XCTL macro-instruction, since once the WAITR
macro-instruction is issued, the scheduler is released. Your WAITR
routine identifies the program to be invoked by picking up its system
name from the PARM= field of the EXEC statement that initiated execution
of your WAITR routine.
Your WAITR routine must restore the PARM= field so that any
parameter(s) present (other than the invoked program's name) may be
picked up by the invoked program.
The next section, "A Coding Example" illustrates basic implementation
of these functions.

A CODING EXAMPLE
The following source statement sequence illustrates the implementa-
tion of the dummy WAITR routine functions described in the preceding
section. The statements are keyed to explanatory text by the circled
numbers.
DUMWAIT CSECT
SAVE (14,12)
BALR 2,0
USING *,2
ST 13,MYSAVE+4
LA 13, MYSAVE
L 3,0(1) ADDRESS OF PARM AREA TO GR3
LH 5,0(3) PARM AREA COUNT FIELD TO GR5

122
WAI'l'R 1,ECB=XECB RELEASE SCHEDULER
LA 3,0(3)
LR 6,3
SCAN CLI 2(6),C',' SCAN FOR COMMA IN PARM FIELD
BE HIT BRANCH IF FOUND
LA 6,1(6) POIN'! TO NEXT CHARACTER
BCT 5,SCAN
LA 5,1(5)
HIT SR 6,3 GR6 NOW CONTAINS NO. OF BYTES SCANNED
BCTH 5,0 SUBTRACT 1 FROM COUNT FOR COMMA
LA 7,3(3,6) GR7 NOW POINTS AT REMAINING PARAMETERS
BCTH 6,0 SETUP GR6 FOR USE IN EX INST.
EX 6, MODIv'JOVE
STH 5,0(3) REMAINING COUNT TO PARM COUNT FIELD
LTR 5,5 CHECK COUNT FOR ZERO
BZ XOUT IF ZERO, SKIP PARMOVE
BCTR 5,0 SETUP GR5 FOR USE IN EX INST.
3 EX 5,PARMOVE
XOUT L 13,MYSAVE+4
L 14,12(13)
L 1,24(13)
XCTI, (2,12),EPLOC=MODNAME
PARMOVE MVC 2(1,3),0(7)
MODMOVE MVC MODNAME(1),2(3)
MYSAVE DS 18F
DS OD
4 MODNAME DC CL8' •
5 XBCB DC X'40000000'
END
1 The dummy WAITR macro-instruction must be coded as shown here. The
event control block must be specified as shown in statement 5, i.e.,
the complete bit is ON.
2 The subject instruction of this EX instruction places the name of the
program to be invoked in the MODNAME field -- statement 4.
3 The subject instruction of this EX instruction effectively deletes
the invoked program name from the PARM= area by moving the remaining
parameters in the area to the high order end of the area.
4 This field must contain blanks.
5 Coding the event control block as shown here sets the "complete bit"
ON. The wait routine will then allow execution of the WAITR routine
and the invoked program.
To the basic implementation shown in this example, you may wish to
add diagnostic code to inforrr the operator that the PARM= field has been
omitted from the EXEC statement. A count value of zero in the PARM=
area count field indicates that no information has been placed in the
PARM= area.

JOB CONTROL LANGUAGE STATEMENTS


You use the EXEC statement to initiate execution of the dummy WAITR
routine; to specify the name of the program to be invoked; and to
specify any parameters to be passed to the invoked program. A JOB
statement and any DD statements defining data sets used by the invoked
program must also be present in the input stream. A sample EXEC
statement follows. The dummy WAlTR routine has been cataloged as
DUMWAlT.

Constructing a Dummy WAITR Routine 123


//MFTJOB JOB (any valid parameters)
// EXEC PGM=DUMWAIT,PARM='PROGX,COMPUTE,BINARY'
(required DD statements for PROGX)

The name of the program to be invoked by DUMWAIT must be the first


entry in the PARM= paraneter list.

PROGRAMMING CONSIDERATIONS
A dummy WAITR routine itself does not require any special considera-
tions for use with MFT. MFT conventions that apply to the invoked
programs must be observed.
Note: Use of the dummy WAITR routine precludes the entering of input
data via the jot stream.

124
SYSTEM MACRO-INSTRUCTIONS

This chapter contains the description


and formats of macro-instructions that
allow you either to modify control tlocks
or to obtain information from control
blocks and system tables. Before reading
this chapter, you should be familiar with
the information contained in the prerequi-
site publications listed below.

Prerequisite Putlications
The IBM Sys1:em/360 Oper~ting System:
Control Program Services publication (Form
C28-6541) contains the notativn conventions
used to describe the macro-instructions in
this chapter.
The IBM Sys1:em/360 Operating System:
Assembler Language publication (Form
C28-6514) contains the information neces-
sary to code programs in the assemtler
language.
The IBM system/360 Operating System:
System Control Block publication (Forro
C28-6628) contains format and field de-
scriptions of the system control tlccks
referred to in this chapter.

System Macro-Instructions 125


LOCATE DEVICE CHARACTERISTICS (DEVTYPE) MACRO-INSTRUCTION

The DEVTYPE macro-instruction is used to request information relating


to the characteristics of an I/O device, and to cause this information
to be placed into a specified area.

r----------T----------T------------------------------------------------,
I Nawe I Operation I Operand I
~----------+----------+------------------------------------------------~
lI __________
[symbol] LI __________
DEVTYPE iI _______________________________
ddloc-addrx,area-addrx[,DEVTAB]_________________ JI

ddloc-addrx
specifies the address of a double word that contains the symbolic
name of the DD statement to which the device is assigned. The name
must be left justified in the double word, and must be followed by
blanks if the name is less than eight characters. The double word
need not be on a double-wcrd boundary.
area-addrx
specifies the address of an area into which the device information
is to be placed. The area can be either two full words or five
full wordS, depending on whether or not the DEVTAB operand is
specified. The area must bt on a full word toundary.
DEVTAB
If DEVTAB is specified, and the device is a direct-access device,
five full words of information are placed into your area. If
DEVTAB is specified, and the device is not a direct-access device,
two full words of information are placed into your area. If DEVTAB
is not specified, two full words of information are placed into
your area.
Note: Any reference to a durrmy DD statement in the DEVTYPE
macro-instruction will cause invalid information to be placed in
the output area.

Device Characteristics Information

The following information is placed into your area:


Word 1 Device Code from the UCB in which:
Byte 1 bit 0 Unassigned
bit 1 Overrunable Device 1 yes
bit 2 Burst/Byte Mode 1 = burst
bit 3 Data Chaining 1 yes
bit 4-7 Model Code
Byte 2 Optional Features
Byte 3 Device Classes
Byte 4 Unit Type

Note: Bit settings for Byte 2 -- Optional Features are noted in the ueB
format and field description in the System Control Blocks publication.
Word 2 Maximum tlock size. For direct-access devices, this
value is the maximum size of an un keyed block; for
magnetic or paper tape, this value is the maximum
block size allowed by the operating system. For all
other devices, this value is the maximum block size
accepted by the device.

126
If DEVTAB is specified, the next three full words contain the
following information:

Word 3 Bytes 1-2 The numcer of physical cylinders on the


device.
Bytes 3-4 The number of tracks per cylinder.
Word 4 Bytes 1-2 Maximurr. track length.
Byte 3 Block Overhead the number of bytes
required for gaps and check bits for each
keyed clock other than the last block on a
track.
Byte 4 Block Overhead the number of bytes
required for gaps and check bits for a
keyed block that is the last block on a
track.
Word 5 Byte 1 Block Overhead - the number of bytes to be
subtracted if a clock is not keyed.
Byte 2 bits 0-6 Reserved
bit 7 If 1, a tolerance factor must be
applied to all blocks except the
last block on the track.
Bytes 3-4 Tolerance Factor - this factor is used to
calculate the effective length of a block.
The calculation shculd be perforwed as
follows:
step 1 - add the block's key length to the
block's data length.
Step 2 - test tit 7 of byte 2 of word 5.
If bit 7 is 0, perform step 3. If bit 7
is 1, multiply the sum computed in step 1
by the tolerance factor. Shift the result
of the multiplication nine bits to the
right.
step 3 add the appropriate block
overhead to the value obtained above.

System Macro-Instructions 127


Output for Each Device Type

Maximum
UCB Type Field Record Size DEVTAB
(Word 1 (Word 2 (Words 3, 4, and 5
In Hexadecimal) In Decin1al} In Hexadecimal}

2540 Reader 10 00 08 01 80 Not Applicable


2540 Reader W/CI 10 01 08 01 80 Not Applicable
2540 Punch 10 00 08 02 80 Not Applicable

2540 Punch W/CI 10 01 08 02 80 Not Applicable

1442 Reader-Punch 50 00 08 03 80 Not Applicable

1442 Reader-Punch W/CI 50 01 08 03 80 Not Applicable

1442 Serial Punch 51 80 08 03 80 Not Applicable

1442 Serial Punch W/CI 51 01 08 03 80 Not Applicable


2501 Reader 50 00 08 04 80 Not Applicable
2501 Reader W/CI 50 01 08 04 80 Not Applicable

2520 Reader Punch 50 00 08 05 80 Not Applicable

2520 Reader Punch W/CI 50 01 08 05 80 Not Applicable

2520 B2-B3 11 00 08 05 80 Not Applicable

2520 B2-B3 W/CI 11 01 08 05 80 Not Applicable

1403 10 00 08 08 120* Not Applicable

1403 W/UCS 10 80 08 08 120* Not Applicable

1404 10 00 08 08 120* Not Applicable

1443 10 00 08 OA 120* Not Applicable

2671 10 00 08 10 32767 Not Applicable

1052 10 00 08 20 130 Not Applicable


2150 10 00 08 21 130 Not Applicable
2400 ( 9-track) 30 00 80 01 32767 Not Applicable
2400 (9-track
phase encoding) 34 00 80 01 32767 Not Applicable
2400 (9-track
dual-density) 34 20 80 01 32767 Not Applicable

2400 (7-track) 30 80 80 01 32767 Not Applicable


2400 (7-track and 30 CO 80 01 32767 Not Applicable
data conver-
sion)

128
2301 30 40 20 02 20483 000100C85003BA3535000200

2302 30 00 20 04 4984 00FAOQ2E1378511414010219

2303 30 00 20 03 4892 0050000A131C922626000200

2311 30 00 20 01 3625 OOCBOOOAOE29511414010219

2314 30 CO 20 08 7294 OOC800141C7E922D2DOI0216

CI=Card Image Feature

UCS=Universal Character Set

*Although certain models can have a larger line size, the minimum line
size is assumed.

Exceptional Returns

The following return codes are placed in register 15:


00 - request completed satisfactorily.

04 - ddname not found.

System Macro-Instructions 129


HOW TO READ A JOB FILE CONTROL BLOCK

To accomplish the functicns that are performed as a result of an OPEN


macro-instruction, the OPEN routine requires access to information that
you have supplied in a data definition (DO) statement. This information
is stored by the system in a job file control block (JFCB).

usually, the programmer is not concerned with the JFCB itself. In


special applications, however, you may find it necessary to modify the
contents of a JFCB before issuing an OPEN nacro-instruction. To assist
you, the system provides the RDJFCB rr.acro-instruction. This macro-
instruction causes a specified JFCB to be read into main storage from
the job queue in which it has been stored. Forroat and field description
of the JFCB is contained in the System Control Block publication.
When subsequently issuing the OPEN rracro-instruction, you must
indicate, by specifying the TYPE=J option, that you have supplied a
modified JFCB to be used during the initialization process.

The JFCB is returned to the job queue by the OPEN routine or the
OPENJ routine, if any of the modifications in the following list occur.
These modifications can occur only if the inforroation is not originally
in the JFCB.
• Expiration date field and creation date field merged into the JFCB
from the DSCB.

• Secondary quantity field merged into the JFCB from the DSCB.

• DCB fields merged into the JFCB from the DSCB.

• DCB fields merged into the JFCB from the DCB.

• Volume serial number fields added to the JFCB.

• Data set sequence number field added to the JFCB.

• Number of volumes field added to the JFCB.


If you make these, or any other rocdifications, and you want the JFCB
returned tc the job queue, you must set the high-order bit of field
JFCBMASK+4 to one. This field is in the JFCB. Setting the high-order
bit of field JFCBMASK+4 to zero does not necessarily suppress the return
of the JFCB to the job queue. If the OPEN or OPENJ routines have made
any of the above modif~cations, the JFCB is returned to the job queue.

OPEN -- Prepare the Data Control Block for Processing (S)

The OPEN macro-instruction initializes one or more data control


blocks so that their associated data sets can be processed.
A full explanation of the operands of the OPEN macro-instruction,
except for the TYPE=J option, is contained in the publication IBM
System/360 Operating System: Control Prograro Services. The TYPE=J
option, because it is used in conjunction with modifying a JFCB, should
be used only by the system programmer or only under his supervision.

r----------T----------T------------------------------------------------,
I Name I Operation I Operand I
~----------+----------+------------------------------------------------~
I [symJ:::ol] I OPEN I ({ dcb-addr, [ (optl. -code [ , opt 2 -code] ) 1 , } ••. ) I
IL __________ LI __________ LI ________________________________________________
[,TYPE=J] JI

130
TYPE=J
specifies that, for each data control block referred to, the
programmer has supplied a job file control block (JFCB) to be used
during initialization. A JFCB is an internal representation of
information in a DD control statement.

During initialization of a data control block, its associated JFCB


may be modified with information from the data control block or an
existing data set label or with system control information.

The system always creates a job file control block for each DD
control statement. The job file control block is placed in a job
queue on direct-access storage. Its position, in relation to other
JFCBs created for the same job step, is noted in a main storage
table. '

When this operand is specified, the user must also supply a DD


control statement. However, the amount of information g~ven in the
DD statement is at the programmer's discretion, because he can
ignore the system-created jot file control block. (See the
examples of the RDJFCB macro-instruction for a technique for
modification of a systen-created JFCB.)

Note: The DD statement must specify at least:

• Device allocation.

• A ddname corresponding to the associated data control block DCBDDNAM


field.

RDJFCB -- Read a Job File Control Block (S)

The RDJFCB macro-instruction causes a job file control block (JFCB)


to be read from the job queue into roain storage for each data control
block specified.

r----------T----------T------------------------------------------------,
I Nawe I Operation I Operand I
~----------+-~--------+------------------------------------------------i
IL__________
[syml:olJ I __________
~ RDJFCB ~I ________________________________________________
({dcb-addr, [(opt :l-code[,opt 2 -code])],} •.• ) JI

dcb, (opt:l I opt 2 )


(same as deb, Opt:ll and Opt2 operands in OPEN macro-instruction)

Although the opt:l and opt2 operands are not meaningful during the
execution of the RDJFCB macro-instruction, these oper~nds can
appear in the L-form of either the RDJFCB or OPEN macro-instruction
to generate identical parameter lists, which can be referred to
with the E-forw of either macro-instruction.

Examples: The macro-instruction in EX1 creates a parameter list for two


data control blocks: INVEN and MA'STER. In creating the list, both data
control blocks are assumed to be opened for input; opt2 for both blocks
is assumed to be DISP. The macro-instruction in EX2 reads the
system-created JFCBs for rUVEN and MASTER frcm the job queue into main
~torage, thus making the JFCB's available to the problem program for
mooification. The macro-instruction in EX3 modifies the parameter list
entry for the data control block namEd INVEN and indicates, through the
TYPE=J operand, -that the problem is supplying the JFCB's for system use.

System Macro-Instructions 131


EXl RDJFCB (INVEN"MASTER),MF=L

EX2 RDJFCB MF=(E,EX1)

EX3 OPEN (, (RDBACK,LEAVE» ,TYPE=J,MF=(E,EX1)

Programming Notes: Any nurober of data control block addresses and


associated options ~ay be specified in the RDJFCB macro-instruction.
This facility makes it possible to read job file control blocks in
parallel.

An exit list address must be provided in each data control block


specified by an RDJFCB macro-instruction. Each exit list must contain
an active entry that specifiEs the rrain storage address of the area into
which a JFCB is to be placed. A full discussion of the exit list and
its use is contained in Appendix D of the IBM Systero/360 Operating
System: Control Program Services publication. The format of the job
file control block exit list entry is as follows:

r--------------T------------------T------------------------------------,
I Type of Exit I Hexadecimal Code I Contents of Exit List Entry I
I List Entry I (high-order byte) I (three low-order bytes) I
~--------------+------------------+--------------~---------------------i
I Job file I 07 I Address of a 176-tyte area to be I
I control block I I provided if the RDJFCB or OPEN I
I I I (TYPE=J) macro-instruction is used. I
I I I This area must begin on a full word I
IL ______________ LI __________________ I ____________________________________
~
boundary. JI

The main storage area into which the JFCB is read must be at least
176 bytes long.

The data control block may be open or closed when this macro-
instruction is executed.

Cautions: The following errors cause the results indicated:

Error Result

A DD control statement has not been No action


provided.
A main storage address has not been Abnormal termination of task
provided.
L- and E-Form Use: The Land E forms of this IT.acro-instruction are
written as described in Appendix B of the IBM System/360 Operating
System: control Program Services publication.

132
Access method option Device code designations
alternative list 118 catalog and VTOC maintenance 29
eligible routines 118,120 DEVTYPE macro-instruction 127
function 117 DEVTYPE macro-instruction
operator communication 116,,118 DEVTAB operand 126,127
procedure library list 118,119 format 126
standard list 120 purpose 126
storage requirements 117 Dummy WAITR routine
Accounting routines example 122,123
entry to 40 EXEC statement PARM field 122,124
exit from 41 functions 122
input to 40 input data via job stream 124
insertion in control program 41
output from 41 Editor routines
dual-density contiict 55
BLDL table option entry conditions 56,57
alternative list 118 general logic flow 58
eligible entries 117 insertion in control program 63,64
entry size 117 module names 55
function 116 programming conventions 55
operator communication 116., 118 volume label conflict 55
procedure library list 118,119 EXCP macro-instruction
standard list name 116 channel program 76
storage requirements 117 channel program completion 79
channel program dev~ge end errors 79
Catalog maintenance channel program initiation 78
alias entry 27 CLOSE with EXCP 84,,92
CAMLIST macro-instruction control blocks 77
11,12~13,14,15,16,17~18 data control block format 86
CATALOG macro-instruction 17,18 DCB with EXCP 77,84
control volume pointer entry 27 DEB with EXCP 77,96
data set cataloging 17 ECB with EXCP 77,95
data set deletion (direct-access EOV with EXCP 84,91
volumes) 19 lOB use with EXCP 77,93
data set pointer entry 26 OPEN with EXCP 84,90
data set renaming 20 programmer use 77
generation index build 13 system use 75
generation index pointer entry 27
index alias assignment 14
index alias deletion 15 IECDSECT macro-instruction
index build 13 format 65
index control entry 25 macro-definition 65
index deletion 14 purpose 65
index link entry 2_6 use in editor routines 61
INDEX macro-instruction 13,14,15,16 use in nonstandard label routines 52
index pointer entry 26 IEFJFCBN macro-instruction
LOCATE macro-instruction 11,12 format 71
volume control block contents 28 macro-definition 73
volume control block pointer entry 26 purpose 71
volume index control entry 25 use in editor routines 61,63
Catalog and VTOC maintenance IEFUCBOB macro-instruction
device code designations 29 format 70
Control volumes macro-definition 70
connection 15 purpose 70
disconnection 16 use in editor routines 61,,63
~se in nonstandard label routines 52
Data set protection
concatenation 114 JFCB modification 130
counter maintenance 114
operating characteristics 113 Nonstandard label routines
SCRATCH and RENAME functions 114 control information 47
termination of processing 113 design 45
volume switching 114 entry point 45

Index 133
C28-6550-2

.EXCP usage 46 Land E-form use 131


exit from 45,53 purpose 131
input header 44
input trailer 44 SVC routines
insertion in control program 53,54 design 32
output header 44 exit from 33
output trailer 45 insertion in control program 37
register usage 45,47 interruption 32
size 45 location 32
naming 33
OPEN macro-instruction number assignment 33
use with RDJFCB 130 programming conventions 33
type=J operand 130 size 32,33
PASSWORD data set Tracing routine
binary counter 113 table entry formats 109
characteristics 112 table location 109 :; 132
creation 113
protection 113 VTOC maintenance
protection mode indicators 113 CAMLIST macro-instruction 19,20.,21
record format 112 OBTAIN macro-instruction 19
RENAME macro-instruction 21
RDJFCB macro-instruction SCRATCH macro-instruction 20
DCB exit list address 132
error conditions and results 132 WAITR macro-instruction
format 131 use in MFT shift initiation 122,123

(')
I\J
00
I
0'1
lJ1
lJ1
o
I
I\J

International Business Machines Corporation


Data Processing Division
112 East Post Road, White Plains, N.Y. 10601
[USA Only]

IBM World Trade Corporation


821 United Nations Plaza, New York, New York 10017
[International]
READER'S COMMENTS

"I' Title: IBM


System/360 Operating System Form: C28-6550-2
System Programmer's Guide

Is the material: Yes No


Easy to Read?
Well organized?
Complete?
Well illustrated?
Accurate?
Suitable for its intended audience?
How did you use this publication?
_ As Other
an introduction t.:> the subject
________________________________ __ ___ For additional knowledge
fold

Please check the items that describe your position:


_ Customer personnel _Operator _ Sales Representative
_ IBM personnel _ Programmer _ Systems Engineer
_ Manager _Custome~ Engineer _Trainee
_ Systems Analyst _ Instructor Other_______________

Please check specific criticism(s), give page number(s),and explain below:


___ Clarification on page (s)
_ Addi tion on page ( s)
~ _ Deletion on page (s)
~ I - Error on page (s)
~
t.? I Explanation:

fold

FOLD ON TWO LINES,STAPLE AND MAIL


No Postage Necessary if Mailed in U.S.A.
C2:8- 6550- 2
st~aple staple

fold fold

r--------------------,
I FIRST CLASS I
I PERMIT NO. 81 I
I I
IL____________________
POUGHKEEPSIE, N.Y. JI

r------------------------------------------------,
I BUSINESS REPLY MAIL I
IL_______________________________
NO POSTAGE STAMP NECESSARY IF .MAILED IN U.S.A. JI
_________________
111111
111111
POSTAGE WILL BE PAID BY
111111
IBM CORPORATION
P.O. BOX 390 111111
POUGHKEEPSIE, N. Y. 12602
"'d
I1III1 Ii
1-'-
::s
ATTN: PROGRAMMING SYSTEMS PUBLICATIONS 111111 it
CD
DEPT. D58 0..
111111 1-"
::s
c::
told · fold

··
Cfl
:J:lI

()
N
ex>
I

'"
U'I
U'I
0
I
N

International Business Machines Corporation


Data Processing Division
112 East Post Road, White Plains, N.Y. 10601
[USA Only]

IBM World Trade Corporation


821 United Nations Plaza, New York, New York 10017
[Internationalj
staplt

You might also like