File No. S360-30 Form C28-6537-1 OS

Systems Reference

IBM System/360 Data Management

This publication contains information concerning the data management facilities of the IBM System/360 Operating system. It provides programmers coding in the assem­ bler language with the information neces­ sary to deSign programs using these facili­ ties.

This publication describes the catalog­ ing, space allocation, and data access features of the operating system. Informa­ tion is also included on record and label formats and data organizations. PREFACE

This publication, primarily directed to glossary of IBM System/360 Operatinq Sys­ applications programmers coding in the tem: Concepts and Facilities, Form assembler language, is a guide to the data C28-6535. management facilities of the System/360 Operating System. Because it provides detailed information on the facilities It is suggested that the reader be available and how they are used, program­ familiar with the information contained in mers coding in a language other than the the prerequisite publications listed below, assembler language will also find this as well as with the functional and opera­ publication useful. tional characteristics of direct-access devices as described in the recommended ,This is one of a group of publications publication. that describe the organization, functions, and applications of the System/360 Operat­ ing System. Detailed information on and PREREQUISITE PUBLICATIONS coding specifications for the macro­ instructions and the control statements IBM System/360 Operating System: Intro­ described herein may be found in the duction, Form C28-6534 publications IBM System/360 Operating Sys­ tem: control Program Services, Form IBM System/360 Operating System: Con­ C28-6541 and IBM System/360 Operating Sys­ cepts and Facilities, Form C28-6535 tem: , Form C28-6539, respectively. RECOMMENDED PUBLICATION Terms used in this publication are IBM 2841 Storage Control Unit, Form defined either in the text or in the A24-3254

MAJOR REVISION (April, 1966) This edition, Form C28-6537-1, obsoletes Form C28-6537-0. significant changes have been made throughout the manual, and this new edition should be reviewed in its entirety.

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 IBN Branch Offices. A form for readers' comments appears at the back of this publication. It may be mailed directly to IBM. Address any additional comments concerning this publication to the IBM Corporation, Programming Systems Publications, Department D58, PO Box 390, Poughkeepsie, N. Y. 12602

©by International Business Machines Corporation, 1965, 1966 CONTENTS

INTRODUCTION • • 7 Space Allocation for Indexed Sequential Data Sets. . 25 Data Set Control 7 Direct Organization • • • • • • • 26 Insertion of Blocks. • • • • • • • 26 Data Access. • • 7 Telecommunications Organization • • • 27

DATA SET CONTROL FACILITIES. 9 Data Set Definition. • • • • • • 27 . • 27 Data Sets ...... 9 Job File Control Block • • • 28 Data Set Names. 9 Data Set Label • • • • • • 28 DCB -- Define Data Control Block • 29 Data Set Cataloging ••• • • •• 9 DD Statement/DCB The Catalog • • • • 9 Macro-Instruction Relationship. • 30 Control Volumes. • ••• 9 Structure of Catalog Indexes • 10 DATA ACCESS METHODS. • • • 31 Volume Indexes • • • • • 10 Cataloging Data Sets. • • • • • • 10 Macro-Instruction Languages. • • • 31 Generation Data Groups. • • • • • 10 L~nguage for Queued Access. • • 31 Relative Generation Numbers. • • • 12 Language for Basic Access • • 31 Absolute Generation Names. • • 12 Data Event Control Block (DECB) •• 32 Cataloging Generation Data Groups • • 12 Classification of Access Methods. • 32 Data Set Security Protection • .. • 13 (EXCP) Accessing Procedure. .. • • • .• • 32 Data Set Storage and Volumes • • • • 13 OPEN and CLOSE Macro-Instructions • • 33 Data Storage on Direct-Access Use of OPEN and CLOSE. • 33 Volumes. • '. • '. • • • .. • • 13 Volume Initialization. • • • • 14 Buffers and Buffer Pools • • • 35 Storing a Data Set • • • • • • 14 Assembly Time Buffer Pool Direct-Access Volume Options • 15 Construction • •• • • • '. • • • • • 35 Data Storage on Magnetic Tape BUILD -- Bui ld a Buffer Pool • 35 Volumes. • • .. • • • • .• • 15 Object Time Buffer Pool Volume Labeling • • • • • • • 15 Construction • • • • • • • •• • 35 Magnetic Tape Labels • • • 16 GETPOOL -- Get a Buffer Pool • 35 Magnetic Tape Volume FREEPOOL -- Free a Buffer Pool • • 36 Organization. • • • • 17 Direct-Access Labels • • • 18 Access Methods for Sequential Data Sets. • • • • • 36 Data Set Record Formats. • 19 Data Format-Device Type Blocks •••••••••• • 20 Relationships. • • • • • 36 Logical Records • • 20 Card Readers and Punches • • 36 Record Blocking • • • 20 Printers • • • • • '. • • 36 Record Formats. • 20 Paper Tape Reader. '. • • • · 36 Fixed-Length (Format F) ... • • 20 Magnetic Tape. • • '. • • • 36 Variable-Length (Format V) • 21 Direct-Access Devices. • • • 36 Undefined (Format U) • • • 21 Chained Scheduling. • • • • • • 37 Control Character • • • • 21 Queued Sequential . • 37 Data Set Organizations • • • 22 Record Formats. • '. • • • • • • • 37 Sequential Organization • • 22 Buffering Considerations. • • •• 37 Space Allocation for Sequential Buffer Pool Construction • • 37 Data Sets • • • • • • • • 22 Buffer Assignment Procedures • 38 Partitioned Organization ••••••• 22 Buffering Techniques. • • 38 Directory. • • '. •• '. • • • • 23 Simple Buffering • • • • 38 Space Allocation for Partitioned Exchange Buffering • • 38 Data Sets • • • • • • • • • • • • 23 Macro-Instructions. • • • • 39 Indexed Sequential Organization • 23 GET -- Get a Logical Record. • 39 Indexes. • • • • • • • • • 24 RELSE -- Release an Input Buffer • 40 Master Index • • • • • • 24 PUT -- Put a Logical Record. • • • 40 Insertion of Records • • • 25 PUTX -- Put From Existing Data Overflow Area. • • • • • • 25 Set • • • • • • • .. • • • • • • • 40 TRUNC -- Truncate an Output Concatenation of Partitioned Data Buffer. • • • • • • • • • • • • • 41 Sets • • • • .• • • • • • • • • • 52 FEOV -- Force End of Volume. • • • 41 Basic Partitioned Access Method CNTRL -- Control a Printer or Compatibility_ • • • • • • • • • 52 Stacker • • • • • • • • • • 41 PRTOV -- Test for Printer Queued Indexed Sequential Access Overflow. • • • • • 42 Method. • • • • • • • • '. • • 53 Error Conditions. • • • • 42 Record Formats. • • • • • • 53 Input Operations • • • • • •• 42 Format F, Unblocked. • • 53 output Operations. • • • • •• 42 Format F, Blocked. • • • • • • 54 Error Conditions: Internal Details •• 42 Forma t V, Unbloc ked. • • 54 Input Operations • • • • • •• 42 Format V, Blocked. • • • • • • 54 Output Operations. • • • • •• 42 Overflow Records • • • • 55 Error Analysis Routine Delete Codes • • • _ • • 55 (Synchronous Error Exit). • • 42 Buffering Considerations. • 56 Programming Notes • • • • • • • 43 Buffer Pool Construction • 56 Direct-Access Volume Options • • • 43 Buffer Assignment Procedures • 56 Update-in-P lace. • • • • • • • • • 43 Macro-Instructions. • • • • • • • 56 Concatenated Data Sets • • • • • • 43 PUT -- Put a Logical Record. • 56 Read Backwa rds • • . • • • • • • • 44 GET -- Get a Logical Record.. 56 Blocking of Variable-Length RELSE -- Release an Input Buffer • 57 Records • • • • • • • • • •• 44 SETL -- Set Lower Limit of Scan. • 57 ESETL -- End of Scan • • • • • • • 57 Basic sequential Access Method • • 44 PUTX -- Return a Logical Record. • 57 Record Formats •••••••• • 44 Exceptional Conditions,. • • • • • • • 58 Buffering Considerations. • • • • 45 Creating An Indexed Sequential Data Buffer Pool Construction • • 45 Set. • • • • • • • • • • • • • • 59 Buffer Assignment Procedures • • • 45 Programming Notes ,. • • • • • • • 60 GETBUF -- Get a Buffer From a Direct-Access Volume Option. • 60 Pool. •• • • • • • • • 45 Blocking of Variable-Length FREEBUF -- Return a Buffer to a Records • • • • • • • • • • • 60 Pool. • • • • • • • • • • 45 Macro-Instructions •••• • • 45 Basic Indexed Sequential Access Method • 60 READ -- Read a Block • • • • • 45 Record Formats,. • • • • 60 WRITE -- Write a Block • 46 Buffering Considerations. • • • • 60 CHECK -- Wait for and Test Buffer Pool Construction • • • 60 Completion of Read or Write Buffer Assignment Procedures • 61 Operation • • • • • • • • • • • • 46 FREEDBUF -- Free a Dynamically FEOV -- Force End of Volume. • • • 47 Obtained Buffer • • • • • • • 61 CNTRL -- Control On-Line Macro-Instructions. • • • • • • • 61 Input/Output Devices. • • • 47 READ -- Retrieve a Logical PRTOV -- Test for Printer Record. • • • • • • • • • 61 Overflow. • • • • • • • • • • 47 WRITE -- Write a Logical Record. • 62 NOTE -- Provide Position Exceptional Conditions. • • • • • • • 62 Feedback. • • • • • • • • • • 47 Reorganizing an Indexed Sequential POINT -- Point to Block. • • • 47 Data Set • • • • • • • • • • 63 BSP -- Backspace One Block • • 48 Programming Notes ••• • • • • · 63 Error Conditions. • • • • • 48 Overflow Records • • • • • • • • • 63 Programming Notes • • • • • 48 Direct-Access Volume Option. · 63 Direct-Access Volume Options • • • 48 Update-in-Place. • • • • • • • • • 48 Basic Direct Access Method • • 63 Read Backwards and Concatenated Record Formats,. •• • • • • 64 Data Sets . .. • • • • • 49 Buffering Considerations. • 64 Device Considerations. • • 49 Buffer Pool Construction • 64 Device Independence. • • 49 Buffer ASSignment Procedures • • · 64 Macro-Instructions. • • • • · 64 Basic Partitioned Access Method. 49 READ -- Read a Block • • • • • 64 Record Formats and Buffering WRITE -- write a Block ••• • 65 Considerations • • • • • • • • • 49 RELEX -- Release Exclusive Macro-instructions. • • • • • • 49 Control • • • • • • • • • • . 66 FIND -- Position to Member of Exceptional Conditions. • • 66 Partitioned Data Set. • • • • 49 Exclusive Control • • • • • • 67 BLDL -- Build List • • • • • 51 Extended Search Option,. • . 67 STOW -- Manipulate Partitioned Creating Direct Data Sets • . 67 Data Set Directory. • • • • 51 Format F Blocks With Keys. • • 67 Programming Note. • • • • • 51 Format F Blocks Without Keys • • • 68 Creating a Partitioned Data Set • • • 51 Formats V and U Blocks • • • • • . 68 Programming Notes • •• • • • • . 68 Split cylinder Mode. • • • • • 68 Direct-Access Volume Options • 68

INDEX. • • • • • • • •. • • • • 69 ILLUSTRATIONS

FIGURES

Figure 1. Format of the Catalog ••••• 11 Figure 13. Addition of Records to a Figure 2. The catalog on Two Volumes •• 11 1-Cylinder, 3-Track Indexed Figure 3. Organization of Standard Sequential Data Set • • • • • • '. 25 Tape Labels • • • • • • • • • 16 Figure 14. Addition of Blocks to a Figure 4. Standard Label Formats for Direct Data Set • • • • • • • • • 27 Magnetic Tape • • • • • • • • • • • 18 Figure 15. Flow of Information To and Figure 5. Direct-Access Labeling • • • • 19 From Data Control Block • • • • • 28 Figure 6. Blocked Logical Records •• • • 20 Figure 16. Unblocked Fixed-Length Figure 7. Format F Records • 21 Records • • • • • • • • • • • • • • 53 Figure 8. Format V Records ••••• • • 21 Figure 17. Blocked Fixed-Length Figure 9. Format U Records ••••• • • 21 Records • • • •• • • • • • 54 Figure 10. A Sequentially Organized Figure 18. Key and Data Areas (Format Data Set. • • • • • • • • • • • .. 22 F). • • • • • • • • • • • • • . • • • • 54 Figure 11. A Partitioned Data Set Figure 19. Unblocked Variable-Length with Four Members •• • • • • • • 23 Records • • • • • • • • '. • • • • • 55 Figure 12. Index Structure for an Figure 20. Blocked Variable-Length Indexed Sequential Data Set • • • 24 Records • • • • • • • 55 Figure 21. Key and Data Area (Format V).. ••• • • • • • • • • 55 Figure 22. Overflow Records. • 55

TABLES

Table 1. Data Access Methods. • • • 32 Table 2. Data Set Uses Specified in OPEN Macro-Instruction. • • • • 34 Table 3. Valid Combinations of Modes and Buffering Techniques. • • • • • • • 40 Table 4. Basic Sequential Access Method Device Considerations. • • • • • 50 Table 5. Exceptional Conditions With the Queued Indexed Sequential Access Method. • • • • • • • • • • • • • • • • 58 INTRODUCTION

The data management function of the the security facility of the System/360 Operating System assists pro­ System/360 Operating System. Using this grammers in achieving maximum efficiency in facility, a programmer can prevent unautho­ manag~ng the mass of data and the many rized access to payroll data sets, sales programs that are processed in an installa­ forecast data sets, and all other data sets tion. To attain this objective, data man­ requiring special security attention. A agement facilities have been designed that security protected data set is made avail­ provide systematic and effective means of able for processing only when the correct classifying, identifying, storing, catalog­ password is furnished. ing, and retrieving all data (including loadable programs) processed by the operat­ In addition to control of data set ing system. location and security, control of direct­ access storage space allocation is provided The facilities provided can be grouped by the system. This control facility frees into two major categories: data set control programmers from the details involved in and data access. allocating direct-access storage space to a data set. The programmer need specify only the amount of space required, and optionally the storage device required, and DATA SET CONTROL space is allocated accordingly. The system, as well as providing a wide The System/360 Operating System provides range of control facilities, permits the a comprehensive group of facilities that programmer to organize data sets and indi­ feature automatic and efficient control of vidual records in a variety of standard many data processing operations previously formats that can be selected to meet spe­ performed by programming personnel as cler­ cific data processing needs. ical tasks. A number of these control facilities are described in the following paragraphs. DATA ACCESS

Data set location control, supported by an extensive cataloging system, enables The data access facilities provided by programmers to retrieve data and programs the operating system are a major expansion by symbolic name alone, without specifying of the input/output control systems (IOCS) volume serial number. In freeing computing of previous operating systems. personnel from the necessity of maintaining involved volume serial number inventory Input/output routines are provided to lists of data and programs stored within efficiently schedule and control the trans­ the system, the catalog reduces manual fer of data "between main storage and intervention and its concomitant -- human input/output devices. Routines are avail­ 'error. able to perform the following functions:

The data sets stored within the catalog­ • Read data. ing system can be classified according to installation needs. For example, a sales • write data. department can classify the data it uses by geographic area, by individual salesman, or • Block and deblock records. by any other logical plan. • Overlap reading/writing and processing Another major facility of the cataloging operations. system enables programmers to classify suc­ cessive generations (updates) of related • Read and verify volume and data set data. These generations can be given simi­ labels. lar names and subsequently be referred to relative to the current generation. The • Write data set labels. system automatically maintains a list of the most recent generations that have been • Automatically position and reposition produced. volumes.

Control of confidential data is a recur­ • Detect error conditions and correct ring managerial problem that is solved by them when possible.

Introduction 7 • Provide exits to user-written error and • Permit the programmer to defer such label routines. specifications as device type, block length, and buffer size until a program Flexibility has been a major design is submitted for execution. principle in the system's data access facilities. The programmer and the instal­ lation can select from among eight methods • Permit the free interchange of programs of data access to obtain a group of facili­ and data among installations. ties tailored to their processing require­ ments. Each access method supplies a com­ • Save the time and expense involved in prehensive group of macro-instructions that writing routines similar to those pro­ permit the programmer to specify vided. input/output requests with a minimum of effort; the programmer need not be con­ • Allow programmers to concentrate their cerned with learning the individual access programming efforts on processing the characteristics of the many input/output records read and written by the data devices supported by the system. management function. In brief, the data management facilities • Provide standardized methods for hand­ provided by the system/360 Operating System ling a wide range of input/output and offer a number of advantages: related operations.

• Permit the programmer to store, modify, • Provide an input/output system that and refer to programs and data using handles messages received from or sent the storage facilities of the system. to remote terminals.

• Free the programmer from concern with • Provide the flexibility for including specific input/output device configu­ new or improved devices as they become rations. available.

8 DATA SET CONTROL FACILITIES

This section describes the data set denotes the data set name and other perti­ control facilities of the System/360 Oper­ nent information (e .• g., volume serial ating System. Data set identification, number) in a control statement called the cataloging, security, storage space alloca­ data definition (DO) statement. (A com­ tion, and data definition procedures are plete description of the DD statement for­ described. Information is also provided on mat can be found in the publication IBM label and record formats, and data set System/360 Operating System: Job Control organizations. Language. To permit different data sets to be processed without program reassembly, the DATA SETS programmer does not refer to the data set in problem programs by its name, but refers to a data control block associated with the A data set is a named, organized collec­ name of the DD statement. The programmer tion of one or more records that are reserves space for a data control block at logically related. Information in data assembly time by issuing a DCB macro­ sets is not restricted to a specific type, instruction. The DD statement is supplied purpose, or storage medium. A data set may in the job stream at execution time. be, for example, a source program, a library of macro-instructions, or a file of data records processed by a problem pro­ gram. DATA SET CATALOGING

Keeping track of the volume on which a DATA SET NAMES particular data set resides is a burden, and often a source of error. The cataloging facility of the System/360 Oper­ The name of a data set identifies a ating System remedies this situation. It group of records as a data set. All data allows the programmer to refer to data sets sets recognized by name alone (i.e., refer­ without specifying their physical loca­ able without volume identification) and all tions. When a data set is cataloged, the data sets residing on a given volume must serial number of its volume is associated be distinguished from one another by unique in the catalog with the name of the data names. To assist in this, the system set. provides a means of qualifying data set names. A data set name is one simple name or a THE CATALOG series of simple names joined together so that each represents a level of qualifica­ tion. For example, the data set name The catalog of data sets is itself a DEPT999~SMITH.DATA3 is composed of three data set residing on one or more direct­ simple names that are delimited to indicate access volumes. It is organized into a hierarchy of categories. Starting from indexes that connect data set names to the left, each simple name is a category corresponding volume serial numbers (and to within which the next simple name is a data set sequence numbers for magnetic tape unique subcategory. volumes). Any data set residing on a direct-access or a magnetic tape volume can Every simple name consists of one to be cataloged. eight alphameric characters, the first of which must be alphabetic. The special character period ( • ) separates simple names from each other. Including all sim­ Control Volumes ple names and periods, the length of a data set name must not exceed 44 characters. Thus, a maximum of 22 qualification levels Although the complete catalog usually is possible for a data set name. exists on the system residence volume, the programmer can request that parts of the To specify the use of a particular data catalog be placed on other volumes. Any set by a problem program, the programmer volume, including the system residence vol-

Data Set Control Facilities 9 ume, that contains part of the catalog is cataloged under a specific hierarchy of called a control volume. An installation indexes. The name of the data set speci­ can construct control volumes for catalog­ fies the indexes under which it is cata­ ing specific types of functionally related loged. The cataloged data set with the data sets, such as scientific or commer­ name E.A.P in Figure 1 indicates that the cial. data set having the simple name P is cataloged under index A which, in turn, is In general, control volumes are remov­ subordinate to index E. able so that complete data separation may be achieved. For example, a collection of Figure 2 is an extension of Figure 1 data sets might be cataloged on a removable showing two index hierarchies distributed control volume apart from the system resi­ between the system residence volume and dence volume and separate from the rest of another control volume. Note that index E, the catalog. This volume and its related which is a highest level index on the data sets could then be moved freely from control volume, has an entry in the volume one installation to another, as long as all index of both the system residence volume highest level names on the control volume and the other control volume. are entered in the catalog of the system residence volume at each installation. For any given data set, only one level of control volume other than the system resi­ CATALOGING DATA SETS dence volume is permitted. A data set can be cataloged only if the Structure of catalog Indexes index structure that determines its name exists in the catalog. For example, if a data set named A.B.C is to be cataloged, As previously described, a data set name the volume index on the system residence consists of one or more simple names. For volume must have an entry for an index A. every distinct level of qualification in The index A must have an entry directed to the name of a cataloged data set, the an index called B. When data set A.B.C is catalog includes a group of one or more cataloged, C is entered into index B with blocks called an index. catalog indexes an indication of the volume location of the are created and modified, as required, by a data set. utility program. (Refer to the publication IBM system/360 Operating System: utilities, cataloging a data set with only one Form C28-6586.) simple name is permissible and may be desirable if only a few data sets are to be The hierarchy of index levels is deter­ so cataloged. These data sets can be mined by the order of categories in the rapidly retrieved, but retrieval time for data set name. The logical records in any data sets with qualified names is increased index are entries of the simple names and proportionally. corresponding physical locations of all subordinate indexes or data sets. Every To catalog a data set, the programmer control volume contains a master index specifies CATLG in the DISP parameter of called the volume index, which has a record the DD statement. To remove references to of the first simple name of each data set a data set from the catalog, the programmer cataloged on that control volume. The specifies UNCATLG in the DISP parameter. A lowest level index for a data set name data set can be deleted as well as have its contains the volume information needed to catalog references erased, if the program­ locate the data set itself. mer specifies DELETE in the DISP parameter. Cataloging, uncataloging, or deletion of a data set can also be accomplished through Volume Indexes the use of the utility program referred to in the section, "Structure of Catalog Indexes." A catalog search always starts in a volume index. If a specific control volume on which to begin the search has not been specified, searches of the catalog start GENERATION DATA GROUPS with a scan of the volume index on the system residence volume and may continue to the volume index of other control volumes certain data sets that are periodically until the lowest level index for the updated may be chronologically related to desired data set is found. each other. For example, similar payroll data sets may be created every week. Figure 1 represents a logical catalog Cataloging such data sets with unique data structure. Every cataloged data set is set names would be as inconvenient as

10 Volume Table of Contents

~ __7

Volume Index

Index Index B E A

Figure 1. Format of the catalog

System Residence Volume Control Volume

Volume Table of Contents Volume Table of Contents

Index B

Figure 2. The Catalog on Two Volumes

Data set Control Facilities 11 giving them all the same name and account­ Absolute Generation Names ing for volume identification. For this reason, the system provides an option with the cataloging facility that assigns num­ To each data set in a generation data bers to individual data sets in a chrono­ group, the system assigns an absolute gen­ logical collection, thereby allowing the eration name of the form GxxxxVyy, where programmer to catalog the entire collection xxxx is an unsigned 4-digit decimal genera­ under a single name. The programmer can tion number and yy is an unsigned 2-digit distinguish among successive data sets in decimal version number. Appending the gen­ the collection without assigning a new name eration name to the name of the generation to each data set. Since each data set is data group provides a unique name for the normally created by updating the data set data set. For example, if 0001 is the created on the previous run, the update is generation number initially specified for called a generation, and the number asso­ generation data group A.PAYROLL, the pro­ ciated with it is called a generation grammer can refer to the first generation number. as A.PAYROLL.G0001VOO and to subsequent generations as A.PAYROLL.G0002VOO, A generation data group is a collection A.PAYROLL.G0003VOO, etc. of related cataloged data sets that can be referred to by a common name in a DD When a data set is created by the system statement. The programmer can refer to a as a new generation, the system develops particular generation by specifying, with its generation and version numbers by the common name of the group, either the adding the positive relative generation relative generation number or the genera­ number specified in the DD statement to the tion name of the data set. As explained in previous generation number and setting the the following paragraphs, the relative gen­ version number to 'zero. Thus, if the eration number of a data set will vary in present generation is· G1384V03 and the time, but its generation name is always the incrementing factor specified is the rela­ same. tive generation number (+2), the new gener­ ation is G1386VOO. The system does not automatically create nonzero version num­ Relative Generation Numbers bers. If the programmer wishes to replace an existing generation and, optionally, to change the version number, he must specify At any given time, the relative genera­ CATLG in the DISP parameter of the DD tion number of the most recently cataloged statement for the new data set. The system data set in any generation data group is automatically changes the catalog entry for zero. The relative generation numbers of the named generation. Thus, if a new data previously cataloged data sets in the group set that replaces the generation named are negative integers, indicating recency G1386VOO is to be cataloged, it may be relative to that of the latest cataloged named G1386V01. G1386VOl replaces G1386VOO generation. New data sets for the group in the generation data group index when the are created by the use of positive integers system changes the catalog entry. The data as relative generation numbers. For exam­ set that was replaced is not scratched ple, when payroll data sets compose a automatically. generation data group named PAYROLL, the programmer can refer to the most recent By specifying the name of the generation generation as PAYROLL(O) and to immediately data group without any generation number, preceding generations as PAYROLL(-l), e.g., A.PAYROLL, the programmer can refer PAYROLL(-2), etc. A new generation would to a 'concatenation' of all the existing then be referred to as PAYROLL(+l). After generations. This allows all the genera­ this new generation is cataloged, it auto­ tions currently cataloged to be retrieved matically becomes PAYROLLCO), and the old as a Single data set starting with the most PAYROLL(O) is referred to as PAYROLL(-l). recent generation and ending with the Thus, adding a generation changes the rela­ oldest. tive generation numbers of all the data sets in the group. Relative generation numbers are depen­ CATALOGING GENERATION DATA GROUPS dent upon the physical position of the generation name in the index. If a name is dropped from the index, the contents of the In the catalog structure, a generation index are shifted. Therefore, if a data data group is represented by a lowest level set from the generation data group is index that contains an entry for each removed from the catalog, its relative generation within the group. To build an generation number is automatically asso­ index for a generation data group, the ciated with the location of the immediately programmer specifies, for" a model genera­ preceding generation. tion, several parameters in the BLDG state-

12 ment, a utility program control statement. set has at least one entry in a cataloged (For a description of the BLDG statement, data set named PASSWORD that the programmer refer to the publication IBM System/360 creates on the system residence volume. Operating System: utilities.) Each entry consists of a 52-byte key (a 44-byte data set name field and an 8-byte One of these parameters specifies the password field) followed by an 80-byte number of generations the system is to record. If the name of the data set is maintain. For example, if PAYROLL(-2), less than 44 bytes, it must be left­ PAYROLL(-l), and PAYROLL(O) are to be main­ justified in its field, with blanks filling tained, the programmer specifies three all unused positions. The first two bytes entries. When the specified number of of the 80-byte record contain a binary entries fills the index and another genera­ counter, which will be incremented by one tion is to be cataloged, the oldest genera­ every time the data set is successfully tion is usually droppe~ from the generation opened. The third byte of the 80-byte data group index to allow space for the record is a mode field, which indicates newest. that the problem program can either read, write, or read and/or write the data set. As an alternative, the programmer may The remaining 77 bytes can be used at the specify a parameter that causes all the old discretion of the installation. generations to be dropped so that the newest data set effectively begins another The PASSWORD data set itself can be generation data group. For example, PAY­ protected when its own name is associated ROLL generations accumulated IlIlonday through with a password (called the master Friday might be dropped the following Mon­ password) in one of its records. This data day. The index of this generation data set is created and maintained by the group is large enough for only five programmer. entries, and an attempt to catalog a sixth entry causes the index to be emptied. The When a problem program attempts to proc­ sixth entry becomes the first entry of the ess a protected data set, the operator new generation data group. receives a console message requesting the password of the data set. If the operator If there are exceptions to such a weekly issues the correct password (he is glven schedule, such as holidays when no PAYROLL two tries), the problem program is permit­ generation is created, the correct entries ted to access the data set; otherwise, the in the index are not filled unless program terminates abnormally, and the appropriate "makeup" generations are cata­ operator is so informed. loged. On Monday following a week with a holiday, the programmer could create a dummy generation to make up for the absent generation before cataloging Monday's gen­ DATA SET STORAGE AND VOLUMES eration. To create and catalog this extra generation, the programmer could specify the generation name GOOOOVOO in the DD System/360 provides an unprecedented statement and then execute a job step to variety of devices for collecting, storing, fill the index with this entry. and distributing data. Despite this vari­ ety, the storage units have many common Another parameter in the BLDG statement characteristics. For convenience, there­ may be used to indicate that data sets fore, the generic term volume is used to residing on direct-access volumes are to be refer to such diverse storage media as tape scratched when their entries are removed reels, disk packs, data cells, and drums. from the catalog. Data sets are identified to the operat­ ing system by volume serial numbers. These numbers must be supplied to the system DATA SET SECURITY PROTECTION unless the data set is cataloged or passed or unless the data set is a new output data set. The data set security facility provides protection of data sets residing on stand­ ard labeled tapes or direct-access volumes DATA STORAGE ON DIRECT-ACCESS VOLUMES from unauthorized use by problem programs. A protected data set cannot be made avail­ able to a problem program until a password Direct-access volumes play a major role associated with the data set is entered in the System/360 Operating System. These into the system. If the correct password volumes are used to store not only the is issued, the problem program can either operating system itself, but also all load read, write, or read and/or write the modules processed by the linkage editor. protected data set. Each protected data In addition, direct-access volumes are used

Data Set Control Facilities 13 by many installations as the chief storage of blocks., tracks, or cylinders. Space can media for the vast number of data sets be allocated in a device-independent manner processed each day. The following sections if the request is in terms of blocks. If describe the facilities for storage space the request is in terms of tracks or allocation on direct-access volumes. cylinders, the programmer must be aware of such device considerations as cylinder capacity. Volume Initialization ALLOCATION BY BLOCKS: When the amount of space required is expressed in terms of blocks, the programmer specifies the num­ Before a direct-access volume can be ber, average block length, and key length used for data storage, it must be initial­ of the blocks within the data set. From ized by a volume initialization utility this information, the operating system cal­ program. This program writes standard home culates and allocates the number of tracks address and track descriptor records, required. Space is always allocated in checks for bad tracks, automatically whole track units. The programmer may also assigns alternate tracks (if necessary), request that the space allocated for a and initializes the remainder of each track specified number of blocks begin and end on to binary zeros. It also writes the ini­ cylinder boundaries (ROUND subparameter of tial volume label, provides space for addi­ the SPACE parameter). tional volume labels, and writes the volume table of contents (VTOC), which is dis­ ALLOCATION BY TRACKS OR CYLINDERS: When cussed in the following section. This the amount of space required is expressed utility program and the procedure for exe­ in terms of tracks or cylinders, the pro­ cuting it are described in the publication grammer must also specify a device type in IBM System/360 Operating System: Utilities. the UNIT parameter of the DD statement. VOLUME TABLE OF CONTENTS: The volume table SPLIT CYLINDER: The SPLIT parameter of the of contents (VTOC) describes the contents DD statement permits the programmer to of a direct-access volume. It is a data request that cylinder space be allocated so set that is composed of a series of data that portions of two or more data sets use set control blocks (DSCB), each of which is tracks within each cylinder. For example, composed of one or more control blocks. three cylinders might be allocated for two The VTOC can contain the following data set data sets, one data set to occupy the first control blocks: two tracks of each cylinder, and the other to occupy the remaining tracks. This allo­ cation of split cylinders reduces access • A DSCB for each data set on that time in specialized applications. volume. Method of Allocation: The operating system • A DSCB that indicates the space allo­ checks the VTOC to determine available cated to the VTOC itself. areas and then allocates space in accor­ dance with the following general rules • A DSCB for all tracks on the volume (unless the programmer has specified that are available for allocation. otherwise) :

The DSCB for each data set contains the 1. If the volume on which the data set is name, description, and location on the to be stored contains more than one volume of the data set; its size depends on available area, space is allocated the organization and number of noncontigu­ from the smallest available area large ous areas of the data set. enough to satisfy the request. 2. If the volume on which the data set is to be stored contains no single avail­ Storing a Data Set able area large enough to satisfy the allocation request, space is allocated from more than one area. The largest When a data set is to be stored on a available areas are used. direct-access volume, the programmer must supply the operating system with control 3. If the five largest available areas do information designating the amount of space not satisfy the allocation request, to be allocated to the data set. This the selected volume is not used; allo­ information is specified by using either cation is made from another volume the SPACE, SPLIT, or SUBALLOC parameter of assigned to the data set. The pro­ the DD statement for that data set. The grammer norrrally need not be concerned amount of space can be specified in terms that noncontiguous areas on a volume

14 are allocated to a data set. The DATA STORAGE ON MAGNETIC TAPE VOLUMES operating system automatically handles these discontinuities in data storage and retrieval operations. Because of the serial nature of magnetic tape devices, the operating system does not provide space allocation facilities com­ ALLOCATION BY ABSOLUTE ADDRESS: The ABSTR parable to those for direct-access volumes. subparameter of the SPACE parameter allows When a new data set is to be placed on a the programmer to request that the space to magnetic tape volume, the programmer should be allocated begin at a specified track specify the data set sequence number. For address. This subparameter must be used if a data set with standard labels or no the volume from which space is to be labels, the operating system positions the allocated was initialized by an IBM volume so that the data set can be read or System/360 Basic Operating system utility written. If the data set has nonstandard program or if any space on the volume was labels, the installation must provide allocated or scratched by the basic operat­ volume-positioning in its nonstandard label ing system. It should also be used if the processing routines. All data sets stored data set for which space is to be allocated on a given magnetic tape volume must be contains location-dependent information in recorded in the same density. the form of absolute track addresses. When a data set is to be stored on an OTHER SPACE ALLOCATION OPTIONS: The DD unlabeled tape volume and the programmer statement provides the programmer with much has not specified a volume serial number, flexibility in specifying space require­ the system assigns a serial number to that ments. He can specify that space is to be volume and to any additional volumes contiguous (CONTIG subparameter) and he can required for the data set. The first such suballocate space that already is assigned volume is assigned the serial number (SUBALLOC parameter). The programmer can LGL001; the second, LGL002, etc. also reserve either the largest single block of available space on a volume (MXIG If the programmer has specified volume subparameter) or up to five of the largest serial numbers for the unlabeled volumes on blocks (ALX subparameter). which a data set is to be stored, but additional volumes are found to be required, the system assigns volume serial numbers in the same way. If, for example, the programmer has specified volume serial Direct-Access Volume Options numbers for two volumes, but a third volume is required, it is assigned LGL003 as its serial number; if still a fourth volume is The following sections describe two required, it is assigned LGL004; etc. direct-access volume options. Volume serial numbers assigned by the TRACK OVERFLOW: If the record overflow system are of little concern to the pro­ feature is included in the computing sys­ grammer, unless data sets residing on such tem, the programmer can minimize unused volumes are cataloged or passed. In this track space on volumes by specifying the event, it is possible for data sets resid­ track overflow option in the DCB macro­ ing on different volumes to be cataloged or instruction or DD statement for a given passed under identical volume serial num­ data set. When this option is used, a bers. Later retrieval of such data sets record that does not fit on a track is could result in unpredictable errors. For partially written on that track and this reason, if a data set to be stored on continued on the next track. If this an unlabeled tape volume(s) is to be cata­ option is not used, records are not split loged or passed, the programmer should between tracks. specify the volume serial number(s) of the volume(s) required. WRITE VALIDITY CHECK: If the programmer specifies the write validity check option in either the DCB macro-instruction or the DD statement, the system reads each record back (without data transfer) and, by test­ VOLUME LABELING ing for a data check condition from the I/O device, verifies that each record trans­ ferred from main to direct-access storage Various groups of labels are used in was written correctly. This verification secondary storage of the System/360 Operat­ requires an additional revolution for each ing System to identify magnetic tape and record that is written. Standard recovery direct-access volumes as well as the data procedures are initiated if an error is sets they contain. Magnetic tape volumes detected. can have standard or nonstandard labels, or

Data Set Control Facilities 15 they can be unlabeled. Direct-access A tape using standard tape labels is volumes are supported with standard labels identified as such by the operating system only. Standard label support includes the when it reads the initial record and deter­ following label groups: mines that it is an initial volume label by finding that the first four characters of the record are VOLl (volume label 1). • A volume label group. • A data set label group for each data set. Initial Volume Label 1 t 2 I 3 • Optional user label groups, i.e., user Additional 4 Volume Label Group header and/or trailer labels for each Volume 5 data set, for physical sequential data Labels 6 set organizations. I 7 t 8 HDR 1 Data Set Header specific information on the contents and HDR 2 Label Group formats of the System/360 Operating System User Header Labels 1 standard labels is contained in the publi­ 2 3 cation IBM System/360 Operating System: 4 User Header Label Group Control Program Services. 5 6 7 8 Magnetic Tape Labels Tape Mark } Data Set ----.::aD ta BI oc k s ~ The type(s) of label processing to be Tape Mark supported by an installation is selected EOVl or EOFl during the system generation process. Data Set Trailer Thereafter, the programmer specifies, in EOV2 or EOF2 Label Group User Trailer Labels 1 the DD statement, the type of label proc­ 2 essing he is going to use for a tape data 3 4 set. If he does not specify a type of User Trailer Label Group label processing, standard label processing 5 is assumed by the system. 6 7 STANDARD TAPE LABELS: Standard tape labels 8 are 80-character records. All labels are Tape Mark } ~~ End of } End of recorded in the Extended Binary Coded Deci­ Tape Mark Data mal Interchange Code (EBCDIC), with the exception of 7-track tape labels, which are Figure 3. Organization of Standard Tape recorded in Binary Coded Decimal (BCD). Labels The density of a tape label is the same as that of the data on the tape, which was Data Set Header Label Group: The data set specified in the DD statement or the DCB header label group consists of two data set macro-instruction. header labels: HDRl and HDR2. HDRl con­ tains operating system data and device­ The organization of standard tape labels dependent information; HDR2 contains data for a single tape volume and one data set set characteristics. (Additional data set is illustrated in Figure 3. header labels are not supported.) These labels are created by the operating system Volume Label Group: The volume label group in accordance with a fixed format when the consists of an initial volume label, which data set is recorded on tape. They can is created by a utility program, and a then be used to locate the data set, to maximum of seven additional volume labels. verify references to the data set, and to These additional labels are processed by protect it from unauthorized use. means of an installation routine that is incorporated into the system. User Header Label Group: Optionally, a maximum of eight user header labels can In the System/360 Operating System, a appear on tape immediately following the volume label identifies a volume and its data set header labels. The operating owner. Although primarily intended to ver­ system writes these labels as directed by ify that the correct volume is mounted, the problem program recording the tape. volume labels also permit volume protection The first four characters of the user by preventing use of the volume by unautho­ header label must be UHL1, ••• ,UHL8; the rized programs. remaining 76 characters can be specified by

16 the user. When the tape is read, the Magnetic Tape Volume Organization operating system makes the user header labels available to the problem program. If a data set on magnetic tape is to be processed by an IBM data access method, the Data Set Trailer Label Group: The data set data set must be preceded and followed by a trailer label group consists of two trailer tape mark, with one exception: the first labels: EOVl or EOFl and EOV2 or EOF2. data set on an unlabeled tape volume is not These labels are identical to the data set preceded by a tape mark. (Note that if a header labels except that: tape mark should precede the first data set on an unlabeled tape volume, the data set sequence number of that first data set is two.) Tape marks may not exist within a • The label identifier EOVl or EOFl data set. replaces HDR1, and the label identifier EOV2 or EOF2 replaces HDR2. When an access method is used to create a tape data set with standard labels or no • The first label (EOVl or EOF1) contains labels, all tape marks are automatically a block count field that indicates the written by the system. If standard label number of blocks of the data set processing is being used, one tape mark recorded on the tape. It is used for follows each trailer label group, with one checking purposes. This field contains exception: two tape marks are written after zeros in the HDRl label. the last trailer label group on a volume when it indicates end of data set (EOF). If an unlabeled volume is being used, an These labels duplicate the data set additional tape mark is written after the header labels to facilitate backward read­ tape mark that follows the last data set on ing of the tape. Location, verification, the volume. and protection of the data sets can also be achieved with data set trailer labels. When an access method is used to create a tape data set with nonstandard labels, neither of the delimiting tape marks is User Trailer Label Group: A maximum of written by the system. If an access method eight user trailer labels can immediately is to be used to retrieve the data set, follow the data set trailer labels. These these tape marks should be written by the labels are recorded (and processed) as appropriate installation nonstandard label explained in the preceding text for user processing routine. The system does not header labels, except that the first four require that one or more tape marks be characters must be UTL1, ••• ,UTL8. written after nonstandard trailer labels, since installation nonstandard label proc­ essing routines must handle the positioning NONSTANDARD TAPE LABELS: When nonstandard of tape volumes. labels are used for magnetic tape, nonstan­ dard label processing routines are supplied Figure 4 illustrates the organization of by the installation and incorporated in the standard labels and data on magnetic tape operating system at system generation time. for the following tape organizations. Detailed information about writing nonstan­ dard label processing routines is contained Single Data Set/Single Volume: Volume in the publication IBM System/360 Operating labels are followed by data set header System: System programmer's Guide, Form labels and optional user header labels. C28-6550. The data set is preceded and followed by a tape mark. The data set trailer labels The number and contents of nonstandard (EOF) appear after the tape mark following labels can be specif ied by the user., except the data set and are followed by the that the initial record cannot be a stand­ optional user trailer labels. Two tape ard tape volume label; i.e., the first four marks are the last elements of this tape characters of this record cannot be VOLle organization. When these first four characters are not VOL1, the operating system transfers con­ Single Data Set/Multiple Volumes: This trol to the nonstandard label processing class of tape organization is an expansion routines. These routines provide volume of the previous class. More than one positioning that is compatible with the volume is necessary to contain the data positioning techniques used by the system's set. The last volume is organized the same standard label processing routines. The as the single data set/single volume class. operating system assumes that a tape using All other volumes are also organized in nonstandard labels is properly positioned this way with the exception of their data upon completion of a nonstandard label set trailer label groups. The EOV trailer processing routine. group appears in place of the EOF trailer

Data Set Control Facilities 17 ta (Volume 1 of 2) jo:::;>llet° Se!/Mul';ple VOlum\,~ l_~l::;I---II ______---J~ ) ~ . ::: . . First par; of Data Set l

(Volume 2 of 2)

) N :::; ;:;: u... :::; ..5 c;: 0.: ~ ~ 0 '"0 :r: 0 0 I- 0 la,! f Data Set I- ;:) :r: :r: ;:) po,~ a UJ UJ fQJJl.~~ > ~ \ UITJJ me Da", Selo/Slogle VOlumrn:r:;", J ~ ~ N ~N c N u... Set u... u... :::; ) ...J ~c;: 0.: ::i fQJJta Set ~u... :::; ~ 00 l- I- 0 :r: 1- 0 I- ;:) ;:) I-~ ;:) 2 UJ ;:) I- UJ UJ ) :r: 8 ru UlLl \ I UlL ~ \

ata Set s/M u I tip Ie Volumes (Volume 1 of 3) ) c ~ ~ N jt-, \ ~eD~ ~ :::; ...J 0.: 0.: :::; u... u... :::; ..5 ~c;: ~ :; ~ :::; '" :r: Set ~ l- 0 :r: Set ~ l- 0 0 0 00 I- 0 0 ;:) > :r: :r: ;:) ;:) I- A I- UJ UJ ;:) ) ;:) I-~ :r: ;:) ;:) I- B I- UJ UJ ~ i I~H D"7 \ ) !I~H D;'" \ I

(Volume 2 of 3) ( j c N ~ ~ ...J c;: 0.: ...J .5 :; >'" ::::i 0 0 :r: :r: ~ ~ l- 0 o 0 0 ;:) > :r: :r: ;:) ;:) I- continuatio~ \Data Set B I- UJ UJ

(Volume 3 of 3) I \ ( I \ c c Last Pc rt of ~ N c N ...J :::; ...J :::; u... c;: 0.: ...J u... u... :::; ~c;: ~ Set ~ u... :::; j 0 0 '"0 :r: :r: ~ Da ta Set ~ l- I- 0 :r: 0 0 I- 00 ;:) 1- :r: :r: ;:) ;:) I- I- UJ UJ ;:) I-~ :r: ;:) C UJ UJ ;:) ) > B ) ;:) I- ( 1 ( I ~ I~H ~'" \ Figure 4. Standard Label Formats for Magnetic Tape set. The EOV trailer group is followed by volume is required because of the amount of one tape mark. The data set and user information. The end-of-volume trailer labels are repeated on each volume, but the labels are identical to those of the single volume labels differ on each tape. data set/multiple volumes tape organiza­ tion •. Multiple Data Sets/Single Volume: Thevol­ ume begins with a volume label group. Each data set starts with a data set header label group, followed by the optional user Direct-Access Labels header label group, and a tape mark. The data set then appears, followed by a tape mark, an end-of-file trailer label group, a Only standard label formats are used on user trailer label group, and another tape direct-access volumes. Volume, data set, mark. The last data set on the volume and optional user labels are used (see differs only in that the user trailer Figure 5). In the case of direct-access labels are followed by two tape marks. volumes, the data set label group is the data set control block (DSCB). Multiple Data Sets/Multiple Volumes: This class of tape organization is similar to VOLUME LABEL GROUP: The volume label group the previous one. However, more than one immediately follows the initial program

18 Initial Volume Label -

Cylinder Additional ---~ Volume Labels Track 0 r----l ~

VTOC DSCB I--

Space Accounting t--- L DSCB

DSCB #1 VTOC

DSCB #2 Data Set Control Blocks ~- - ~ All Remaining Tracks on Volume

Blank Storage --- Area for Data Sets

Figure 5. Direct-Access Labeling loading (IPL) records on track 0 (of data set is reserved for user labels. The cylinder 0) of the volume. It consists of current minimum track size supports a maxi­ the initial volume label plus a maximum of mum of eight 80-character user labels seven additional volume labels. These (including both user header and trailer additional labels are processed by means of labels). Consequently, a program that an installation routine that is incorporat­ creates more than eight user labels becomes ed into the system. device-dependent among direct-access devi­ ces. If device independence is not DATA SET CONTROL BLOCK (DSCB): The system desired, the program may create up to eight automatically constructs a DSCB when space user header labels and eight user trailer is requested for a data set on a direct­ labels, not to exceed one track. access volume. Each data set on a direct­ access volume has a corresponding data set control block to describe its characteristics. DATA SET RECORD FORMATS USER LABEL GROUP: If ~he LABEL parameter of the DD statement indicates that user labels. are to be used, and if the program­ Data processing operations are concerned mer has requested space allocation in terms with individual data records within a data of cylinders by using CYL, SPLIT, or ROUND, set. All records of a data set must have the data set is automatically allocated one the same format. The formats of these additional track for user labels. Other­ records is the subject of the following wise, the first track allocated for the discussion.

Data Set Control Facilities 19 BLOCKS selection of a record format is based on this knowledge, as well as an understanding of the type of input/output devices that The data between interrecord gaps is are to handle the data set and of the called a block; each block can consist of access method used to read or write the one or more logical records. data set.

The record format of a data set is LOGICAL RECORDS placed into the data control block according to specifications in either the DCB macro-instruction, the DD statement, or A data set is composed of a collection the data set label. of logical records that usually have some relation to one another. The logical record is usually the basic unit of infor­ mation for a data processing program. A logical record might be, for example, eith­ Fixed-Length (Format F) er a single character, all information resulting from a given business transac­ tion, or parameters from a given point in Format F records are fixed-length an experiment. Much data processing con­ records. The number of logical records sists of reading, processing, and writing within a block (blocking factor) is normal­ individual logical records. ly constant for every block in the data set unless the data set contains truncated blocks (short blocks).

RECORD BLOCKING In unblocked format F, the logical record constitutes the block.

Blocking of records, shown in Figure 6, The system performs physical length is the process of grouping a number of checking on blocked format F records, auto­ logical records before writing them on a matically making allowance for truncated volume. Blocking improves effective data blocks. Because the channel and interrupt rate and conserves storage space on the system can be used to accomrrlodate length volume by reducing the number of interre­ checking, and the blocking/deblocking is cord gaps in the data set. In many cases, based on a constant record length, format F blocking also increases processing effi­ records can be processed faster than format ciency by reducing the number of v. input/output operations required to process a data set. A sequential data set is said to have records in standard F format if all the records in the data set are in F format, if each track except the last is filled to RECORD FORMATS capacity, and if no blocks besides the last are truncated. Standard F data sets can be read from direct-access devices more effi­ Logical records may be in one of three ciently than data sets with truncated formats: fixed-length (format F), variable­ blocks, because the system can predict the length (format V), or undefined (format u). location of each block to be read. The prime consideration in the selection Format F records are shown in Figure 7. of a record format is the nature of the The optional control character (C), used data set itself. The programmer knows the for stacker selection and carriage control, type of input his program will receive and may be included in each logical record to the type of output it will produce. His be printed or punched.

Inter - logical logical logical Inter - Logical Logical Logical Inter - Record Record Record Record Record Record Record Record Record ~ Gap E F G Gap H I J Gap ) Block Block

Figure 6. Blocked Logical Records

20 Logica I Record data set is written. Both input and output c Data buffer areas must be large enough to accom­ modate the additional four bytes.

Blocked Records In unblocked format V, one logical record and the block control information Logica I Logica I Logica I constitute the block. Record Record Record

------Fixed Length ------The initial eight bytes (nine if the optional control character is specified) of the block are not printed or punched. The Unblocked Records use of these eight bytes for any purpose other than that specified in this section Logica I Record may cause unpredictable results. ------Fixed Length ------Figure 7. Format F Records Undefined (F'ormat u) Variable-Length (Format V) Format U is provided to permit the processing of any blocks that do not con­ Format V provides both for variable­ form to the F or V formats. Format U length records, each of which describes its records are shown in Figure 9. The option­ own length, and for variable length blocks al control character (C) may be used in of such records, each of which includes a each logical record. block length. The system performs length checking of the block and makes use of the since each block is treated as a logical record length information in deblocking and record (unblocked), any deblocking must be blocking. Format V records are shown in accomplished by the user's program. The Figure 8. The first four bytes of the system does not perform length checking on logical record contain control information: format u records. For this reason, a 'II' represents the length of the logical program can be designed to read less data record and 'bb' represents the two bytes into main storage than is actually con­ reserved for system use. These bytes must tained in a block. be provided by the user when he is creating the record. The optional control character (C) may be specified as the fifth byte of each logical record. Logica I Record

Blocked Records Data ------LL ------c

Logical Logical Logical Record Record Record Fonna t U Record

...... ~ Logica I Record ~ Logical Record ~ Figure 9. Format U Records I n I bb I c I Data I I----ll-----~ ~ CONTROL CHARACTER I Unblocked Records ~

LL bb Logical Record I I The programmer may optionally specify, ------LL ---- in the DD statement or the DCB macro­ instruction, that a control character is Figure 8. Format V Records part of each logical record in a data set. This character specifies carriage control when the data set is printed or stacker In format V, ILL' represents the block selection when the data set is punched. length and 'bbl represents the two bytes The character itself is never printed or reserved for system use. With the punched but is a part of the record in exception of the basic sequential and the storage. Buffer areas must be large enough basic direct access methods, these charac­ to accommodate this character (byte). If ters are automatically provided when the the immediate destination of the record is

Data set Control Facilities 21 a device that does not recognize this are read or written in the same order in control character, e.g., disk, the system which they appear. For example, the fourth assumes that the control character is the record of the data set in Figure 10 normal­ first byte of the data. ly is read only after the first three records have been read. If the data set is If the destination of a record is a stored on more than one volume, each volume printer or a punch and the user has not must be of the same device type. Automatic specified that the first byte of the data volume switching is provided by the system. is to be used as a control character, this Individual records cannot be deleted or byte is simply treated as the first byte of inserted unless the entire data set is the data. rewritten. This organization is generally used for a data set most of whose records are processed each time the data set is used. DATA SET ORGANIZATIONS

Data set organization refers to the Space Allocation for Sequential Data Sets physical arrangement of data set records. To give the programmer maximum flexibility and efficiency in reading and writing data The programmer must request space for sets, the operating system provides five sequentially organized data sets that are types of data set organization: to be written on direct-access volumes. If the programmer is uncertain of the amount of space required by a particular data set, 1. Sequential. he can ensure sufficient space by speci­ 2. Partitioned. fying the secondary quantity subparameter 3. Indexed sequential. of the SPACE parameter of the DD statement. 4. Direct. This subparameter indicates an amount of 5. Telecommunications. space to be allocated if the original space allocated to the data set is exhausted and more data is to be writtep. This addition­ Only sequential organization can be used al space is allocated as required from the for data sets on magnetic tape volumes, volume(s) assigned to the data set. The unit record equipment, and paper tape. programmer can also release any space that he does not use by specifying the RLSE The most desirable data organization for subpararneter in the SPACE parameter. a given data set depends on how the data set is to be used. The organization determines, to a great extent, the access methods that can be used with the data set. The programmer specifies the organization PARTITIONED ORGANIZATION of a data set in the DCB macro-instruction. The data set organizations are described in the following sections. A partitioned data set is one that is divided (partitioned) into sequentially organized members made up of one or more records. All members have identical pro­ perties, such as record formats, block SEQUENTIAL ORGANIZATION length, options selected, etc. Each member of a partitioned data set has a unique simple name that does not exceed eight A sequential data set is one whose characters in length. Records of any given records are organized solely on the basis member are retrieved or stored successively of their successive physical positions in according to physical sequence. the data set. As indicated in Figure 10, the records exist sequentially within the The main advantage of a partitioned data volume space allocated to the data set and set is that it gives the programmer the

Record Record Record Record Record Record Record Record 1 2 3 4 5 6 7 8

Figure 10. A Sequentially Organized Data Set

22 ability to retrieve individual members, Space Allocation for Partitioned Data Sets once a single data control block is opened. For example, a library of subroutines might be a partitioned data set whose members are When the programmer requests the amount the subroutines; within each subroutine, of space to be allocated to a partitioned records are sequentially organized. Indi­ data set, he also specifies the amount of vidual members may be added or deleted as space required for the directory. If the required. A partitioned data set must storage space specified by the programmer reside on one direct-access volume. for the members is filled, additional space for new members is dynamically allocated by specifying the secondary quantity subparam­ eter of the SPACE parameter of the DD statement. The programmer can release any Directory space that he does not use by specifying the RLSE subparameter. If the space for the directory is filled, however, no new Each member of a partitioned data set is members can be added to this data set. associated with an entry in a series of Once allocated, space for the directory records at the beginning of the data set cannot be expanded. The data area occupied called a directory. As indicated in Figure by deleted or replaced members of a parti­ 11, the directory contains the name, and tioned data set is not reusable until a corresponding position within the data set, COpy PDS statement is executed to copy the of every existing member. Optionally, the remaining members of the data set onto the programmer can place up to 62 characters of same or a different volume. The COpy PDS additional information into an entry. statement, a utility program control state­ Directory entries are maintained in order ment, is described in the publication IBM of collating sequence of member names. systern/360 Operating System: utilities. --- To provide location independence, the system records the track address of a member as a relative track within the data set rather than as an absolute track INDEXED SEQUENTIAL ORGANIZATION address. This allows an entire data set to be moved without a change in relative track addresses. The first track of a data set An indexed sequential data set is one is relative track 0, the second is relative whose records are organized on the basis of track 1, etc. Thus, the data set can be a collating sequence determined by keys considered as one continuous set of data that precede each block of data. The key tracks regardless of how the space has for each block of data is 1-255 bytes in actually been allocated. length and is identical to the key of the

Directory Entry for Entry for Entry for Entry for Member A Member B Member C Member K

Space from Deleted Member

Available Area

Figure 11. A Partitioned Data Set With Four Members

Data Set Control Facilities 23 last record in that block. An indexed indexes that are part of the data set. sequential data set exists in space allo­ There are two types of indexes: a cylinder cated on direct-access volumes as prime index for the whole data set and a track areas, overflow areas, and indexes. index for each cylinder. An entry in a cylinder or track index contains the iden­ Indexed sequential organization gives tification of a specific cylinder or track the programmer much flexibility in the and the highest key that is on that cylin­ operations he can perform on a data set. der or track. The system locates a given He has the ability to: record by its key after a search of a cylinder index and a tra~k index within • Read or write (in a manner similar to that cylinder. that for sequential organization) logi­ cal records whose keys are in ascending collating sequence. Master Index • Read or write individual logical records whose keys are in any order. Reading records in this manner is some­ If a data set occupies many cylinders, a what slower per record than reading serial search of the cylinder index for a according to a collating sequence, key is inefficient. The programmer can because a search for pointers in index­ cause a master index to be created that es is required for the retrieval of indexes the cylinder index, as shown in each record. Figure 12. A master index will be con­ structed only if the cylinder index occu­ • Add logical records with new keys. The pies more than one track. The programmer system locates the proper position in specifies in fields of the data control the data set for the new record and block that, if the size of a cylinder index makes all necessary adjustments to the exceeds a certain number of tracks, a indexes. master index should be created. Each entry in the master index points to a track of the cylinder index. If the size of the Indexes master index exceeds the number of tracks specified in the data control block, the master index is automatically indexed by a The ability to read and write records higher level master index. Three such from anywhere in a data· set with indexed higher level master indexes can be con­ sequential organization is provided by structed.

Cylinder 2 Cylinder 3 Cylinder N

Area Track 5 ~~~r---~----~------~ Track 4 T ~~--~~--~----~----~ Prime Track 3 Data ~~~~~~~~----~--~ Track 2 Area ~--~~~~--~~--~r-~ Track 1 Track Index

Master Index

Figure 12. Index Structure for an Indexed Sequential Data Set

24 Insertion of Records Initial Format of Data Set Prime Track 1 2 3 4 5 8 10 11 A new record added to an indexed sequen­ tial data set is placed into a location on Prime a track determined by the value of its key 12 13 16 field. If records were inserted in precise Track 2 physical sequence, insertion would require shifting all records of the data set with Overflow keys higher than that of the one inserted. Track 1 However, because an overflow area exists, indexed sequential data organization allows a record to be" inserted into its proper Format of Data Set after Insertion of Record 7 position with only the records on the track Prime in which the insertion is made being shift­ Track 1 2 3 4 5 8 10 ed. II

Prime Track 2 12 13 16

Overflow 11 Overflow Area Track 1

In addition to the prime area, whose tracks initially receive records of an Format of Data Set After Insertion of Records 17 -22 and Record 9 Prime indexed sequential data set, there is an 2 3 4 5 7 8 overflow area for records forced off their Track 1 I I I I I I III original tracks by the insertion of new records. When a record is to be inserted, Prime the records already on the track that are Track 2 I 12 I 13 I 16 to follow the new record are written back .. on the track after the new record. If the addition of records results in insufficient Overflow Track 1 11 ,. 10 track space for all the records to be I written onto the track, the records that do not fit are written onto an overflow track. Figure 13. Addition of Records to a Track index entries are adjusted to indi­ 1-Cylinder, 3-Track Indexed cate records on an overflow track. Figure Sequential Data Set 13 illustrates this adjustment for addition of records to an indexed sequential data set whose keys are in a numerical collating Two types of overflow areas may be sequence. requested by the programmer. He can request a cylinder overflow area that pro­ When this data set is created, its vides a certain number of tracks on each records are placed on the prime tracks in cylinder to hold the overflow of that the storage area allocated tp the data set. cylinder. He can also request an indepen­ If a record, e.g., record 7, is to be dent overflow area that provides a certain inserted into the data set, the indexes number of tracks independent of the rest of indicate that record 7 belongs on prime the data set, perhaps even on a different track 1. Record 7 is written immediately volume. following record 5, and records 8 and 10 are retained on prime track 1. Since The programmer may mark records for record 11 no longer fits on this track, it deletion. If a marked record is forced off is written on an overflow track and the its original track by the insertion of a proper track index is adjusted to show that new record, then this record is not written the highest key on prime track 1 is 10 and in an overflow area and is thereby deleted that overflow records exist. When records from the data set. 17 through 22 are added, prime track 2 receives- records 17 to 21, but record 22 does not fit and is written following record 11 on the overflow track. When Space Allocation for Indexed Seguential record 9 is inserted, record 10 is shifted Data Sets to the overflow track after record 22. Note that records 10 and lion the overflow track are chained together to show their Only the ABSTR or the CYL subparameter logical sequence and to indicate that they of the SPACE parameter of the DD statement belong on the same prime track. can be used when allocating space for an

Data Set Control Facilities 25 indexed sequential data set. All requests ing of the data set), the programmer must be for an integral number of cylin­ should prepare a DD statement for the ders. prime area. In the directory quantity subparameter of the SPACE parameter of The storage area allocated to an indexed this statement, the programmer should sequential data set must be sufficient to specify how much of the prime area is include all space required for prime, to be used for index purposes. An index, and overflow purposes. The proce­ additional DD statement requesting a dures to be followed in allocating this separate index area should not be pre­ space differ, depending upon the pared. The programmer may, however, programmer's index location requirements, use a DD statement requesting space for and his need for an independent overflow an independent overflow area. area: • To develop an index area at the end of • Space for the prime area can be allo­ the prime area, the programmer should cated on more than one volume, but each prepare a DD statement requesting prime volume must be of the same device type. area space that does not contain an embedded index area. The space • Space for a separate index area can be requested for the prime area must be allocated on a volume and device type large enough to include an index area. different from that of the prime area, Additional DD statements requesting if the prime area is on an IBM 2321 space for a separate index area and for Data Cell Drive. an independent overflow area should not be used. • Space for an independent overflow area can be allocated on a separate volume • To develop an index area as part of an of the same device type as that of the independent overflow area, the program­ prime area. mer should prepare two DD statements: one to allocate space for a prime area that does not contain an embedded index Basically, there are four space alloca­ area, and one to allocate space for an tion techniques, each causing the index independent overflow area. The space area to be allocated differently~ Note requested for the overflow area must be that for those techniques requiring more large enough to include an index area. than one DD statement, only the first An additional DD statement requesting a statement may contain a symbol in its name separate index area should not be pre­ field. The programmer must indicate the pared. type of area for which space is to be allocated by specifying either (INDEX), (PRIME), or (OVFLOW) as the element portion of the DSNAME parameter of the DD state­ DIRECT ORGANIZATION ment. If no element name is provided, (PRIME) is assumed. If a DD statement specifying (INDEX) is used, it must precede A direct data set is one whose blocks a DD statement specifying (PRIME). If a DD are organized on a direct-access volume in statement specifying (OVFLOW) is used, it any manner chosen by the programmer. If must follow a DD statement specifying the data set is to be stored on more than (PRIME). one volume, each volume must be of the same device type. When a request to store or One technique for allocating space is to retrieve a block is made, either an address prepare a separate DD statement for each relative to the beginning of the data set type of area required. If in addition to or an actual address (i.e., device, cylin­ the prime area, for example, the programmer der, track, block position) must be fur­ requires a separate index area and an nished. This address can be specified as independent overflow area, three DD state­ being the address of the desired block or ments should be prepared. as a starting point within the data set where the search for the block is to begin. If the programmer does not require a When a block search is specified, the separate index area, he can cause the index programmer must also furnish the data key area to be embedded within, or placed at (e.g., part number, customer name) that is the end of, the prime area, or to be placed associated with the desired block. at the end of an independent overflow area using one of the following three techniques for allocating space: Insertion of Blocks • To develop an index area embedded with­ in the prime area (in order to reduce With direct organization, the programmer access arm movement during the process- can indicate, without specifying a particu-

26 lar block position, a track on which a optionally, a data set label. The system bleck is to be written. The block is stores information from the DD statement in simply written into the first available a control block called the job file control space on the track. Figure 14 illustrates block (JFCB). The JFCB is placed in a job a data set with format V or U blocks that queue on a direct-access volume when the have been distributed over allocated tracks job associated with it is scheduled for according to an "item number" recorded in a execution. The following sections discuss key field with each block. If items 10, the data control block and the procedures 21, and 50 are to be inserted into this followed by the programmer to define data data set and the track selection algorithm sets. indicates that they belong on relative tracks 0, 1, and 2, respectively, these blocks are placed on the proper tracks after the existing blocks. DATA CONTROL BLOCK

A data control block is a group of TELECOMMUNICATIONS ORGANIZATION contiguous fields in the user's assembled program that provide information about a data set to the system for scheduling and A description of the facilities for executing input/output operation~, The telecommunications is given in the publica­ fields describe the characteristics of a tion IBM System/360 Operating System: Tele­ data set (e.g., data 'set organization) and communications, Form C28-6553. its processing requirements (e.g., number of buffers required for input/output operations). By issuing a DCB macro­ instruction, the programmer requests that a DATA SET DEFINITION data control block be constructed at assembly time. Subsequently, several sour­ ces can be used to enter information into Before a data set can be made available the data control block fields. The process to a problem program, the system requires of filling in the data control block is that descriptive information defining the completed at execution time. data set be placed into a data control block. Sources of information for the data This information may come from the DCB control block are the DCB macro­ macro-instruction itself, from the JFCB, or instruction, the DD statement, and, from the data set label. Only unspecified

Relative Track 0

Relative. Item Item Item Track 1 20 38 39

Relative Item Track 2 41

Data Set after Insertion of Blocks

Item Item Item 20 38 39

Figure 14. Addition of Blocks to a Direct Data Set

Data Set Control Facilities 27 fields can be filled from each source. For Job File Control Block example, if a field is specified in both the DD statement and the data set label, only the information for that field which At the time a data control block is is supplied by the DD statement is used for opened, information is transferred into the the data control block; the corresponding JFCB. The portion of this transfer of information in the data set label is information that pertains to completing the ignored. However, the programmer can write data control block is illustrated by line 2 routines that modify any data control block in Figure 15. After the data control block field. In Figure 15, lines 1 to 4 indicate has been completed, further modification of the sequence in which the sources of infor­ the JFCB is possible as illustrated by mation for the data control block are used. lines 4 and 5 in Figure 15. Once the JFCB Solid lines indicate required sources, and has been modified, it remains so until it dotted lines indicate optional sources. is no longer needed by the system.

The above transfer of information is ·part of a procedure called opening a data Data Set Label control block. Opening a data control block for a data set makes that data set available to a problem program. Closing A data set label can be generated in the data control block disconnects that secondary storage when a data set is creat­ data set from the problem program. (Two ed. The source of information for a data macro-instructions, OPEN and CLOSE, are set label is the updated JFCB, as indicated provided to perform these operations.) by line 6 of Figure 15. Thus, a completed data control block may exist only during program execution. Data set labels facilitate subsequent references to a data set. Any charac­ There is usually a one-to-one correspon­ teristics of a data set defined in a data dence between data sets and opened data set label need not be redefined in a DCB control blocks. Normally, one data control macro-instruction or in a DD statement. block should be opened for one particular data set. However, concurrently opening CO~~LETING THE DATA CONTROL BLOCK, JFCB, more than one data control block for the AND DATA SET LABEL: Figure 15 illustrates, processing of the same data set is not by lines 1 through 6, the steps that the prohibited for direct-access operations. system takes to fill fields of the data (It is prohibited for tape operations.) control block, the JFCB, and the data set label. The following paragraphs describe Caution: If the programmer opens more than each of these steps in sequence. one data control block for the same data set, he must be aware of the implications Line 1 indicates that the data control of this procedure and exercise caution with block is initially created by the DCB respect to such items as multivolume data macro-instruction; this normally occurs at sets, secondary allocation, volume posi­ assembly time. Prior to issuing the OPEN tioning and the dependence of certain macro-instruction, the data control block macro-instructions upon positl..oning, and can be moved, copied, or modified by the label processing. problem program.

Data Programmer's Control Modification Block ---0--- Routine (DCB Exit Routine)

Existing Job File New Data Set 6 Data Set Label --0-- Label

Figure 15. Flow of Information To and From Data Control Block

28 Line 2 indicates that, for direct-access • Symbolic name of the DD statement that devices and labeled tape input, an existing identifies the data set. data set label is read by the OPEN routines and used to fill empt.y fields in the JFCB. • Data set organization. The data set label contains fields describ­ ing data attributes, e.g., block size and • Record format. record format. (This step does not occur for unit record devices, unlabeled tape, or • Principal macro-instructions to be used tape out put. ) for input/output operations on the data set. The JFCB has, in addition to data attri­ bute fields, fields that contain informa­ • Options to be selected. tion related to processing, e.g., number of buffers to be used and error options that • Number and size of buffers. were chosen. Line 3 indicates that, at this point, the JFCB is used to fill any empty fields in the data control block. Particular organizations may require Both data attribute fields and processing­ such supplementary specifications as: related fields can be filled. Line 4 indicates that the problem • Tape density (sequential organization). program's data control block exit routine, if present, is entered. This routine can • Number of tracks in cylinder overflow either fill any data control block fields area (indexed sequential organization). that are still empty or modify other fields in the data control block. It then issues • Address of area containing terminal a RETURN macro-instruction to return to an address (telecommunications OPEN routine. organization) •

Line 5 indicates that after the OPEN • Number of tracks or blocks to be routines prepare the problem program to searched for a block (direct access the data set, any empty fields in organization) • the JFCB are filled from the data control block. Both data attribute fields and processing-related fields can be filled. In addition to information regarding data set characteristics and processing Line 6 indicates that for output on requirements, the programmer can specify direct-access volumes, the JFCB is used to certain addresses in the DCB macro­ fill any empty fields in the data set instruction. These addresses identify: label, and for output on labeled tape volumes. the JFCB is used to construct a • The location of a routine that performs new data set label. Only data attribute end-of-data set procedures. fields are used. • The location of a routine that When the data control block is closed, supplements the system's error recovery all information that entered it from either routine. the JFCB or the data set label is removed. The JFCB is not returned to its original • The location of an exit list. condition.

The following sections briefly describe the items listed above. DCB -- Define Data Control Block END-OF-DATA SET ROUTINE: For data sets that are read sequentially, the programmer must write an end-of-data set routine that The DCB macro-instruction reserves space performs any desired final processing. for a data control block at assembly time and causes specified fields describing data SYNCHRONOUS ERROR EXIT ROUTINE: This rou­ set characteristics and processing tine supplements the system's error recov­ requirements to be placed into that data ery routine. To analyze exceptional condi­ control block. The number of fields that tions and uncorrectable errors, the pro­ can be specified in this macro-instruction grammer may write a routine that is entered depends upon the organization of the asso­ if an input/output operation ends abnormal­ ciated data set. The fields that may be ly. specified which are common to all data set organizations (except telecommunications) EXIT LIST: The exit list can contain the provide the following types of information: addresses of routines that process user

Data Set Control Facilities 29 labels, the address of a routine that block length, and addresses of user exit modifies the data control block, and routines. The programmer also might use a checkpoint information. Complete details data control block exit routine to deter­ on exit lists are in the publication IBM mine data set characteristics by examining System/360 Operating System: Control Pro­ fields filled by data set labels. The data gram Services. The following sections des­ control block exit routine must return cribe the three types of entries in the control to OPEN (by means of a RETURN exit list. macro-instruction). To assist the program­ mer in modifying a data control block, the Standard User Label Exit Routines: With system provides a DCBD macro-instruction, sequential organizations, the programmer which is described in the publication IBM may write routines for user labels that: System/360 Operating System: Control prQ= gram Services. • Verify user header labels (UHL1-S). Address of Checkpoint Data Control Block: • Verify user trailer labels (UTL1-S). If an automatic checkpoint is to be taken • Create user header labels (UHL1-S). during end-of-volume processing, the pro­ • create user trailer labels (UTL1-S). grammer specifies the address of the data control block for a checkpoint data set. After verification or creation of any user label, the routine returns control to the system (by means of a RETURN macro-instruction) with an indication of DD statement/DCB Macro-Instruction whether another user label is to be read or Relationship written.

If the programmer does not wish to For ease and flexibility in filling data verify all existing user labels, automatic control block fields, the programmer should repositioning takes place. use the DCB macro-instruction to specify information that remains constant for all Data Control Block Exit Routine: To change data sets, using a given data control fields in the data control block after it block, that are to be processed by the has been filled, or to add optional infor­ associated program. Since a different DD mation, the programmer writes a routine statement can be inserted each time the (see Figure 15) that is entered when the data set is processed, the programmer data control block is opened. Among the should place into the DD statement the fields that may be modified by such a information about the data set that may routine are those for buffering technique, vary each time the program is used.

30 DATA ACCESS METHODS

Corresponding to the wide range of sys­ instructions to fill or empty buffers. The tem facilities available for control of system automatically sets up the requested data is an equally wide range of facili.ties number of buffers, and provides overlap of for access to that data. The variety of input/output operations with CPU processing techniques for gaining access to a data set by automatically filling or emptying is derived from two variables: data set buffers at the earliest possible times. organization and macro-instruction lan­ Therefore, ffiore than one input block nor­ guage. Data set organizations have been mally is in main storage at the same time discussed previously; the macro-instruction to prevent input/output operations from languages are discussed in this section. delaying record processing.

With automatic synchronization of input and output with processing, the programmer MACRO-INSTRUCTION LANGUAGES need not test for completjon of input/output operations, input/output errors, or exceptional conditions. After a The programmer requests input/output GET or PUT macro-instruction is issued, the operations on data sets through macro­ system does not return control to the instructions that are divided into two problem program until an input area is categories or languages: the language for filled, or an output area is available. basic access and the language for queued Exits to error correction and end-of-volume access. Each language is identified or end-of-data set procedures are automat­ accordiDg to its treatment of anticipatory ically taken when the corresponding condi­ buffering and input/output synchronization tion occurs. with processing. The combination of a language (and an associated set of facili­ ties for the storage and retrieval of a data set) and a given data set organization is called an access method. In choosing an access method for a data set, therefore, the programmer must consider not only its organization, but also the macro­ LANGUAGE FOR BASIC ACCESS instruction language capabilities. The in­ line code generated by the macro­ instructions for both languages is The language for basic access provides optionally reenterable, depending only upon the READ and WRITE macro-instructions for the form in which parameters are expressed. transmission of data between main and sec­ A discussion of each language and its ondary storage. Although anticipatory buf­ characteristics follows. fering and input/output synchronization with processing are not provided automat­ ically by the system, the programmer can perform and control these functions. LANGUAGE E'OR QUEUED ACCESS Buffers may be allocated by either the system or the programmer. Each buffer is filled or emptied when a READ or WRITE The language for queued access provides macro-instruction is addressed to it. the GET and PUT macro-instructions for transmission of data between main and sec­ Because the macro-instructions that ondary storage. These macro-instructions request data transmission only initiate cause automatic blocking and deblocking of input/output operations, the programmer the logical records they store and cannot assume, after issuing a READ or retrieve. Anticipatory buffering and syn­ WRITE macro-instruction, that the opera­ chronization of input and output with CPU tions are completed or that appropriate processing are two distinctive automatic exits are taken. To test for completion of features of the queued language. input/output operations and for errors and exceptional conditions, the programmer System-controlled anticipatory buffering interrogates, either directly or through a permits the programmer to use as many input macro-instruction, the fields of a main or output buffers as he needs without storage area called a data event control issuing multiple GET or PUT macro- block.

Data Access Methods 31 Data Event Control Block (DECB) Table 1. Data Access Methods r------T------, I I Macro-Instruction I A data event control block (DECB) is a I Data Set I Language I main storage area, reserved by either the I Organization ~------T------~ programmer or the system, that relates an I I Basic I Queued I input/output operation to a specific READ ~------+------+------~ or WRITE macro-instruction. Each READ or I Sequential I BSAM I QSAM I WRITE macro-instruction requires one data I Partitioned I BPAM I I event control block that contains control IIndexed sequential I BISAM I QISAM I information and pointers to status indica­ I Direct I BDAM I I tors. The programmer waits for completion I Telecommunications1 I BTAM I QTAM I of the input or output operation and tests ~------~------~------~ for successful completion by issuing 11 QTAM and BTAM are described in thel appropriate macro-instructions. After the Ipublication IBM System/360 Operating sys-I input/output operation requested by a READ lItem: ______Telecommunications. JI or WRITE macro-instruction is completed, a subsequent READ or WRITE macro-instruction may use the same data event control block. EXECUTE CHANNEL PROGRAM (EXCP) ACCESSING Fields of the data event control block PROCEDURE may be defined as parameters of the corres­ ponding READ or WRITE macro-instruction and stored by the system, or may be filled in The system provides for scheduling and directly by the programmer. Once a param­ queuing of input/output requests, efficient eter is placed into the data event control use of channels and devices, data protec­ block, it need not be redefined by subse­ tion, interruption procedures, and error quent READ or WRITE macro-instructions recognition and retry. Through the EXCP unless its value is to be changed. (execute channel program) macro-instruc­ tion, the programmer can utilize these system functions to control directly an input/ou"ti'ut device for access of any data set organization, without using a specific access method or language for access.

CLASSIFICATION OF ACCESS METHODS When using EXCP, the programmer provides a channel program, which is a list of channel command words appropriate to the As previously stated, an access method desired device and operation. The program­ results from the integration of a language mer also provides an input/output control and an associated set of facilities for block (lOB) that is used with the channel storing and retrieving a data set of a program to maintain status information given organization. Access methods can be regarding completion of the operation. If identified primarily by the data set orga­ an input/output error results from an EXCP nizations to which they apply. For exam­ macro-instruction, use of the system's ple, a combination of sequential organiza­ standard error recovery procedures depends tion with either language is termed a on the complexity of the channel program. sequential access method (SAM). A particu­ lar access method, however, requires furth­ The EXCP macro-instruction gives the er qualification as either queued or basic. prograffimer more freedom in controlling Thus, the access method that uses the devices than do the access methods, yet macro-instructions for queued access for retains many of the advantages of working operations on sequentially organized data with the operating system. To use EXCP is called the queued sequential access successfully, however, the programmer needs method (QSAM). detailed knowledge of device control, sys­ tem functions, and control block structure. Table 1 identifies each available data For example, a programmer using a direct­ access method as a combination of a lan­ access device with EXCP must be familiar guage and a data set organization. with the techniques and control blocks required for control of secondary storage; Various access methods may, in many control of magnetic tape with EXCP requires cases, be used with the same data sets. an understanding of how volume switching is For example, a given data set might be initiated. defined to have a partitioned organization for one purpose, and a sequential organiza­ Any device controlled with EXCP must be tion for another, and thus might be supported by corresponding device-dependent retrieved or stored by QSAM, BSAM or BPAM. programs and input/output error routines in

32 the system. For devices not supported by continued at a later stage in the problem the system, the installation must supply program without the programmer having to appropriate programs to be included in the reissue an OPEN macro-instruction. If a operating system when it is generated. data set is to be processed more than once Further details about EXCP are in the by a problem program, the programmer can publication IBM System/360 Operating improve performance by issuing the CLOSE System: System Programmer's Guide, Form (TYPE=T) macro-instruction. C28-6550. For a data set to be processed, the programmer must issue an OPEN macro­ OPEN AND CLOSE MACRO-INSTRUCTIONS instruction to initialize the associated data control block. If the programmer does not close a data control block with a CLOSE Before applying an access method to a macro-instruction, the system automatically data set, the programmer must request that closes it when the task terminates if the a data control block be completed as a data control block is available to the logical connection between the data set and system at this time. If it is not, the the problem program. The programmer issues task is abnormally terminated. an OPEN macro-instruction that completes the data control block fields, establishes An OPEN or a CLOSE macro-instruction may address relationships and linkages to be addressed to more than one data control access routines, issues mounting messages block. Opening or closing several data to the operator, verifies or creates data control blocks is faster than issuing a set labels, interrogates tape volume separate OPEN or CLOSE macro-instruction labels, positions volumes to the first for each data control block, but the latter record to be processed, allocates buffer technique uses less main storage space than pools as required, and begins filling buf­ the former. The amount of main storage fers for data sets to be read using the space required for the OPEN and CLOSE queued sequential access method. routines is directly proportional to the number of data control blocks being To accomplish these functions, the rou­ processed; a portion of this space is used tine that is executed as a result of the only when the OPEN or CLOSE routines are in OPEN macro-instruction requires access to operation and is released before control is information that the programmer supplies in returned to the problem program. a DD statement. As previously described, this information is stored in a JFCB. The execution of the OPEN macro-instruction Use of OPEN and CLOSE causes the system to read the appropriate JFCB from a job queue into main storage for processing by the OPEN routine. The JFCB The programmer specifies, in the OPEN is then returned to the job queue for macro-instruction, the intended use of a subsequent use by other system functions. data set. The functions of the OPEN and CLOSE routines vary according to the use of After input/output operations on a data the data set by the problem program. set have terminated, the programmer logi­ cally disconnects the data set from the Table 2 summarizes, for each applicable problem program by issuing a CLOSE macro­ access method, every data set use (mode) instruction. This macro-instruction closes that may be specified in the OPEN macro­ the data control block, handles volume instruction, and the representation of each dispositions, creates data set labels, use as a parameter value. The modes are ensures the writing of queued output buf­ ignored for the queued indexed sequential fers, and relinquishes main and secondary and the basic indexed sequential access storage. After a data control block has methods. been closed, it may be used for another data set. The programmer also specifies, as a parameter value, volume pOSitioning for For a data set that is to be processed end-of-volume conditions in the OPEN macro­ by the basic sequential access method, the instruction, volume positioning for end-of­ system provides a variation of the CLOSE data set conditions in the CLOSE macro­ macro-instruction, CLOSE (TYPE=T). In exe­ instruction, and data set repositioning in cuting this macro-instruction for data sets the CLOSE (TYPE=T) macro-instruction. on magnetic tape or direct-access volumes, the system processes labels and repositions For each access method, positioning is vol urnes as required., but does not logically specified as either of the following: disconnect the data set from the problem program. As a result, the processing of a • LEAVE - leave the volume positioned at data set for which a CLOSE (TYPE=T) macro­ the logical end of the portion of the instruction has been issued can be data set just read or written on that

Data Access Methods 33 volume. (The logical end is either the portion of the data set, with one end or the beginning of this data set exception: repositioning for CLOSE (TYPE=T) portion, depending on whether forward is to a point within the data portion. or backward reading is used for an input data set.) Volume disposition specified in the OPEN or CLOSE macro-instructions can be overrid­ • REREAD reposition the volume at the den by the system depending upon the logical beginning of the portion of the availability of devices at a particular data set just read or written on that time. However, the problem programmer need volume. not be concerned when this situation aris­ es, because the system automatically Either option causes pOSitioning to a requests the mounting and dismounting of point outside of the data (and label) the appropriate volumes.

Table 2. Data Set Uses Specified in OPEN Macro-Instruction r------T------, I OPEN I I I Parameter I Data Set Use I I Value1 I I ~------~------~ IQueued Sequential Access Method (QSAM) I ~------T------~ I INPUT IData set is read forward sequentially. Labels are processed as input. I I OUTPUT IData set is written sequentially. Labels are processed as output. I IRDBACK IData set on magnetic tape is read backwards sequentially. Labels arel I Iprocessed as input. I IUPDAT IData set on direct-access volume is read sequentially and can be updated-in-I I Iplace by output requests that write back to the data set the last record I I Iread. Labels are processed as input. I ~------~------~ IBasic Sequential Access Method (BSAM) I ~------T------~ I INPUT IData set is read sequentially either forward or backward (depending on READ I Imacro-instruction operand). Labels are processed as input. I OUTPUT Data set is written sequentially. Labels are processed as output. IRDBACK Data set on magnetic tape is read sequentially either forward or backward I (depending on READ macro-instruction operand). Labels are processed as I input. IUPDAT Data set on direct-access volume is read sequentially and can be updated-in- I place by output requests that write back to the data set the last record I read. Labels are processed as input. IINOUT Data set on magnetic tape or direct-access volume is read sequentially. I Labels are normally processed as input. If records have been written to the I data set, subsequent labels are processed as output. The volume is I repositioned, and the data control block remains open so that the data set I can be processed again as output. IOUTIN Data set is written sequentially on magnetic tape or direct-access volume. I Labels are processed as output. The volume is repositioned, and the data I control block remains open so that the data set can be processed again as I input. ~------~------~ I Basic Direct Access Method (BDAM) I ~------T------~ I INPUT IData set on direct-access volume is read. I I OUTPUT I Data set is written on direct-access volume. OUTPUT is treated as if UPDATI I Iwere specified. I IUPDAT IData set on direct-access volume is read or written. Blocks can bel I lupdated-in-place or added to the data set. I ~------~------~ I Basic Partitioned Access Method (BPAM) I ~------T------~ I INPUT IData set on direct-access volume is read sequentially. I 1OUTPUT IMembers of data set are written sequentially on direct-access volume. I ~------~------~ 11Ifl ______a parameter value is not specified, INPUT is assumed. JI

34 BUFFERS AND BUFFER POOLS When the data control block of the data set using the pool is closed, the pool area can be reused as required. The programmer, A buffer is a main storage area used for however, will frequently find it useful to intermediate storage of input/output data. restructure this area (by issuing another Usually its size corresponds to the size of BUILD macro-instruction) into a new buffer the blocks in a data set using the buffer. pool to be assigned to another data set. The part of a buffer which contains a logical record is called a buffer segment. The area reserved for use as a buffer A buffer pool is a group of buffers pool can be assigned to two or more data connected so that a data set associated sets that are able to use buffers of the with the pool can be used with any of the same length. If this is done, the area available buffers. should be large enough to accommodate the total number of buffers that will be The programmer can construct a buffer required at anyone time during program pool using either of the two techniques execution. For example, if two data sets discussed in the following text. These to be processed simultaneously require five techniques are common to all access methods buffers each, the size of the area speci­ and must be used prior to opening the data fied should be ten buffer lengths. control block of the data set (or during the optional data control block exit routine). However, each access method pro­ vides additional facilities for automatic buffer pool construction when a data con­ OBJECT TIME BUFFER POOL CONSTRUCTION trol block is opened if neither technique is used. (These facilities and the proce­ dures for obtaining individual buffers from When a programmer does not want to a pool are discussed in detail under reserve a specific area for use as a buffer "Buffering Considerations" in the sections pool, he can request the system to obtain of this publication describing the indivi­ and structure an appropriate area in main dual access methods.) storage by issuing a GETPOOL macro- instruction.

ASSEMBLY TIME BUFFER POOL CONSTRUCTION GETPOOL -- Get a Buffer Pool When the programmer knows at assembly time both the number and size of the The GETPOOL macro-instruction structures buffers he wants to associate with a given a main storage area obtained by the system data set or data sets, he can reserve an into a buffer pool, and assigns that area area of appropriate size to be subsequently to a data control block associated with a used as a buffer pool. During execution of specific data set. a problem program, he can structure this area into a buffer pool by issuing a BUILD The address of the data control block, macro-instruction. Any type of area, from the number of buffers required in the pool, a storage area defined by the programmer and the byte length of each buffer in the prior to execution time to an area contain­ pool must be specified in the GETPOOL ing coding that is no longer required, can macro-instruction. be structured into a buffer pool. In many applications, single- or double­ word alignment of a block within a buffer BUILD -- Build a Buffer Pool is important. The progra~~er can specify (in the DCB macro-instruction) that the buffers are to start either on a double­ The BUILD macro-instruction structures a word or on a full-word boundary that is not main storage area reserved by the program­ also a double-word boundary. If double­ mer into a buffer pool. word alignment is specified for format V logical records, the fifth byte of the The address of a main storage area to be first logical record of each block is used as a buffer pool is specified in the aligned on a double-word boundary. The BUILD macro-instruction. This address must alignment of subsequent logical records in also appear in the data control block each block depends upon the lengths of the associated with each data set that will use preceding records of that block. If the pool. The number of buffers to be double-word alignment is required for the contained in the pool and the byte length first byte of the first logical record in a of each buffer must also be specified in block, full-word buffer alignment should be the BUILD macro-instruction. specified.

Data Access Methods 35 When the buffer pool is no longer cards punched, he should restrict the maxi­ required, the area obtained with the GET­ mum size of his records to 80 or 160 data POOL macro-instruction should be returned bytes, depending upon whether the mode is to the system by issuing a FREEPOOL macro­ EBCDIC or column binary, respectively. instruction. When the queued sequential access method is used, punch error correction on the IBM FREEPOOL -- Free a Buffer Pool 2540 Card Read Punch is automatically per­ formed only for data sets with three or more buffers. The FREE POOL macro-instruction returns a buffer pool, previously obtained automatically or by a GETPOOL macro- Printers instruction, to main storage.

The address of the data control block The printer accepts data of any record associated with the data set that used the format (F, V, or U). When format V records pool must be specified in the FREEPOOL are printed, the initial control bytes in macro-instruction. the buffer are ignored, and not printed. The control character C, if specified, is used for carriage control only; it is not printed. ACCESS METHODS FOR SEQUENTIAL DATA SETS Each line of print corresponds to one logical record in storage; hence, if a data Two access methods, the queued set is to be printed, the length of its sequential and the basic sequential, are records should not exceed one line of provided to enable the programmer to store print. and retrieve the records of a sequential data set. Both access methods can be used The system does not automatically per­ when data is processed on unit record form initial pOSitioning of the printer equipment, paper tape readers, magnetic carriage. tapes, and direct-access devices. These access methods are particularly valuable in such applications as copying data sets from Paper Tape Reader one volume to another, updating payroll or inventory data sets, and merging two or more sequential data sets. The paper tape reader reads format U and format F records. Each format U record on paper tape is followed by an end-of-record character. This character is not required DATA FORMAT-DEVICE TYPE RELATIONSHIPS for format F records. Data read from paper tape is optionally converted into the System/360 internal representation of any The following text discusses data format of six standard paper tape codes. considerations that apply to specific input/output device types supported by the queued sequential and basic sequential Magnetic Tape access methods. Included are descriptions of acceptable data formats for each of the devices supported. All record formats (F, V, and U) are acceptable to magnetic tape; all control bytes are transIfli tted.. 7-track tapes not Card Readers and Punches using the data conversion feature do not handle format V. (It is recommended that all blocks be at least 16 bytes in length.) Readers and punches transfer data of any record format (F, V, or U). When format V records are punched, the initial control Direct-Access Devices bytes in the buffer are ignored, and not punched,. The control character C, if spec­ ified, is used for stacker selection only; All record formats (F, V, and U) are it is not punched. acceptable to direct-access devices; all control bytes are transmitted. When the system transfers data from main storage to be punched, each card punched All direct-access devices have the same corresponds to one logical record; for this track format. Each track consists of con­ reason, if the programmer plans to have trol information, a capacity record (R o )'

36 and the records (R~ Rn). Additional the programmer specifies chained scheduling track format information follows: for a data set, the input/output operations of the data set may intermittently monopo­ 1. Record Ro. The capacity record is lize available time on a channel. For this formatted according to a system stan­ reason, if more than one data set is to be dard. Only the basic sequential processed, the programmer should assign access method can be used to rewrite each data set to a separate channel, if the data portion of this record. possible.

2. Record R~. This record is either the first complete data record on a given track, or the overflow portion of a QUEUED SEQUENTIAL ACCESS METHOD record from a preceding track (if the track overflow option is in effect). It has a record number of 1 in the The queued sequential access method per­ count field. mits the programmer to store and retrieve the records of a sequential data set with­ 3. other Data Records. The record number out coding blocking/deblocking and buffer­ in the count field can extend sequen­ ing routines. The programmer can, there­ tially from 2 to a maximum of 255. fore, concentrate all his efforts on pro­ cessing the data he reads and writes. Both the queued and basic sequential Another major feature of this access method access methods can be used to store and is that it provides two buffering tech­ retrieve the data records of a direct­ niques, allowing the programmer to choose access volume. Normally, as many records the one most suited to his application. are stored on a track as is physically possible. A data set can be retrieved in The macro-instructions of the queued its entirety even if the tracks on which sequential ac~ess method are, for the most the data set resides do not each contain a part, device-independent, permitting the full complement of records. programmer to write programs that can be executed using a number of different input/output devices. CHAINED SCHEDULING

Both the queued sequential and basic RECORD FORMATS sequential access methods permit the programmer to accelerate the input/output operations required for a data set through The queued sequential access method sup­ the use of a technique known as chained ports five block configurations: scheduling. This technique, specified in the DCB macro-instruction, bypasses the 1. Format U. normal input/output scheduling routines of 2. Format F, Unblocked. the system to dynamically chain several 3. Format F, Blocked. input/output operations together. A series 4. Format V, Unblocked. of separate read operations, for example, 5. Format V, Blocked. functioning under chained scheduling, is issued to the computing system as one continuous read operation using the PCI flag in command words for synchronization. BUFFERING CONSIDERATIONS

Chained scheduling increases input/ output performance by reducing both CPU The following section discusses the buf­ time and channel start and stop time fering facilities available with the queued required to transfer records between main sequential access method. Descriptions of and secondary storage. It also can sharply buff'er pool construction and buffer assign­ reduce the effects of rotational delay ment procedures are included. since several successive blocks, indepen­ dently called for, can be retrieved in a single rotation. The use of chained sched­ Buffer Pool Construction uling, however, restricts the programmer in his choice of buffering techniques. In addition, each data set for which chained The system automatically assigns a buf­ scheduling is specified must be assigned at fer pool to a data control block when it is least two, and preferably three" buffers. opened, if the programmer has not assigned such a pool prior to the conclusion of the Chained scheduling is most valuable for optional data control block exit routine. programs that are input/output limited. If The programmer must return this pool area

Data Access Methods 37 to main storage when it is no longer The programmer, therefore, can insert required by issuing a FREEPOOL macro­ new records or delete old records, as instruction (refer to the section "Buffers required, when creating a new data set from and Buffer Pools"). an existing data set. When the programmer requires buffers for Simple buffering is the most widely specialized applications, he should use applicable of the two techniques provided. either the GETPOOL or the BUILD macro­ The system places no restrictions on the instruction (refer to the section "Buffers record formats or macro-instructions that and Buffer Pools"). can be used with this teChnique. REQUESTING SIMPLE BUFFERING: By any of the methods described previously, the buffer Buffer Assignment Procedures pools are created and associated with data control blocks. The programmer must indi­ cate in the data control blocks of the data After the buffer pool has been sets that simple buffering is to be used. constructed, the programmer requests input or output of data records. The system automatically blocks and deblocks data Exchange Buffering records, obtains and controls buffers, and reads and writes data records, as required. If a buffer pool constructed by the BUILD Exchange buffering combines the record macro-instruction is used by more than one insertion/deletion features of simple buf­ data set, individual buff.ers from the pool fering with certain device features asso­ are automatically assigned to the appropri­ ciated with data chaining ("scatter read" ate data control block according to the and "gather write"). The system implements programmer's specifications. "scatter read" by issuing separate chained channel command words for each logical Buffers are returned to the pool area by record in a block, reading these records the system when the programmer closes the into separate main storage locations data control block of the data set using (buffer segments or work areas). "Gather the pool. write" is implemented similarly. The sys- tem issues separate chained channel command words to write logical records from separ­ ate main storage locations into one block on a volume. BUFFERING TECHNIQUES With exchange buffering, logical records can be handled in any of the following The term buffering technique refers to ways: the manner in which buffers are assigned to, and used with, input and output data • Processed within an input buffer seg­ sets. Two buffering techniques are provid­ ment. ed: simple and exchange. Each is described in detail in the following text. Correct • Moved from an input buffer segment to a choice of these techniques contributes to work area. the efficiency of the problem program. • Moved from an input buffer segment to an output buffer segment. Simple Buffering • Moved from a work area to an output buffer segment. In simple buffering, a data set is associated with a specific group of- buf­ • Included in a scatter read. fers. A data set always uses buffers obtained from the pool aSSigned to its data • Included in a gather write. control block at the time it is opened. Logical records can be treated in any of Exchange buffering can be requested only the following ways: for programs that are to process either unblocked records or blocked format F • Moved between a buffer and an indepen­ records. When blocked -records are proc­ dent work area. essed, the implementation of exchange buf­ fering is totally dependent upon data • Processed within a buffer. chaining. The ability to chain data is related to a combination of such factors as • Moved from an input buffer to an output the speed of the central processing unit, buffer. the input/output device selected, and the

38 type of input/output channel involved. If In the locate mode, GET does not move the programmer has requested exchange buf­ the logical record from the input buffer, fering, and data chaining cannot be effect­ but places into a standard register the ed, simple buffering is substituted auto­ address of the buffer segment in which the matically. If simple buffering is substi­ programmer may process that record. The tuted, alignment is guaranteed only if programmer may not extend record size. logical records are multiples of double words. In the substitute mode, GET interchanges For a data set using exchange buffering the addresses of the programmer's work area and blocked format F records, the system and the buffer segment containing the logi­ segments the buffers so that each segment cal record, so that the buffer segment's is of the same length and has the same word address is placed in a standard register boundary alignment. (The programmer must and the work area becomes a segment of the ensure that buffers are large enough for input buffer. Substitute mode GET can be boundary alignment of segments.) When the specified only if exchange buffering is programmer creates a buffer pool whose specified. If exchange buffering cannot be individual buffers are each larger than the perforroed because data chaining cannot be blocks of the data set, each buffer segment effected, substitute mode GET works identi­ will be larger than the record it contains. cally to move mode GET with simple buffer­ By constructing such a buffer pool, the ing. programmer can increase the length of each record within its buffer segment as the need arises. This technique is especially The programmer may specify only one of useful when the GET and PUT macro­ these modes of operation as a parameter of instructions are used in substitute mode. the DeB macro-instruction associated with the input data set. Table 3 indicates the Exchange buffering is useful and valid combinations of modes of GET with efficient in applications that involve each buffering technique. either merging two or more data sets, or updating one data set by inserting or GET cperates in a strictly sequential deleting logical records. and device-independent manner. As required, GET schedules the filling of REQUESTING EXCHANGE BUFFERING: Using any input buffers, deblocks records, and of the methods described previously, the directs input error recovery procedures. programmer creates and associates a buffer After GET has retrieved all records to be pool with both the input and output data processed and has discovered that no data sets. remains, the system automatically checks labels and passes control to the caution: Exchange buffering cannot be programmer's end-of-data set exit specifi€d requested for data of blocked format F in the data control block. GET also tests records when the programmer has specified for an end-of-volume condition and ini­ the track overflow option. tiates automatic volume switching if an input data set or a concatenation of input data sets extends across several volumes. Finally, GET automatically resolves data set discontinuities within the same volume. ~~eRO-INSTRUCTIONS The following operands must be specified by the programmer in the GET macro­ The following macro-instructions are instruction: provided by the queued sequential access method for input/output operations. 1. The address of the data control block associated with the input data set.

2. The address of the programmer's work GET -- Get a Logical Record area for input logical records if the mode of operation is move or substitute. The GET macro-instruction obtains a log­ ical re.cord from an input data set in either of three modes of operation: move, Note 1: Optionally, GET may read backwards locate, or substitute. In the move mode, from magnetic tape. GET moves the logical r·ecord, from an input buffer into a work area specified by the programmer. The record may be processed or Note 2: Only move mode GET is supported extended in the work area. Move mode GET for the paper tape reader when conversion can be used only with simple buffering. is specified.

Data Access Methods 39 RELSE -- Release an Input Buffer cally to move mode PUT with simple buffer­ ing.

The RELSE macro-instruction causes the The programmer specifies only one of GET macro-instruction to ignore the remain­ these modes of operation as a parameter of ing logical records in an input buffer and the DCB macro-instruction associated with to obtain logical records from the next the output data set. Table 3 indicates the buffer. When the prograITmer does not valid corrbinations of modes of PUT with require the remaining contents of an input each buffering technique. buffer that GET is deblocking, he may issue the RELSE macro-instruction to release the Like the GET macro-instruction, PUT buffer so that the next logical record is operates in a strictly sequential and retrieved from another block. When used in device-independent manner. As required, conjunction with move mode GET, RELSE caus­ PUT blocks records, schedules the emptying es the input buffer to be scheduled for of output buffers, and handles output error refilling immediately. When us'ed with correction procedures. PUT also resolves locate mode GET, RELSE prevents refilling discontinuities of available space, tests of the buffer until a subsequent GET is for an end-of-volume condition, and ini­ issued. RELSE does not affect buffers tiates automatic volume switching and label containing unblocked records. creation. The address of the data control block The following operands must be specified associated with the input data set must be in the PUT macro-instruction: specified in the RELSE macro-instruction. 1. The address of the data control block of the output data set. PUT -- Put a Logical Record 2. The address of the programmer's work area for output logical records if the The PUT macro-instruction places a logi­ mode of operation is move or substi­ cal record into an output data set in tute. either of three modes of operation: move, locate, or substitute. In the move mode, Note: If PUT is directed to a card punch PUT moves the logical record from a work or printer, the system automatically area specified by the programmer into an adjusts the blocking factor of format F or output buffer. In the locate mode, PUT V blocks to 1. This allows the programmer does not move the logical record into the to specify a record length and a buffer output buffer, but places into a standard length that provide __ an optimum blocking register the address of the buffer segment factor for possible intermediate tape or into which the programmer may move that direct-access devices. record. Locate mode PUT can be used only with simple buffering (Table 3). PUTX -- Put From Existing Data Set In the substitute mode, PUT interchanges the addresses of the work area containing the logical record and a free buffer seg­ The PUTX macro-instruction is used to ment. The buffer segment's address is update an input data set in place or to placed into a standard register and the create an output data set based on an input work area effectively becomes a segment of data set. PUTX updates, replaces, or the output buffer. Substitute mode PUT can inserts records read from existing data be specified only if exchange buffering is sets but does not add or create records specified. If exchange buffering cannot be from other sources. According to one of performed because data chaining cannot be two uses, update or output, and depending effected, sUbstitute mode PUT works identi- on the buffering technique, PUTX causes a

Table 3. Valid Combinations of Modes and Buffering Techniques r------T------T------, I Simple Buffering Only I Both Simple and I Exchange Buffering Only I I I Exchange Buffering I I ~------+------+------~ I GET move I GET locate I GET substitute I I PUT locate I PUT move I PUT substitute I I PUTX update I PUTX output I I ~--~------~------~------~ I Note: Exchange buffering does not permit format V blocked records; format V records I Il ______cannot be used at all with substitute mode. L ______JI

40 block or a logical record to be either The CLOSE macro-instruction effectively written directly from the input buffer into truncates the last block of a data set. which it was read or transferred from an input buffer to an output buffer. PUTX As noted in the section "Fixed-Length must be preceded by a GET macro-instruction (Format F)," data sets with truncated in the locate mode that refers to the same blocks are not read from direct-access input data control block as the PUTX. devices as efficiently as standard F data Table 3 indicates the valid combinations of sets. uses of PUTX with each buffering technique. Note: When the TRUNC macro-instruction is When the use is update, PUTX places used with locate mode PUT, the system records back into an input data set. Each assumes that a record was placed in the PUTX flags the entire input buffer contain­ buffer segment pointed to by the previous ing the segment addressed by the preceding PUT. GET macro-instruction to be written back to the same location in secondary storage from which it was read. The block is written FEOV -- Force End of Volume when the first GET is given for the next buffer. PUTX for update use applies only to data sets on direct-access volumes and The FEOV macro-instruction causes the may be ,used only with simple buffering. system to assume an end-of-volume condition for either an input or an output data set, When the use is output, PUTX places thereby causing immediate automatic volume records into an output data set and is switching. When volumes are switched, FEOV applicable to any buffering technique. creates output labels as required and veri­ With simple buffering, PUTX moves a logical fies labels on new input volumes. record from an input buffer segment to an available output buffer segment. New The address of the data control block of records can be added to the output buffer the input or output data set must be by PUT macro-instructions. PUTX, like PUT, specified in the FEOV macro-instruction. schedules the buffer to be written when it is filled. Note: when the FEOV macro-instruction is used with locate wode PUT, the system With exchange buffering, PUTX utilizes assumes that a record was placed in the data chaining to schedule a gather write of buffer segment pointed to by the previous logical records from areas some of which PUT. were previously input buffer segments. correspondingly, buffer segments that were previously used by an output data set are CNTRL -- Control a Printer or Stacker scheduled for a scatter read. The addresses of the data control blocks The CNTRL macro-instruction provides of the output and the input data sets either of two device-dependent control (output use), or associated with the data functions: on-line card reader stacker set updated-in-place (update use), must be selection or on-line printer carriage con­ specified in the PUTX macro-instruction. trol. If directed to a card reader, CNTRL must follow every GET macro-instruction directed to that card reader for the same data set. TRUNC -- Truncate an Output Buffer The following operands must be specified in the CNTRL macro-instruction: The TRUNC macro-instruction causes the PUT macro-instruction to regard an output 1. The address of the data control block buffer as full, and subsequently to place of the input or output data set. logical records into the next buffer. When the programmer does not need the remaining 2. The action to be taken (either stacker portion of an output buffer that PUT is selection, line spacing, or channel blocking, he may issue the TRUNC macro­ skipping) • instruction to truncate the buffer so that the next logical record is placed into 3. A number indicating either the stack­ another block. Thus, just as input buffers er, amount of lines, or the printer may be released, output buffers may be carriage tape channel. truncated for writing short blocks. Note: If CNTRL is directed to a card The address of the data control block of reader, only one input buffer may be used, the output data set must be specified in and the preceding GET macro-instruction the TRUNC macro-instruction. must be in move mode. As soon as CNTRL is

Data Access Methods 41 issued, the buffer is scheduled for refill­ Output Operations ing.

For uncorrectable errors that occur in PRTOV -- Test for Printer Overflow transferring data from an output buffer to secondary storage, the programmer can direct the system to: The PRTOV macro-instruction tests over­ flow indicators for on-line printer channel • Accept the record in error (applies overflow. If an overflow indicator is on, only to printer). PRTOV causes either an automatic skip to a new page or a transfer of control to an • Terminate the task. optionally specified logical point in the problem program.

The following operands must be specified in the PRTOV macro-instruction: ERROR CONDITIONS: INTERNAL DETAILS . 1. The address of the data control block of the output data set. The following more detailed discussion is provided for programmers who code their 2. The printer channel to be tested for own error analysis routines. The address overflow (either 9 or 12). of this routine must be specified in the DCB macro-instruction. 3. The address of a routine may optional­ ly be specified for transfer of con­ trol on condition of overflow; if this Input Operations is not specified, a printer overflow condition causes automatic skipping to channel one. When an uncorrectable error occurs after a GET macro-instruction has been issued to transfer data to an input buffer, the system ceases to schedule additional buf­ ERROR CONDITIONS fers to be filled. It continues, however, to deblock the records of those buffers already filled. When the buffer in which If data transmission to or from an the error occurred is to be deblocked, input/output device is not successful the control is passed to the programmer's error first time it is attempted, standard error analysis routine. recovery routines, provided by the operat­ ing system, attempt to clear the failure and allow the program to continue uninter­ Output Operations rupted. An uncorrectable error usually terminates the problem program, but the programmer can specify, in the DCB macro­ When an uncorrectable error occurs in instruction, other actions to be taken in transferring data from an output buffer, case of an uncorrectable error. These the system ceases to schedule additional actions differ for input and output buffers for writing. It continues, howev­ operations, and are described, by type, in er, to block the programmer's data until the following text. The programmer cannot all output buffers except one are filled. attempt to reread or rewrite the record in When the system attempts to fill the buffer error, since automatic retry is handled by in which the error occurred, control is the system. passed to the programmer's error analysis routine.

Input Operations Error Analysis Routine (Synchronous Error Exit) For uncorrectable errors that occur in filling an input buffer, the programmer can Error codes, whose addresses are placed direct the system to: by the system into standard registers, can be examined by the programmer to determine • Deblock the buffer as though its the type of error that has occurred, and records had been read correctly. the location of the buffer containing the • Ignore the buffer, and read and deblock record in error. After the programmer has the next block. completed his error analysiS and process­ • Terminate the task. ing, he can return control to the system,

42 whereupon the standard error option the essed successively as a single data set. programmer has specified in the DCB macro­ The following considerations apply to con­ instruction is executed. catenation of sequential data sets:

As an alternative, the data set may be 1. Concatenation applies only to data closed in the error analysis ~outine, in sets opened for INPUT. which case the programmer must not return control to the system. 2. A maximum of 255 data sets can be concatenated.

3. Only one data control block is asso­ PROGRAMMING NOTES ciated with all the data sets concate­ nated. The programmer enters DD statements for these data sets in the The following section describes order in which they are to be additional program.i11ing factors, not specif­ retrieved. If data sets with unlike ically related to anyone macro­ characteristics {e.g., block length, instruction, that the programmer should record format, etc.}, are to be con­ consider before coding a program. catenated, the data control block must contain an indication of this.

Direct-Access Volume Options 4. When the data sets to be concatenated have unlike characteristics, the pro­ gramnier must reissue any input Both the track overflow and the write requests that have not been completed validity check options, described previous­ at the time the system determines that ly, are available to the programmer. the data set currently being processed does not contain any more blocks. The keys in the records on direct-access such a data set is automatically volumes cannot be processed using the closed, and the next data set to be queued sequential access method. processed is opened. The programmer should supply an entry in the exit list for his data control block exit Update-in-Place rou·tine, so that control may be passed to it during the opening process. From this routine, the programmer must The following rules apply to a data set be able to determine the status of all to be updated-in-place: outstanding input requests; any requests not yet completed must be 1. Only simple buffering can be used. reissued after the opening process is completed, i.e., they cannot be reis­ 2. Chained scheduling is not available. sued in the programmer's data control block exit routine. When using the 3. Macro-instruction usage is limited to queued sequential access method, the the GET (locate), RELSE, and PUTX programmer must reissue the last GET (update) macro-instructions. issued before the new data set was opened. When using the basic sequen­ 4. When a PUTX (update) macro-instruction tial access method, each CHECK macro­ is issued for an individual record instruction should be immediately within a block, the complete block (as followed by a test of a program switch it exists in secondary storage) is whose value indicates whether or not scheduled to be overwritten. The to reissue the associated READ macro­ block is overwritten after the pro­ instruction and all other READ macro­ grammer has completed the input proc­ instructions that were subsequently essing of all records in the block. issued. The program switch should be set to the "on" status in the data 5. Neither alteration of block length, control block exit routine and set insertion of new blocks, nor deletion "off" whenever the test determines an of existing blocks is possible. "on" condition.

5. When the data sets to be concatenated have identical characteristics, i.e., Concatenated Data Sets both data and device characteristics, the system performs the concatenating function without performing the Two or more sequentially organized data closing and opening processes des­ sets can be concatenated, i.e., automat­ cribed in item 4. Therefore, the data ically retrieved by the system and proc- control block exit is not taken and

Data Access Methods 43 the programmer is not aware of when record about to be transferred to an output the concatenation process takes place. buffer.

6. The programmer's end-oE-data set rou­ tine is not entered until the last data set has been retrieved. BASIC SEQUENTIAL ACCESS METHOD 7. Volume switching is automatically per­ formed as for a single data set on multiple volumes. The basic sequential access method pro­ vides the programmer with an efficient and 8. When two data sets on the same volume flexible means for storing and retrieving are to be consecutively concatenated, the blocks of a sequentially organized data the disposition option of the OPEN set. The macro-instructions of this access macro-instruction should be LEAVE or method can be used in a device-dependent REREAD. manner, supplying the programmer with a set of facilities similar to the true function­ 9. User label exit routines are executed al nature of the input/output devices sup­ for each data set, if requested. ported. Certain macro-instructions (NOTE, POINT, and CONTROL) permit him to gain For detailed concatenation procedures, access to data in other than a strictly see IBM System/360 Operating System: Job sequential order. By somewhat limiting the Control Language. use of these macro-instructions, however, the prograrr@er can code programs that are completely device-independent. Whether using these macro-instructions in a device­ Read Backwards dependent or device-independent manner, the programmer does not require a detailed knowledge of the input/output devices Data sets on magnetic tape that can be themselves. read backwards are supported by the System/360 Operating System. The following A major feature of the basic sequential considerations apply to such data sets: access method is that it permits the pro­ grammer to transfer data from an 1. Simple buffering must be used. input/output device directly to a specific area of main storage or, conversely, to 2. Format V records cannot be read back­ transfer data from a specific area in main wards. storage to an input/output device, without first moving it to or from a buffer. This 3. Word boundary alignment of the first feature is particularly useful if, owing to data byte of each block is ensured the large size of the records to be proc­ only if the length of each block of essed, no main storage space is available the data set is a multiple of a single for buffers. or double word. Because of the additional modes of the 4. In reading backwards, logical records OPEN macro-instruction provided for the are presented in the same manner as in basic sequential access method, it is forward reading, but in reverse effective in applications where records are sequence. to be alternately read and written, in rapid succession, from and to a data set used as a temporary extension of main Blocking of Variable-Length Records storage. The basic sequential access method can When a PUT (locate mode) is used to also be used to store and retrieve blocks block variable-length records, the system directly, in any sequence, from a direct­ maintains a maximum logical record length access or a magnetic tape device. This in the data control block. When the space capability, however, is less flexible than r~maining in an outrut buffer is less than the basic indexed sequential or the basic this maximum logical record length, the direct access methods, which are more records in the buffer are transferred as a specialized for direct-access devices. block to secondary storage and the system begins filling another buffer. To ensure that each block contains the maximum number RECORD FORMATS of records it can accommodate, the program­ mer can replace the maximum logical record length maintained in the data control block The basic sequential access method sup­ ( with the actual length of each logical ports five block configurations:

44 1. Forrr,at u. Buffer Assignment Procedures 2. Format F, Unblocked. 3. Format F, Blocked. 4. Format V, Unblocked. To obtain a buffer from a pool 5. Format V, Blocked. constructed by means of any of the above three techniques, the programmer issues a GETBUF macro-instruction. All blocks are treated as the object of an input or an output request. Although When the buffer is no longer required, the basic sequential access method does not the programmer must return the buffer to provide either automatic buffering of its pool by issuing a FREEBUF macro­ blocks or blocking/deblocking of records, instruction. the resources of the system permit the programmer to code these routines, if required, with a minimum of effort. Trun­ GETBUF -- Get a Buffer From a Pool cated format F blocks can be detected by the system and an indication of such blocks is provided for the programmer's error The GETBUF macro-instruction causes a analysis routine, without using the buffer to be obtained from a pool system's error recovery procedures. associated with a specific data set.

For format V blocks in the basic sequen­ The address of the data control block of tial access method, the first eight bytes the dat.a set requiring the buffer, and a of a block (four containing block control register into which the system is to place information and four containing record con­ the address of the buffer obtained must be trol information) must be provided by the specified in the GETBUF macro-instruction. programmer.

FREEBUF -- Return a Buffer to a. Pool

BUFFERING CONSIDERATIONS The FREEBUF macro-instruction causes a buffer to be returned to the pool from The term buffering is used in a differ­ which it was obtained. ent context in the basic sequential access method than it is in the queued sequential The address of the data control block of access method. In the basic sequential the data set using the buffer pool, and the access method, a buffer is a work area register containing the address of the rather than an intermediate storage area. buffer to be returned to the pool must be The programmer may use the buffering macro­ specified in ~he FREEBUF macro-instruction. instructions provided by the system to create and assign work areas (buffers) to The programmer need not return buffers the problem program, rather than to reserve to a buffer pool in the order in which they and identify specific work areas within the were obtained. program.

MACRO-INSTRUCTIONS

Buffer Pool Construction The following macro-instructions are provided by the basic sequential access If the programmer has not assigned a method for input/output operations. buffer pool to a data set prior to the conclusion of the optional data control block exit routine, and a buffer pool is READ -- Read a Block required, the system assigns a pool automatically when the data control block is opened. The programmer must return the The READ macro-instruction requests that pool to main storage when it is no longer a block be transmitted from an input data required by issuing a FREEPOOL macro­ set to a main storage area specified by the instruction (refer to section "Buffers and programmer. As previously explained, the Buffer Pools"). fields in the data event control block are specified as parameters of READ (but may be When the programmer requires buffers for subsequently replaced by parameters of specialized applications, he should use other READ macro-instructions addressed to either the GETPOOL or the BUILD macro­ the same data event control block). READ instruction

Data Access Methods 45 lap of the input operation with processing, 1. The address of the data event control READ does not wait for completion of the block of the WRITE macro-instruction. input operation, but returns control to the problem program. If the input data set is 2. The type of output operation. defined with key fields, READ transmits the key, immediately followed by the block, The following operands are required in into the area. READ also automatically WRITE macro-instructions that initially resolves extent discontinuities. place the corresponding fields into a data event control block. In subsequent WRITE The following two operands must be spec­ macro-instructions using the same data ified in the READ macro-instruction: event control block, they may optionally be specified to override the previously speci­ 1. The address of the data event control fied values. If an operand is omitted, the block referred to by the READ macro­ system assumes its value is already in the instruction. data event control block. 2. The type of input operation (either 3. The address of a data control block of forward or backward reading). an output data set. The following operands are required in 4. The address of an output area. READ macro-instructions that initially place the corresponding fields into a data 5. For format U records, the number of event control block. In subsequent READ bytes to be transmitted. This over­ macro-instructions using the same data riding length should not exceed the event control block, they may optionally be length specified in the data control specified to override the previously block. specified values. If an operand is omit­ ted, the system as~umes its value is already in the data event control block. CHECK -- Wait for and Test Completion of 3. The address of a data control block of Read or Write Operation an input data set.

4. The address of an input area. The CHECK macro-instruction must be used to wait for the completion of an 5. For format U records, the number of input/output operation requested by a READ bytes to be transmitted. or WRITE macro-instruction. It is also used to test the data event control block for errors and exceptional conditions. As required, CHECK passes control to the appropriate exits that are specified by the WRITE -- write a Block programmer in the data control block for error analysis and end-of-data set, and initiates automatic end-of-volume proce­ The WRITE macro-instruction requests dures. The programmer must issue a CHECK that a block be transmitted from a main macro-instruction to test the input/output storage area specified by the programmer to operation associated with the data event an output data set. Normally, the fields control block before modifying or reusing in the data event control block are ini­ it. Similarly, a problem program must tially parameters of WRITE (but may be check an input/output operation for comple­ subsequently replaced by parameters of tion before altering the input or output other WRITE macro-instructions addressed to area in main storage. the same data event control block). Like the READ macro":instruction, WRITE operates The address of the data event control in a strictly sequential and device­ block of a preceding READ or WRITE macro­ independent manner. To allow overlap of instruction must be specified in the CHECK the output operation with processing, HRITE macro-instruction. does not wait for completion of the output operation, but returns control to the Note: A WAIT macro-instruction can be problem program. If the key length of an issued prior to the CHECK macro­ output data set is specified in the data instruction. The WAIT macro-instruction control block, WRITE transmits the key, synchronizes input/output operations with immediately followed by the data, from the processing but does not check the data area. WRITE also automatically resolves event control block for errors or extent discontinuities. exceptional conditions or initiate volume switching. Such a WAIT macro-instruction The following two operands must be spec­ may be issued for multiple event control (. ified in the WRITE macro-instruction: blocks.

46 Successive CHECK macro-instructions that overflow. If an overflow indicator is on, test input/output operations on the same PRTOV causes either an automatic skip to a data set should be issued in the same order new page or a transfer of control to an as the associated READ or WRITE macro­ optionally specified logical point in the instruction for the data set. (This is not problem program. true of WAIT.) The following operands must be specified in the PRTOV macro-instruction:

FEOV -- Force End of Volume 1. The address of the data control block of the output data set. The FEOV macro-instruction causes the system to assume an end-of-volume condition 2. The printer carriage tape channel to for either an input or an output data set, be tested for overflow (either 9 or thereby causing immediate automatic volume 12) • switching. When volumes are switched, FEOV creates output labels as required, and 3. The address of a routine may optional­ verifies lab~ls on new input volumes. ly be specified for transfer of con­ trol on condition of overflow; if this The address of the data control block of is not specified, a printer-:-verflow the data set must be specified in the FEOV condition causes automatic skipping to macro-instruction. channel one.

Note: Before issuing an FEOV macro­ instruction for an output data set, the programmer should test all write operations NOTE -- Provide Position Feedback for completion.

The NOTE macro-instruction places into a standard register the position on a volume CNTRL -- Control On-Line Input/Output of the last block read from or written into Devices a data set. This feedback identifies the block for subsequent repositioning of that volume. The CNTRL macro-instruction provides one of three device-dependent on-line control The identification that NOTE provides is functions: card reader stacker selection, a block count for magnetic tape; for printer carriage control, or magnetic tape direct-access volumes, it is_ the track repositioning. number relative to the beginning of the data set portion on the volume, and the The following operands must be specified record number within the track. in the CNTRL macro-instruction: The address of the data control block of the data set must be specified in the NOTE 1. The address of the data control block macro-instruction. of the data set. Notes: The following items should be con­ 2. The action to be taken (either stacker sidered when using the NOTE macro­ selection, line spacing, channel instruction: skipping, tape block forward spacing, tape block backspacing, forward spac­ ing over a tape mark and back to 'the 1. Before issuing a NOTE macro- end of the preceding record, or back­ instruction, the programmer should spacing over a tape mark and forward test the last input/output operation to the following record). for completion.

3. A number indicating the stacker, 2. NOTE is normally used to provide amount of lines, printer channel, or information for a subsequent POINT count of records. macro-instruction.

PRTOV -- Test for Printer Overflow POINT -- Point to Block

The PRTOV macro-instruction tests over­ The POINT macro-instruction causes repo­ flow indicators for on-line printer channel sitioning of a magnetic tape or direct-

Data Access Methods 47 access volume to a specified block within a ERROR CONDITIONS data set on that volume. A subsequent READ macro-instruction starts to read sequential input with the specified block. Thus, If the programmer's error analysis rou- ~ POINT permits reading of the data set from tine has been entered as a result of an any specified position. A subsequent WRITE uncorrectable error in data transmission, macro-instruction starts to write the programmer cannot attempt to retry the sequential output at the block that has operation in error since automatic retry is been pointed to. handled by the system. The following operands must be specified The programmer can examine error code in the POINT macro-instruction: information (supplied in standard registers) and the block in error to deter­ mine the type of error that has occurred. 1. The address of the data control block After error analysis and processing is of the data set. complete, the programmer can return control to the system, whereupon processing resumes 2. The address of a main storage area with the next block of data. Alternative­ containing an identification of a ly, the data set in which the error block within the data set (block count occurred may be closed, in which case for magnetic tape; relative track and return to the system is not permitted~ In record number within the track for general, this alternative is recommended direct-access volumes). for tape and direct-access output.

BSP -- Backspace One Block PROGRAMMING NOTES

The BSP macro-instruction causes the The following section describes addi­ repositioning of a magnetic tape or direct­ tional programming factors, not specif~ access volume backwards one data block on ically related to anyone macro­ the current volume, thus permitting the instruction, that the programmer should rereading or rewriting of a block. take into account before coding a program. The address of the data control block of the data set must be specified in the BSP macro-instruction. Direct-Access Volume Options

Notes: The following items should be Both the track overflow and write considered when using the BSP macro- validity check options, described previous­ instruction: ly, are available to the programmer.

1. For direct-access volumes, when a WRITE macro-instruction follows a BSP, Update-in-Place the remainder of the contents of the track on which the block is written is destroyed. For magnetic tape, when a A data set on a direct-access volume may WRITE macro-instruction follows a BSP, be updated-in-place; i.e., records may be any information immediately following read from the data set, processed, and the block may be destroyed. written back to the same positions from which they were read, without destroying 2. BSP cannot be used for a data set on a the remaining records on a track. The direct-access volume if the track following rules apply to a data set to be overflow option was used in writing updated-in-place: the data set. 3. It is recommended that BSP be used • Chained scheduling is not available. only when it is not possible or not practical to use other macro­ • Macro-instruction usage is limited to instructions for repOSitioning the READ, WRITE, CHECK, NOTE, and POINT purposes. macro-instructions. 4. All READ and WRITE operations must be • READ and POINT macro-instructions may checked for completion before BSP is be issued in any order, as described issued. previously. Because a WRITE macro-

48 instruction must be preceded by a READ BASIC PARTITIONED ACCESS METHOD macro-instruction, new records cannot be added to a data set. The basic partitioned access method • Neither alteration of record length, provides for the storage and retrieval of insertion of new records, nor deletion data associated with a partitioned data of old records is permitted. set. It allows the programmer to select named members and to eventually read or write the records within those members. Except that the basic partitioned access Read Backwards and Concatenated Data Sets method is restricted to direct-access devi­ ces, its primary characteristics are ident­ ical to those of the basic sequential Considerations that apply to reading a access method. These characteristics data set backwards from magnetic tape and include buffer pool construction, buffer to concatenation of sequential data sets assignment procedures, and macro­ are listed in the section "Programming instructions for direct-access devices. Notes" under "Queued Sequential Access Method. " Additional macro-instructions are provided with this access method to permit the programmer to use the directory of the partitioned data set in locating a member for processing, to change the contents of Device Considerations the directory, and to add, replace, delete, or rename members. Table 4 lists the macro-instructions of the basic sequential access method that can RECORD FORMATS AND BUFFERING CONSIDERATIONS be used for specific input/output devices. The permissible modes of the OPEN macro­ instruction are listed in parentheses for The record formats for a partitioned each device. An X indicates a valid data set follow the same rules as either operation; an E indicates that for a parti­ the queued or the basic sequential access cular row, only one of the columns marked method, with the exception that standard F with an E may be selected; an asterisk (*) format records may not be used. For furth­ indicates that CNTRL (tape), NOTE, POINT, er information on the compatibility between and BSP are permitted for data in the the basic partitioned access method and the system input stream CSYSIN) and in the queued or basic sequential access methods, SYSOUT data set but are ignored; and a refer to the section "Basic Partitioned double asterisk C**) indicates that PRTOV Access Method eompatibility." may be specified but is ignored. Refer to the section "Buffering Considerations" for the basic sequential access method for the discussion of buffer Device Independence pool construction and buffer assignment procedures. Table 4 can be used as a guide in coding device-independent programs. To achieve device independence., the programmer should MACRO-INSTRUCTIONS select.those macro-instructions and OPEN modes that are compatible for two or more devices. The following macro-instructions for operations on a partitioned data set direc­ For example, to code a program that is tory are provided by the basic partitioned device-independent across magnetic tape and access method. direct-access devices, the programmer can use the READ, WRITE, CHECK, and either the BSP or the NOTE and POINT macro­ FIND -- Position to Member of Partitioned instructions with the INPUT, OUTPUT, .INOUT, Data Set or OUTIN modes of the OPEN macro­ instruction. Once coded, the program can be executed using either magnetic tape or a The FIND macro-instruction causes the direct-access device. Similarly, by address of the first block of a specified selection of appropriate macro-instructions partitioned data set member to be deter­ and OPEN modes, device compatibility among mined so that a subsequent READ macro­ reader, printer, punch, tape, and direct­ instruction causes sequential input of access devices may be achieved. blocks to begin with the member specified.

Data Access Methods 49 Table 4. Basic Sequential Access Method Device Considerations r------~------T------1 I I Macro-Instructions I I ~------T------T------T------T------T------~ I I READ I WRITE I I I NOTE I I I Device and I and I and I CNTRL I PRTOV I and I BSP I I Mode of OPEN I CHECK I CHECK I I I POINT I I ~------t------t------t------t------t------t------~ I Pa per Tape Rea der I X I I I I I I I ( INPUT) I I I I I I I ~------t------+------t------t------t------t------~ I 1442 Card Read Punch1 I X I I X I I * I I I ( INPUT) I I I I I I I ~------t------t------t------t------t------t------~ I 2501. 2520, and 2540 I I I I I I I I Card Readers (INPUT or I X I I X I I * I I I INOOT) I I I I I I I ~------t------+------t------t------t------t------~ 2 I 1442 Card Read Punch , I I X I I I I I I 2520 and 2540 Card I I I I I I I I Punches (OUTPUT I I I I I I I I or OUT IN) I I I I I I I ~------t------t------t------+------+------+------i I 1442 Card Read Punch3 , I X I X I I I I I I (INOUT) I I I I I I I ~------+------+------+------t------+------+------i I Printer (OUTPUT I I X I X I X I I I I or OUT IN) I I I I I I I ~------t------t------+------+------t------t------i I Magnetic Tape I X I I E* I I E* I E* I I (INPUT or RDBACK) I I I I I I I ~------+------+------+------+------t------+------~ I Magnetic Tape I I X I E* I ** I E* I E* I I (0 OTP UT) I I I I I I I ~------t------+------+------+------+------t------i I Magnetic Tape I X I X I E* I I E* I E* I I (INOUT or OUTIN) I I I I I I I ~------+------+------+------+------+------+------i I Direct Access I X I I I I E I E I I ( INPUT) I I I I I I I ~------+------+------+------+------+------+------i I Direct Access I I X I I ** I E I E I I (OUTPUT) I I I I I I I ~------+------+------+------+------+------+------i , Direct Access I X I X I I I E I E I I (INOUT or OUTIN) I I I I I ., I ~------+------+------+------+------+------+------~ I Direct Access I X I X I I I X I I I (UPDAT) I I I I I I I ~------~------~------~------~------~------~------i 11TO achieve card reader independence, CNTRL macro-instructions, if used, must be issued I I alternately with READ macro-instructions~ I 1 2 The program is card punch type dependent if machine code control characters are used. I LI~The______program is 1442 device dependent if WRITE is used. JI

50 The following operands must be specified indication of whether that member is an in the FIND macro-instruction: addition, a replacement, the same member with a new name, or a deletion. The 1. The name of the data control block of physical position of the entry in the the input data set. directory is determined 'by the name of the member. 2. The address of an area containing either the name of the member, or the The STOW macro-instruction permits more address of an entry for that member in than one name to be entered into the a main storage list constructed by the directory for a given member. All names programmer with a BLDL macro­ other than the first are called aliases. instruction. When a member is deleted or replaced, only the directory entry that is referred to is 3. An indication of the type of affected. Therefore, to produce consistent information contained in the area results, each alias for a given member must parameter. be deleted or replaced when that member is deleted or replaced. BLDL -- Build List The following operands must be specified in the STOW macro-instruction: The BLDL macro-instruction causes member 1. The address of the data control block addresses and optional information from a of the output data set. data set directory to be placed into a specified list constructed by the program­ 2. The address of an area containing the mer in main storage. The format of this name of a member and, optionally, list must be similar to that of the direc­ additional information for a directory tory and must include the names of any entry. members for which BLDL is to provide con­ trol information. Names must be placed 3. An indication of the type of action to into the list by the programmer in the same be taken on the member. order in which they appear in the direc­ tory. Note: It is only by use of STOW that the programmer can store optional information Access time for retrieval of members is in the directory of a partitioned data set. reduced if a FIND macro-instruction is directed to an entry in a main storage list rather than to the directory. For this reason, the programmer may wish to con­ PROGRAMMING NOTE struct such a list with BLDL for members frequently used during a program. A subse­ quent FIND macro-instruction for a member Before issuing a FIND, BLDL or STOW does not search the directory for a parti­ macro-instruction, the programmer must test cular entry but simply refers to the list all preceding input/output operations for entry specified by the programmer. completion with CHECK macro-instructions. The following operands must be specified in the BLDL macro-instruction: CREATING A PARTITIONED DATA SET 1. The address of the data control block of an input data set. A partitioned data set is useful for 2. The address of the main storage list maintaining related groups of problem pro­ to be built,. grams., often-used subroutines, and librar­ ies of user-written macro-instruction defi­ Note: It is only by use of BLDL that the nitions. The programmer creates a parti­ programmer can retrieve optional informa­ tioned data set according to the following tion from the data set directory. procedure:

1. Defines the data set using the DCB macro-instruction and the DO state- STOW -- Manipulate Partitioned Data Set mente Directory a. Device must be direct access. The STOW macro-instruction causes the b. Data organization field of the DCB name of a member to be entered into or macro-instruction must indicate deleted from the data set directory with an partitioned organization.

Data Access Methods 51 c. Directory quantity subparameter order in which they are to be must be specified in the SPACE retrieved. parameter of the DD statement. 5. The end-of-data set routine is entered 2. Issues the OPEN macro-instruction normally, i. e. I' when a block is (output mode) to open the data control requested and there are no more blocks block of the data set to be created. in the member to be retrieved. The programmer may then choose either to 3. Uses the WRITE macro-instruction to process another member of the concate­ place blocks on the direct-access vol­ nated partitioned data sets or to ume. issue a CLOSE macro-instruction. 4. When all the blocks that are to con­ stitute a member have been written, BASIC PARTITIONED ACCESS METHOD issues a STOW macro-instruction to COMPATIBILITY enter the name of the member, its relative address, and optional user data into the directory. The operating system provides limited compatibility between the basic partitioned 5. Continues to use the WRITE and STOW access method and the sequential access macro-instructions until all the mem- methods. This compatibility enables the bers of the data set have been writ- programmer to create., replace, or retrieve ten, and their names have been entered an individual member of a partitioned data into the directory. set using the macro-instructions of either the queued or basic sequential access meth­ 6. Issues the CLOSE macro-instruction to od. Use of the queued sequential access close the data control block of the method in this manner is the only way data set. blocking and deblocking of records is auto­ matically provided in a partitioned organi­ zation. The factors governing these opera­ tions are outlined in the following text. CONCATENATION OF PARTITIONED DATA SETS To create or replace a member of a partitioned data set using the sequential Two or more partitioned data sets having access methods, the programmer codes an identical characteristics can be concate­ OPEN macro-instruction (output mode) for nated for input processing as a single data the data control block of the data set to set. The directories of the individual be processed, a series of PUT (or WRITE) data sets of the concatenation are logical­ macro-instructions" and a CLOSE macro­ ly linked together and searched by the instruction. The data organization field system (after FIND macro-instructions are of the DCB macro-instruction coded for this issued) in the order in which the data sets program should indicate sequential. are concatenated. If two members of dif­ ferent data sets have the same name, a FIND To create a new member of an existing macro-instruction determines the address of partitioned data set, the programmer the member whose name appears in the first prepares a DD statement specifying, in the directory searched. The programmer can use DSNAME parameter, the name of the data set the BLDL macro-instruction and examine the and the name of the new member, and speci­ list to identify the data set with which fying MOD in the DISP parameter. When the the member is associated. data control block of this data set is closed, the name of the new member is The following considerations apply to automatically entered into the appropriate concatenation of partitioned data sets: partitioned data set directory. An entry that has been automatically entered into a 1. Concatenation applies only to data directory differs in no way from an entry sets opened for INPUT. that has been entered by the STOW macro­ instruction, except that no optional user 2. A maximum of 16 data sets can be information may be included. concatenated. In a manner similar to that described in 3. All volumes containing the data sets the preceding paragraph, the programmer can to be concatenated must be mounted create a new partitioned data set with the before program execution. data to be written as its first member. The programmer simply prepares a DD 4. Only one data control block is asso­ statement specifying, in the DSNAME param­ ciated with all the data sets concate­ eter# the name of the data set and the name nated. The programmer enters DD of the member of the new partitioned data statements for these data sets in the set, specifying NEW in the DISP parameter,

52 and requesting the allocation of space for to sequentially store and retrieve the both the new data set and its directory. records of an indexed sequential data set. The data set and its directory are automat­ In addition, this access method is the sole ically created during execution of the means of creating an indexed sequential program. data set.

To replace ~ member of an existing The macro-instructions of the queued partitioned data set, the programmer pre­ indexed sequential access method, although pares a DD statement specifying the name of similar in syntax and structure to those of the member of the existing partitioned data the queued sequential access method, differ set that is to be replaced, and specifying in function. These macro-instructions are OLD in the DISP parameter. If the named completely direct-access device oriented, member does not exist in the data set, the and automatically handle the intricate pro­ OLD specification is treated as if MOD had cedures involved in managing the index been specified.• structure of the data set. Furthermore, most index searching is done by channel To retrieve a member of an existing command sequences, without CPU interven­ partitioned data set using the sequential tion. The macro-instructions also provide access methods, the programmer issues an automatic buffering and blocking/deblocking OPEN macro-instruction (input mode) for the procedures, as required. data control block of the data set to be retrieved, a series of GET (or READ) macro­ instructions, and a CLOSE macro­ instruction. The data organization field of the DCB macro-instruction coded for this RECORD FORMATS program should indicate sequential. The programmer prepares a DD statement specifying the name of the member to be The queued indexed sequential access retrieved, and specifying OLD in the DISP method supports four block configurations: parameter. When the program is executed., the appropriate directory is searched and 1. Format F., Unblocked. the address of the required member is 2. Format F, Blocked. automatically determined. The system, in 3. Format V, Unblocked. effect" has issued a FIND macro­ 4. Format V., Blocked. instruction. The formats of records as they appear on Note: If the programmer does not specify a direct-access devices are shown in the member name in the DD statement with the following sections. Each block is recorded creation and retrieval operations on a direct-access device with a count described, the program is executed as for a field, a key field, and a data field,. sequential data set rather than as for a partitioned data set. Retrieval begins The key field is used by the system to with the first block of the directory and locate a requested logical record. +he terminates at the first partition encoun­ data field contains the logical records. tered.

Format F, Unblocked QUEUED INDEXED SEQUENTIAL ACCESS METHOD Fixed-length unblocked records appear on The queued indexed sequential access direct-access devices as shown in Figure method is provided to enable the programmer 16.

Count Key Data

Relative Key R ~ 1, KL,RL Key of Logical Position 'I 0 Record .--One Logical Record --+

Count Data Relative Key R ~ 1, KL, RL-KL One Logical Position = 0 Record

Figure 16. Unblocked Fixed-Length Records

Data Access Methods 53 Count Data

Relative Key R ~ I, KL, B x RL B Logical Records Position ~ 0 with Their Keys

Figure 17. Blocked Fixed-Length Records

R of the data set must be available to the is the sequence number of the record system from either the DeB macro­ on the track (R=O is not used). instruction, the DD statement, or the data set label. The contents of the key field RL on the direct-access volume is used by the is the length of the logical record systen: for locating the block containing a including its key. requested logical record.

KL is the key length. This length must remain constant for the data set. Format V" Unblocked

Variable-length unblocked records appear Format F, Blocked on direct-access devices as shown in Figure 19.

Fixed-length~ blocked records appear on direct-access devices as shown in Figure R 17. is the sequence number of the record on the track (R=O is not used).

R BL is the sequence number of the record is block length and includes the four on the track (R=O is not used). bytes (LLbb) for the block length field. RL is the logical record length. KL is the key length. B is the number of logical records appearing in a block and is a constant for a data set. Format V, Blocked

KL is the key length. This length must Variable-length blocked records appear remain constant for the data set. on direct-access devices as shown in Figure 20.

More specifically, the key and the data areas may be pictorially represented as R shown in Figure 18. is the sequence number of the record on the track (R=O is not used).

KL Key Area Data Area is the key length,. Key 3 I ! Key 1 ! I ! Key 2 ! I ! ~ey 3 BL Logica I Record 1 Logica I Record 2 Logica I Record 3 is block length and includes the four bytes (LLbb) for the block length Figure 18. Key and Data Areas (Format F) field.

V Keys 1, 2, and 3, respectively, are the is the number of logical records that keys of logical records 1, 2, and 3 and are fit within the maximum block size physically embedded in the records. The specified for the data set. In position of the key in each logical record general, V varies from block to block.

54 Count Key Data

Relative Key R .2 1, KL,BL Key of LLbb Key Position Z 4 Logical Record It Logical Record .. Figure 19. Unblocked Variable-Length Records

Count Data V Logical Records Relative Key R Z I,KL,BL Position Z 4 with Their Keys

Figure 20. Blocked Variable-Length Records

More specifically, the key and data Delete Codes areas may be pictorially presented as shown in Figure 21., To mark a logical record for deletion, Key 1 and key 2 are respectively the the user sets the "delete code" byte to all keys of logical records 1 and 2. The ones prior to issuing an output request for contents of the key field is used by the the logical record. For fixed-length for­ system to locate the block containing a mats, the delete code byte is the first requested logical record. byte of the logical record. For the variable-length formats, it is the fifth byte; that is, the first byte after the Overflow Records record'control field.

The preceding figures are for prime The logical record is written in the (rather than overflow) dat,a records only. prime or in the overflow area with its Data records in an overflow area are organ­ delete code. Physical deletion is per­ ized somewhat differently, as shown in formed if this record is forced off its Figure 22. They are never blocked, even prime data track by the insertion of a new though the prime data records are blocked. record or if the data set is reorganized. In addition, they contain a link field The deleted record may be replaced by a which links to the next record in the record with an equal key with no error overflow chain. The link field is 10 bytes indication. Whether a record has been in length. physically deleted or not, a GET macro-

Key Area Data Area

Key Key Key 2 LLbb 1 2

.. Data ~ 'C Data ~

Figure 21. Key and Data Area (Format V)

Fixed - Length Records

Key of Logica I Link R,? 1, KL, RL + 10 Logical Record Record Field

Count Key Data

Variable - Length Records

Key of Logica I Logical Record RZ 1, KL,BL+ 10 Record

Count Key Figure 22. Overflow Records

Data Access Methods 55 instruction does not produce a record MACRO-INSTRUCTIONS marked for deletion. ( CAUTION: If the delete option is selected The following macro-instructions are and the possibility exists that the first provided by the queued indexed sequential valid data byte of a logical record is all access method for input/output operations. ones, e.g., a negative fixed-point number, the programmer should offset the beginning of his data from the delete code byte. PUT -- Put a Logical Record Also, if records are blocked and if relative key position is zero, a record This macro-instruction is used only for marked for deletion cannot be replaced by creation of an indexed sequential data set. one with an equal key, because the delete code will have overlaid the first byte of The PUT macro-instruction causes a logi­ the key. cal record to be placed into an output data set in either of two modes of operation: move or locate. In the move mode, PUT moves the logical record from an input BUFFERING CONSIDERATIONS buffer or work area into an output buffer segment. In the locate mode, PUT does not move the logical record into the output The following section discusses the buf­ buffer, but places into a standard register fering facilities available with the queued the address of the buffer segment into indexed sequential access method. Descrip­ which the programmer may move that record. tions of buffer pool construction and buf­ The programmer specifies only one of these fer assignment procedures are included. modes of operation as a parameter of the DeB macro-instruction associated with the output data set.

Buffer Pool Construction PUT stores logical records sequentially by keys. As required, PUT schedules the writing of output buffers, blocks records, A buffer pool is automatically con­ creates all necessary indexes, and directs structed for a data control block when it output error recovery procedures. is opened if the programmer has not provid­ ed one prior to the conclusion of the The following operands must be specified optional data control block exit routine. in the PUT macro-instruction: The progra~~er must return this pool area to main storage when it is no longer 1. The address of the data control block required by issuing a FREEPOOL macro­ of the output data set. instruction

56 procedures. After GET has successively sisting of the English dictionary) would retrieved all records to be processed, the cause sequential search to begin with PEA system automatically passes control to the and continue to the end of the data set. programmers's end-of-data set exit speci­ Optionally, SETL also initiates retrieval fied in the data control block. of data area without keys. The SETL macro­ instruction need not be used to initiate For unblocked records, the programmer sequential reference. If a GET is issued may specify in the DeB macro-instruction and the data set is not already being that device key fields are to be retrieved sequentially referred to, sequential followed by the logical record. In the reference will be initiated at the begin­ locate mode, GET places into a standard ning of the data set. For the unblocked register the address of the record key. In formats, keys are read. the move mode, GET moves the key followed by the data of a logical record into the The following operands must be specified work area. For blocked records, a logical in the SETL macro~instruction: record is never retrieved with the key preceding the data, since key information lS always embedded within each record. 1. The address of the data control block (See Figures 18 and 21.) of the input data set. The following operands must be specified 2. The type of starting point for indexed in the GET macro-instruction: sequential reference to the data set (either key, key class, device 1. The address of the data control block address, or beginning of data set). of the input data set. 3. Optionally, retrieval of data area 2. The address of the input work area without keys. when in the move mode. 4. The address of an area containing either a key# generic key (key class), RELSE -- Release an Input Buffer or device address.

The RELSE macro-instruction causes the GET macro-instruction to ignore the remain­ ESETL -- End of Scan ing logical records in an input buffer, and to obtain logical records from the next buffer. RELSE also causes the input buffer The ESETL macro-instruction, by termi­ to become available for immediate refill­ nating anticipatory buffering, causes ter­ ing. When used with locate mode GET to mination of indexed sequential reference to refer to a data control block opened in an input data set at any specified point in UPDAT mode, RELSE prevents refilling of the the data set. buffer until its contents have been writ­ ten, if PUTX was used. RELSE does not The address of the data control block of affect buffers containing unblocked the input data set must be specified in the records. ESETL macro-instruction. The address of the data control block of Note: Reaching end of data set also termi­ the input data set must be specified in the nates sequential reference. RELSE macro-instruction.

SETL -- set Lower Limit of Scan PUTX -- Return a Logical Record

The SETL macro~instruction causes The PUTX macro-instruction causes a data indexed sequential reference to an input set to be updated-in-place by writing back data set to begin at any point in a data into the data set the same block that was set ,with a record having a specified key or previously read into a buffer. PUTX must at a specified device address, and to be preceded by a GET macro~instruction that continue sequentially by keys. SETL may is in the locate mode. If PUTX is issued also cause reference to begin at a speci­ to any logical record or records in an fied key class. A key class is a group of input buffer, the entire buffer is written keys sharing a common prefix of arbitrary back directly to the data set after input length. The name of the class is specified processing of all the records in the buffer by giving the prefix, followed by zeros, to is completed. The programmer can mark a the total key length. For example, a SETL logical record for deletion by setting its with key class PEOOO (in a data set con- delete code byte to all ones prior to

Data Access Methods 57 issuing a PUTX macro-instruction for the by providing his own exceptional condition logical record. routine and specifying its address in the DCB macro-instruction of each data set to The address of the data control block be processed. Failure to provide this associated with the input/output data set routine results in termination of the job must be specified in the PUTX macro­ step when an exceptional condition occurs. instruction.

Table 5 describes, by macro-instruction~ exceptional conditions that can occur with EXCEPTIONAL CONDITIONS the queued indexed sequential access method. The exception codes that result from these conditions are described in the The programmer can test for exceptional publication IBM System/360 Operating Sys­ conditions and take appropriate action only tem: Control Program Services.

Table 5. Exceptional Conditions With the Queued Indexed Sequential Access Method r------T------T------,I Macro-Instruction I Condition I Explanation I ~------+------+------~ GET Uncorrectable System's standard error recovery procedures encoun-I Error (Input) tered an uncorrectable error in transferring block I from secondary storage to the input buffer. System passes control to programmer's routine when GET is issued for the first logical record in the buffer containing block in error. The address of this buffer is placed into a standard register so that programmer can process the records in the buffer. Uncorrect.able System's standard error recovery procedures encoun­ Error (Update) tered an uncorrectable error in transferring a block updated-in-place (PUTX macro-instruction was used) from a buffer to secondary storage. System passes control to the programmer's routine when GET is next issued for the buffer containing the block that could not be written. The address of this buffer is placed into a standard register so that programmer can process its records. The system suspends buffer scheduling until a subsequent GET is issued. Unreachable System's standard error recovery procedures encoun­ Block (Input) tered an uncorrectable error in searching an index, or the track containing the block sought; the next block of records cannot be located. When GET is issued for the first record of the block that could not be found, the system pas s,es control to the programmer's routine. The programmer may decide to end sequential processing or terminate the job. Unreachable System's standard error recovery procedures encoun­ Block (Update) ttered an uncorrectable error in searching an index on Ithe track containing the block to be updated. When a IGET is issued for the first record in the buffer Icontaining the block that could not be written, the I system passes control to the programmer's routine. I SETL Lower Key LimitlKey or key class that programmer specified as

I'L______~ ______Not Found ~I ______parameter of SETL is not found in the data set. J (Continued)

58 Table 5. Exceptional Conditions With the Queued Indexed Sequential Access Method (Cont.) Ir------T------T------, Macro-Instruction I Condition I Explanation I ~------+------+------~ Invalid RequestlEither the programmer issued a SETL macro-instruction I Ifor a data set already being sequentially referred tol Iby the same processing program, or the buffer cannot I Icontain the key and the data, or the type specifiedl in SETL has not been requested by the programmer inl the data control block. I I Lower Device Device address that programmer specified in 'lower'l Address Limit parameter of SETL is outside the space allocated to I Invalid the data set.. I I PUT Space Not Space allocated to the data set filled; no space tol Found add records. The system passes control to thel programmer's routine when such a PUT is received. Inl the locate mode, a buffer segment address is not I provided by the system; in the move mode, the system does not move any data.

Duplicate Key Key of record to be transferred from main to secon­ dary storage duplicates the key of a record previous­ ly addressed by PUT. The system does not transfer the record to secondary storage but passes control to the programmer's routine.

Sequence Check Numerical value of the key of the record to be transferred from main to secondary storage is less than that of the key of the record previously addressed by PUT. The system does not transfer the record to secondary storage but passes control to the programmer's routine. Uncorrectable System's standard error recovery procedures encoun- Error

L ______~I ______~ ______loading the data set produces unpredictable results. J

CREATING AN INDEXED SEQUENTIAL DATA SET c. Macro-instruction reference field of the DCB macro-instruction must indicate only the PUT macro­ The programmer must follow the steps instruction. outlined below to create an indexed sequential data set: 2. Issue the OPEN macro-instruction to 1. Define the data set using the DCB open the data control block of the macro-instruction and the DD state- data set to be created. mente 3. Use the PUT macro-instruction to place a. Device must be direct access. all records or blocks of records that are to constitute the data set on the b. Data organization field of the DCB direct-access volume. macro-instruction must indicate indexed sequential (IS). 4. Issue the CLOSE macro-instruction to

Data Access Methods 59 close the data control block of the The macro-instructions of this access data set. method permit the direct retrieval of any logical record by its key, the direct The records that constitute a newly update-in-place of any logical record, and created indexed sequential data set must be the direct insertion of new logical records presented in ascending order by key. The into an indexed sequential data set. programmer can merge two or more input data sets into an indexed sequential data set; As an additional feature, the system for added flexibility, the system permits provides, for this access method, a special these data sets to be retrieved by any buffering facility called the dynamic buf­ access method using any buffering technique fer option. This option enables the pro­ provided by that access method. Once an grammer to request system buffer manage­ indexed sequential data set has been ment, and thus frees him of the created, its characteristics cannot be responsibility for coding intricate buffer changed. manipulation procedures. Furthermore, when the programmer specifies this option, the Note: PUT is the only macro-instruction system defers buffer assignment until the that can be directed to an indexed sequen­ actual data transfer is about to begin. tial data set that is being created.

PROGRAMMING NOTES RECORD FORMATS

The following section describes addi­ tional programming factors, not specif­ The basic indexed sequential access ically related to anyone macro-instruc­ method supports four block configurations: tion, that the programmer should consider before using this access method. 1. Format F, Unblocked. 2. Format F, Blocked. 3. Format V, Unblocked. 4. Format V, Blocked Direct-Access Volume Option For a discussion of record formats and other considerations refer to "Record The write validity check option., des­ Formats" in the section describing the cribed previously, is available to the queued indexed sequential access method. programmer.

Blocking of Variable-Length Records BUFFERING CONSIDERATIONS

When a PUT (locate mode) is used to The following section discusses the buf­ block variable-length records, the system fering facilities available with the basic maintains a maximum record length in the indexed sequential access method. Included data control block. When the space remain­ are descriptions of buffer pool construc­ ing in an output buffer is less than this tion and buffer assignment procedures. maximum record length, the records in the buffer are transferred as a block to secon­ dary storage and the system begins filling another buffer. To ensure that each block Buffer Pool Construction contains the maximum number of records it can accommodate, the programmer can replace the maximum record length maintained in the The dynamic buffer option, enabling the data control block with the actual length programmer to request system buffer manage­ of each record about to be transferred to ment, can be specified in the DCB macro­ an output buffer. instruction. If this option is specified, the system obtains a buffer pool when the data control block of the data set to be processed is opened. This pool is BASIC INDEXED SEQUENTIAL ACCESS METHOD automatically released when the data con­ trol block is closed.

The basic indexed sequential access Alternatively, the programmer can obtain method provides for direct storage and a buffer pool by issuing either the BUILD retrieval of the records of an indexed or the GETPOOL macro-instruction (refer to sequential data set. the section "Buffers and Buffer Pools").

60 Buffer Assignment Procedures grammer or set up dynamically by the system at the programmer's request. Normally, the fields in the data event control block are To obtain a buffer from or to return a specified as parameters of the READ macro­ buffer to a pool constructed by either the instruction (but may be subsequently BUILD or the GETPOOL macro-instruction, the replaced by parameters of other READ macro­ programmer issues either a GETBUF or a instructions addressed to the same data FREEBUF macro-instruction, respectively. event control block). (See the section RBuffer Assignment ProceduresR for the basic sequential access READ places into a standard register the method.) address of the requested logical record. To allow overlap of the input operation If the programmer has requested the with processing, READ does not wait for dynamic buffer option, he obtains a buffer input completion but returns control to the by requesting one in the READ macro­ problem program. The programmer issues a instruction. If the record for which the WAIT macro-instruction, following one or buffer is obtained is updated-in-place, the more READ requests, to delay processing buffer is automatically returned to the until input operations are complete, after pool when the programmer issues a WRITE which the programmer may test the data macro-instruction with the appropriate event control block for errors and parameter. If the record is not updated­ exceptional conditions. in-place, the programmer must release each buffer that is no longer required by A variation of the READ macro­ issuing the FREEDBUF (free dynamic buffer) instruction is provided for situations in macro-instruction. which the programmer knows that the record being read will be returned to the data set. This variation, read for update, FREEDBUF -- Free a Dynamically Obtained causes the physical location of the record Buffer just read to be retained by the system until a corresponding WRITE macro­ instruction (referring to the same data The FREEDBUF macro-instruction causes a event control block) is issued. Use of buffer that was dynamically obtained by the this technique increases performance rate system to be returned to the pool from by eliminating the need for the index which it was obtained. search normally performed by the system when executing a WRITE macro-instruction. The following operands must be specified Additions to the data set are suspended in the FREEDBUF macro-instruction: until a WRITE macro-instruction has been received for each outstanding record read 1. The address of the data event control for update. block associated with the READ macro­ instruction that caused the buffer to The following two operands must be be obtained. specified in the READ macro-instruction: 2. A type parameter specifying the access 1. The address of the data event control method that is being used. block (DECB) associated with the READ macro-instruction. 3. The address of the data control block of the data set. 2. The type of input operation (normal reading; optionally, it can be read for update). MACRO-INSTRUCTIONS The following operands are required in READ macro-instructions that place the cor­ responding fields into a data event control The following macro-instructions are block. In subsequent READ macro­ provided by the basic indexed sequential instructions, they may optionally be access method for input/output operations. specified to override the previously speci­ fied values. If an operand is omitted, the system assumes its value is already in the READ -- Retrieve a Logical Record data event control block. 3. The address of the data control block The READ macro-instruction causes the of an input data set. block containing a logical record with a specified key to be transmitted from an 4. Either the address of an input area or input data set to a main storage area. an indication that the system is to This area is either specified by the pro- obtain this area.

Data Access Methods 61 5. Either the number of bytes to be The ~ollowing operands are required in transmitted or an indication that the WRITE macro-instructions that place the record length in the data control corresponding fields into a data event block is to be used. An overriding control block. In subsequent WRITE macro­ length must not exceed the length instructions, they may optionally be specified in the data control block of specified to override the previously speci­ the input data set. fied values. If an operand is omitted, the system assumes ltS value is already in the 6. The address of an area containing the data event control block. key of the record to be read. 3. The address of the data control block Note: A buffer area must be large enough of an output data set. to accommodate the block containing the logical record. 4. The address of an output area. If the output area is one that was obtained dynamically by the system in a pre­ vious READ macro-instruction, an indi­ WRITE -- Write a Logical Record cator placed in this parameter causes the area to be returned to the pool after the WRITE completes. The cor­ The WRITE macro-instruction requests responding field in the DECB must that a logical record or a block be trans­ contain the address of the area. mitted from a main storage area to an existing data set. WRITE may be used to 5. Either the number of bytes to be update or replace existing records or to transmitted or an indication that the add new records. record length in the data control block is to be used. An overriding Prior to issuing WRITE for updating or length must not exceed the length replacing a logical record within a block specified in the data control block of of such records, the programmer must issue the output data set. a READ macro-instruction for that record. When replacing an unblocked record, the 6. The address of an area containing the programmer need not issue a corresponding key of the record to be written~ READ and must not attempt to replace the record with one of greater length. When Notes: Since the basic indexed sequential adding a record, the programmer must be access method has no facilities for crea­ certain that the key of the new record is tion of indexes, the WRITE macro­ either unique or equal to the key of a instruction cannot be used to place records record with an active delete code. into new output data sets but must be used with existing data sets. The queued Normally, the fields in the data event indexed sequential access method macro­ control block are specified as parameters instruction PUT places records into new of WRITE (but may be subsequently replaced indexed sequential data sets. by parameters of other WRITE macro­ instructions addressed to the same data A programmer can mark a logical record event control block). for deletion by setting its delete code byte to all ones prior to issuing the WRITE WRITE stores records by keys. To allow macro-instruction for the block containing overlap of the output operation with the logical record. processing, WRITE does not wait for output completion but returns control to the prob­ lem program. The programmer issues a WAIT EXCEPTIONAL CONDITIONS macro-instruction to delay processing until output operations are complete. The pro­ grammer may then tes.t the data event con­ When an exceptional condition that trol block for errors and exceptional con­ cannot be corrected by the system standard ditions. error recovery procedures results from a read or write operation, the system sets an The fd1lowing two operands must be spec­ exception code in the data event control ified in the WRITE macro-instruction: block. The programmer is responsible for examining the data event control block for 1. The address of the data event control exceptional conditions, and taking block (DECB) associated with the WRITE appropriate action, if required. The for­ macro-instruction. mat of the exception code and the excep­ tional conditions that can result from a 2. The type of output operation (either read or write operation are described in replacement of existing records or the publication IBM System/360 Operating addition of new records). System: Control Program Services.

62 REORGANIZING AN INDEXED SEQUENTIAL DATA SET Direct-Access Volume Option

As new records are added to an indexed The write validity check option, sequential data set, overflow chains may be described previously, is available to the created. The access time for retrieving programmer. records in an overflow area is greater than that required for retrieving other records. Therefore, when many overflow records develop, input/output performance is shar­ ply reduced. For this reason, the program­ BASIC DIRECT ACCESS METHOD mer should reorganize indexed sequential data sets as soon as the need becomes evident. The system maintains a set of The basic direct access method is the statistics to assist the programmer in most flexible of those access methods that determining when reorganization is are provided specifically for use with required. direct-access devices. Using this access method, the programmer can directly store These statistics are maintained as and retrieve a block by specifying either fields of the data control block, and can its actual device address, its relative be tested by the programmer when he proc­ position within a data set

Data Access Methods 63 provided. Exclusive control can be Alternatively, the programmer can obtain requested by the programmer as a parameter a buffer pool by issuing either the BUILD of the READ macro-instruction. or the GETPOOL macro-instruction (refer to the section "Buffers and Buffer Pools"). The extended search option enables the programmer to request that the system extend its search for a record, or for space in which to add a record" beyond the Buffer Assignment Procedures relative track or relative record address specified in a READ or WRITE macro­ instruction. To obtain a buffer from or to return a buffer to a pool constructed by either the BUILD or the GETPOOL macro-instruction, the programmer issues either a GETBUF or a FREEBUF macro-instruction, respectively. RECORD FORMATS (See the section "Buffer Assignment Procedures" for the basic sequential access method. ) The basic direct access method supports five block configurations: If the programmer has requested the dynamic buffer option, he obtains a buffer 1. Format U. by requesting one in the appropriate param­ 2. Format F, Unblocked. eter of the READ macro-instruction. If the 3. Format F, Blocked. block for which the buffer is obtained is 4. Format V, Unblocked. updated-in-place, the buffer is auto­ 5. Format V, Blocked. matically returned to the pool when the programmer issues a WRITE macro-instruction All blocks are treated as the object of with the appropriate parameter. If the an input or an output request. Although block is not updated-in-place, the program­ the basic direct access method does not mer must release each buffer that is no provide blocking/deblocking of records, the longer required by issuing the FREEDBUF resources of the system permit the (free dynamic buffer) macro-instruction. programmer to code these routines, if (Refer to the section "Buffer Assignment required, with a minimum of effort. Procedures" for the basic indexed sequen­ tial access method.) For format V blocks in the basic direct access method" the first eight bytes of a block (four containing block control infor­ mation and four containing record control MACRO-INSTRUCTIONS information) must be provided by the pro­ grammer,. The following macro-instructions are provided by the basic direct access method for input/output operations.

BUFFERING CONSIDERATIONS READ -- Read a Block

The following section discusses the buf­ fering facilities available with the basic The READ macro-instruction requests that direct access method. Included are des­ a block be transmitted from an input data criptions of buffer pool construction and set to a main storage area. The input area buffer assignment procedures. may be either specified by the programmer or set up and released by the system as required. Normally, the fields in the data event control block are specified as param­ Buffer Pool Construction eters of the initial READ macro­ instruction, but may be replaced by parameters of subsequent READ macro­ ~he dynamic buffer option, enabling the instructions addressed to the same data programmer to request system buffer manage­ event control block. To allow overlap of ment, can be spectfied in the DCB macro­ the input operation with processing, READ instruction. If this option is specified, does not wait for input completion, but the system obtains a buffer ·pool when the returns control to the problem program. data control block of the data set to be The programmer issues a WAIT macro­ processed is opened. This pool is instruction, following one or more READ automatically released when the data con­ macro-instructions, to delay processing trol block is closed. until input operations are completed.

64 The following two operands must be 7. The address of the field containing specified in the READ macro-instruction: either an actual or a relative address of an input block. If the feedback 1. The address of the data event control option is used, the system places the block associated with the READ macro­ actual or relative address of the instruction. input block into this field.

2. The type of block reference for input. Notes: The following notes apply to READ: This parameter indicates not only how the block is to be found, but also 1. When exclusive control is specified., what portion of the block can be read feedback of the actual address of into the input area. The block blocks is automatically provided, reference is specified as either block unless relative track or relative identification or block key. If block block feedback is specified in the identification is specified, both the data control block. block key and the data portion of the block can be read (not necessarily 2. When the type of block reference is into contiguous areas). If block key block identification, the system does is specified, only the data portion of not provide the extended search a block can be read. Optionally, option. exclusive control of input blocks or feedback of relative block addresses may be specified if these options are included in the data control block of WRITE -- Write a Block the input data set. The following parameters are required in The WRITE macro-instruction requests READ macro-instructions that initially that a block be transmitted from a ma1n place the corresponding fields into a data storage area to an output data set. Nor­ event control block. In subsequent READ mally., the fields in the data event control macro-instructions, the parameters may be block are specified ~s parameters of the optionally specified to override the pre­ WRITE macro-instruction but may be replaced viously specified values. When a parameter by parameters of subsequent WRITE macro­ is omitted, the system assumes its value is instructions addressed to the same data already in the data event control block. event control block. To allow overlap of the output operation with processing, WRITE 3. The address of the data control block does not wait for completion of the of an input data set. operat1on, but returns control to the prob­ lem program. The programmer issues a WAIT 4. The address of an input area. If the macro-instruction to delay processing until dynamic buffer option is included in output operations are completed. the data control block of the input data set, an indication that the sys­ The following two operands must be spec­ tem is to obtain the input area. ified in the WRITE macro-instruction: (When control is returned from READ, the system leaves the address of the 1. The address of the data event control input area it obtained in the corres­ block associated with the WRITE macro­ ponding DECB field.) instruction. 5. Either the number of bytes to be 2. The type of block reference for transmitted or an indication that the output. This is specified as either block length provided by the data block identification, block key, or an control block is to be used. An indication that new blocks are to be overriding length must not exceed the added. This parameter indicates not length specified in the data control only how the system is to determine block of the input data set. where the block is to be stored, but also how much of the block can be 6. If block reference is block key, the written. If block identification is address of a field containing the key specified, both block key and data can of the block to be read. If block be written. If block key is speci­ reference is block identification, the fied, only the data portion of a block address of a field into which the key is written. If new undefined or is to be read. If the system is to variable-l~ngth blocks are to be added obtain the input area, an indication to an output data set, the count field that block key (followed by data) is of each block (provided by the system to be read into this area. A value of automatically) and the data portions zero for this parameter indicates that are written. Writing the key field is block keys are not to be read. optional, but if this option is

Data Access Methods 65 selected, all blocks must be written the WRITE macro-instruction that new with keys. If new fixed-length blocks blocks are to be added. The block are added to an output data set, the reference determines the track for the count field is not written; however, new block. When block format is the key field must be written. specified in the data control block as V or U, the system determines, from The following parameters are required in the capacity record, whether the new WRITE macro-instructions that initially block will fit. If the block fits, it place the corresponding fields into a data is written following the last block event control block. In subsequent WRITE currently on the track, and the capac­ macro-instructions, the parameters may be ity record is updated. For fixed­ optionally specified to override previously length blocks (which must have keys if specified values. If a parameter is omit­ the add feature is to be used), the ted, the system assumes its value is system searches the track for a dummy already in the data event control block. block

66 appropriate remedial action, if required. programmer's request. If a request cannot The format of the "exception code" and the be satisfied, the system sets an exception­ exceptional conditions that can result from al condition code in the appropriate data a read or write operation are described in event control block. It should be noted the publication IBM System/360 Operating that if the system cannot satisfy a search System: control Program Services. request after searching the highest rela­ tive track, it continues the search from the first relative track. EXCLUSIVE CONTROL This option cannot be used if the type of record reference of the READ or WRITE macro-instruction is record identification, Exclusive control provides effective or if actual addressing of records is protection for a block only when exclusive indicated in the data control block. control has been specified for all macro­ instructions directed to the data set for updating operations. CREATING DIRECT DATA SETS When this condition has been met, the system permits only one input operation that specifies exclusive control to be To create a direct data set, the pro­ performed. on a given block at a given time. grammer must use the basic sequential Other requests to read that block are access method macro-instructions to set up de£erred until the block has been released capacity records and track formats of the from exclusive control. For a block being direct-access volume assigned to the data updated-in-place, the programmer can set and, optionally, to write the data set release exclusive control by 1ssuing a blocks. Procedures for creating a direct WRITE macro-instruction for that block. If dataset differ according to block formats. a block is read and not updated-in-place, the programmer can use the RELEX macro­ instruction to release control. Format F Blocks With Keys Exclusive control, although an optional feature, should be requested by programmers updating records in a multi-tasking All tracks for a direct data set with environment. If only read operations are fixed-length keyed blocks must be filled to be performed, exclusive control need not sequentially by either actual data set be requested. It should be noted that READ blocks or "dummy" blocks of the same requests, for which exclusive control has length. The programmer issues the basic not been specified, are not affected by the sequential access method macro-instruction exclusive control requests of other macro­ WRITE to specify whether an actual or a instructions. The programmer can therefore dummy block is to be written. The system read a block that is concurrently being writes a dummy block with all ones in the updated in exclusive status. first byte of the key field to indicate to the basic direct access method that a block can be added in the space allocated to the dummy block. (The programmer may not add EXTENDED SEARCH OPTION actual data set blocks with keys whose first bytes are all ones.) The extended search option enables the After the final block on a track is programmer to request that the system written, the basic sequential access method extend its search for a record, or for causes the capacity record to be written space in which to add a record, beyond the and proceeds to the next track. When a relative track or relative record address WRITE macro-instruction is issued after all specified in a READ or WRITE macro­ tracks initially allocated to the data set instruction. are filled, the basic sequential access method causes additional space to be To use the extended search option, the obtained and continues to fill tracks if programmer must indicate in the DCB macro­ secondary allocation was specified. instruction the number of tracks (including the starting track) or records (including The programmer can determine whether the the starting record) that are to be space initially allocated has been exhaust­ searched. If this number is equal to or ed by checking the standard register that greater than the number of tracks allocated provides this information. The basic to the data set or the number of records sequential access method also causes an within the data set, the entire data set is indication of whether or not a track is searched in the attempt to satisfy the full to be placed in the register unless

Data Access Methods 67 the track overflow option has been speci­ are filled, the basic sequential access fied. This indication is useful, for exam­ method causes additional space to be ple" when the programmer needs to know obtained and continues to fill tracks if whether to complete a track with dummy secondary allocation was specified. blocks.

No~e: Since direct data sets are created uSlng the macro-instructions of the basic Format F Blocks Without Keys sequential access method, the programmer can transfer direct data set blocks (in physical sequential order) from secondary The procedure for creating a direct data to main storage, using the basic sequential set with fixed-length blocks without keys access method READ macro-instruction. If is identical to that described for keyed the programmer uses this macro-instruction, blocks except that dummy blocks cannot be neither capacity records nor the count area written. The programmer must fill all of the data blocks will be transferred; key tracks for the data set with actua~ blocks areas, if requested and present, will be. by issuing the basic sequential access All blocks, including dummy blocks, are method macro-instruction WRITE. transferred. When creating a direct data set, each WRITE (capacity record) and WRITE macro­ Formats V and U Blocks instruction must be followed by a CHECK macro-instruction.

To create a direct data set with blocks of variable or undefined length, the pro­ grammer may write any desired blocks on the PROGRAMMING NOTES track by using the basic sequential access method macro-instruction WRITE. He then issues, for that track, a special form of The following section describes the WRITE macro-instruction that causes the additional programming factors, not specif­ system to fill unused space with zeros and ically related to anyone macro­ write the capacity record. (Throughout the instruction, that the programmer should remainder of this section, this form is consider before using this access method. referred to as the WRITE (capacity record) macro-instruction.) The next WRITE macro­ instruction issued writes blocks on the following track. Split Cylinder Mode When a WRITE macro-instruction is issued for a block that cannot be accommodated on Split cylinder space allocation cannot the remaining track space, the block is not be used for a data set created for use with written. The programmer can determine the basic direct access method, i.e., the whether the block was written by testing a data set cannot share cylinders with other standard register containing this indica­ data sets using this allocation technique. tion. The programmer can then issue the WRITE (capacity record) macro-instruction, and reissue the WRITE macro-instruction to place the block on another track. Direct-Access Volume Options When a WRITE (capacity record) macro­ instruction is issued as the first The track overflow and write validity operation on a track, the entire track is check options, described previously, are cleared. When a WRITE (capacity record) available to the programmer. The track macro-instruction is issued after all overflow option, however, can be used only tracks initially allocated to the data set with format F blocks.

68 Absolute generation names 12 for QISAM 56 Access methods for QSAM 38 (see data access methods) use of dynamic buffer option 61,64 Aliases 51 use of FREEBUF 45 use of FREEDBUF 61 use of GETBUF 45 Basic direct access method (BDAM) 32,63 Buffering buffer assignment procedures 64 anticipatory 31 buffer pool construction procedures 64 dynamic buffer option 60,64 dynamic buffer option 64 exchange 38 exclusive control 67 simple 38 extended search option 67 Buffer pool construction procedures macro-instruction usage 64 assembly time 35 OPEN modes (data set usage) 34 dynamic buffer option 60,64 Basic indexed sequential access method for BDAM 64 (BISAM) 32,60 for BISAM 60 buffer assignment procedures 61 for BSAM 45 buffer pool construction procedures 60 for QISAM 56 dynamic buffer option 60 for QSAM 37 macro-instruction usage 61 object time 35 Basic partitioned access method (BPAM) use of BUILD 35 32,49 use of FREEPOOL 36 compatibility with sequential access use of GETPOOL 35 methods 52 Buffer pools 35 creation of partitioned data set 51 Buffer segment 35 macro-instruction usage 49 Buffers OPEN modes (data set usage) 34 assignment procedures, Basic sequential access method (BSAM) (see buffer assignment procedures) 32,44 definition 35 buffer assignment procedures 45 BUILD macro-instruction 35,38,45,56,60,64 buffer pool construction procedures 45 data format--device type relationships 36 Capacity records 36,68 input/output devices--macro-instruction Card punches 36 relationships 49,50 Card readers 36 macro-instruction usage 45 Catalog OPEN modes (data set usage) 34 control volumes 9 read backwards considerations 49 definition 9 update-in-place considerations 48 generation data groups 10 use in creating direct data set 67 indexes 10 Basic telecommunications access method procedure for cataloging data sets 10 (BTAM) 32 procedure for cataloging generation data BDAM groups 12 (see basic direct access method) Catalog indexes BISAM structure of 10 (see basic indexed sequential access volume index 10 method) Cataloging procedures BLDG statement 12,13 data sets 10 BLDL macro-instruction 51 generation data groups 12 Block 20 Chained scheduling BPAM use in BSAM 37 (see basic partitioned access method) use in QSAM 37 BSAM CHECK macro-instruction (see basic sequential access method) use in BPAM 51 BSP macro-instruction 48 use in BSAM 46 BTAM use in creating direct data sets 68 (see basic telecommunications access Checkpoint data control block 30 method) CLOSE macro-instruction Buffer assignment procedures function 33 for BDAM 64 volume dispOSition options 33,34 for BISAM 61 CLOSE (TYPE=T) for BSAM 45 macro-instruction 33

Index 69 CNTRL macro-instruction master password 13 use in BSAM 47 PASSWORD data set 13 use in QSAM 41 Data sets Concatenated data sets cataloging of 9,10 use in BPAM 52 concatenation of 43,49,52 use in BSAM 49 creation of direct 67 use in generation data groups 12 creation of indexed sequential 59 use in QSAM 43 creation of partitioned 51 Control character (C) 21 definition of 9 Control volumes 9 definition procedure 27 definition 10 naming procedures 9 use of 10 PASSWORD 13 COpy PDS statement 23 security 13 Cylinder index 24 storage 13 use (mode of OPEN) 34 Da;ta access methods Data storage procedures basic direct (BDAM) 32,63 direct-access volumes 13 basic indexed sequential (BISAM) 32,60 magnetic tape volumes 15 basic partitioned (BPAM) 32,49 DCB macro-instruction basic sequential (BSAM) 32,44 function 29 basic telecommunications (BTAM) 32 relationship to DD statement 30 classification of 32 type of information in 29 definition of 31 use in data control block fill-in queued indexed sequential (QISAM) 32,53 process 28,29 queued sequential (QSAM) 32,37 use in data set definition procedure 27 queued telecommunications (QTAM) 32 DCBD macro-instruction 30 Data contrpl block 9 Delete code 55 checkpoint 30 Direct-access labels definition of 27 data set label (data set control block) exit routine 30 19 fill-in process 28 user label group 19 opening of 28 volume label group 18 Data definition (DD) statement 9 Direct-access storage space allocation relationship to DCB macro-instruction by absolute address 15 30 by blocks 14 use in data control block fill-in by cylinders 14 process 28 by tracks 14 use in data set definition procedure 27 method of 14 Data event control block (DECB) of split cylinders 14 exception codes 62,66 options 15 function of 32 Direct-access volumes 36 relationship to READ and WRITE 32 data set storage procedures 14 Data set control block (DSCB) 14,19 initialization of 14 Data set definition procedures 27 labels 18 use of data control block exit routine space allocation procedures 14,15 30 volume table of contents (VTOC) 14 use of DCB macro-instruction 29 Direct data set use of DD statement 27 creation of 67 use of labels 28 description 26 Data set labels Directory of partitioned data set 23 for direct-access volumes (DSCB) 18 Dynamic buffer option for magnetic tape volumes 16 use in BDAM 64 sources of information for 28 us e in BISAIVJ. 60 use in data control block fill-in process 27,28 End-of-data set routine 29 Data set names Error analysis routine (synchronous error function of 9 exit) 29,42 relationship to catalog index levels 10 Error conditions for BSAM 48 rules for 9 Error conditions for QSAM 42 Data set organizations 22,32 ESETL macro-instruction 57 direct 22,26 Exceptional conditions indexed sequential 22,23 in BDAM 66 partitioned 22 in BISAM 62 selection criteria 22 in QISAM 58 sequential 22 EXCP macro-in$truction 32 telecommunications 22,27 Exchange buffering 38 Data set security facility Exclusive control 67 function 13 Execute channel program 32

70 Exit list 29 Language for queued access 31 Exit routines Locate mode address of checkpoint data control use in QISAM 56,60 block 30 use in QSAM 39,40 data control block 30 Logical records 20 standard user label 30 Extended search option 67 Macro-definition library 51 FEOV macro-instruction Macro-instruction languages use in BSAM 47 for basic access 31 use in QSAM 41 for queued access 31 FIND macro-instruction 49 Macro-instructions Fixed-length format (F) records 20,,53,54 BLDL 51 FREEBUF macro-instruction 45,61,64 BSP 48 FREEDBUF macro-instruction BUILD 35,38,45,56,60,64 use in BDAM 64 CHECK 46 use in BISAM 61 CLOSE 33 FREEPOOL macro-instruction 36,38,45,56 CLOSE (TYPE=T) 33 CNTRL 41,47 Generation data groups DCB 29 cataloging of 12 DCBD 30 concatenation of 12 ESETL 57 definition of 12 EXCP 32 generation names 12 FEOV 41,47 generation numbers 12 FIND 49 index for 12 FREEBUF 45,61,64 Generation names 12 FREEDBUF 61,64 Generation numbers 12 FREEPOOL 36,38,45,56 GET macro-instruction GET 31,39,56 use in language for queued access 31 GETBUF 45,61,64 use in QISAM 56 GET POOL 35,38,45,56,60,64 use in QSAM 39 NOTE 47 GETBUF macro-instruction 45,61,64 OPEN 33 GET POOL macro-instruction POINT 47 35,38,45,56,60,64 PRTOV 42,47 PUT 31,40,56 Indexed sequential data set PUTX 40,51 creation of 59 READ 31,45,61,64 cylinder index 24 RELEX 66 description of 23 RELSE 40,57 master index 24 SETL 57 overflow area 25 STOW 51 reorganization of 63 TRUNC 41 space allocation procedures for 25 WAIT 46 track index 24 WRITE 31,46,,62,65,68 Indexes Magnetic tape, unlabeled 15 catalog 10 Magnetic tape labels cylinder 24 data set header group 16 master 24 data set trailer group 17 track 24 nonstandard 17 volume 10 organization of 17 Input/output block (lOB) 32 standard 16 Input/output devices user header group 16 card readers and punches 36 user label exit routine 30 direct-access 36 user trailer group 17 magnetic tape 36 volume label group 16 paper tape reader 36 Magnetic tape volumes 36 printers 36 data storage procedures 15 labels 16 Job file control block (JFCB) 27,28,33 Master index 24 Member 22 Key class 51 Move mode Keys 23,53,54,55 use in QISAM 56 use in QSAM 39,40 Labels 15 direct-access 18 Names magnetic tape 16 data set 9 Language for basic access 31 generation data group 12

Index 71 Nonstandard tape labels 15,17 Read backwards NOTE macro-instruction 47 BSAM considerations 49 QSAM considerations 44 READ macro-instruction OPEN macro-instruction use in BDAM 64 function 33 use in BISAM 61 modes (data set usage) 34 use in BSAM 45 volume disposition options 33,34 use in language for basic access 31 Overflow areas Record blocking cylinder 25 definition of 20 description of 25 variable-length records 21 independent 25 Record formats 19,37,44,49,53,60,64 Overflow records fixed-length (F) 20 indication of in BISAM 63 selection criteria 20 indication of in QISAM 54 undefined (U) 21 organization of 55 variable-length (V) 21 Reenterability 31 Relative generation numbers 12 Paper tape reader 36 RELEX macro-instruction 66 Partitioned data set RELSE macro-instruction creation of 51 use in QISAM 57 description 22 use in QSAM 40 directory 23 member 22 space allocation procedures 23 Sequential data set PASSWORD data set 13 description 22 POINT macro-instruction 47 space allocation procedures for 22 Printer 36 use 22 PRTOV macro-instruction SETL macro-instruction 57 use in BSAM 47 simple buffering 38 use in QSAM 42 Space allocation 14 PUT macro-instruction Split cylinder option 14,68 use in language for queued access 31 STOW macro-instruction 51 use in QISAM 56 Substitute mode 39,40 use in QSAM 40 Synchronous error exit routine 29,42 PUTX macro-instruction use in QISAM 57 use in QSAM 40 Telecommunications data set 27 Track index 24 Track overflow option 15.,43,48,68 Q.ISAM TRUNC macro-instruction 41 (see queued indexed sequential access method) QSAM Undefined format (U) records 21 (see queued sequential access method) Unlabeled magnetic tape 15 QTAM Update-in-place considerations 43,48 (see queued telecommunications access method) Queued indexed sequential access method Variable-length format (V) records (QISAM) 32,53 blocking of 21,44,60 buffer assignment procedures 56 description 21,54 buffer pool construction procedures 56 Volume disposition options 33,34 macro-instruction usage 56 Volume index 10 Queued sequential access method (QSAM) Volume initialization 14 32,37 Volume serial number 13,15 buffer assignment procedures 38 Volume table of contents (VTOC) 14 buffering techniques 38 Volumes 13 buffer pool construction procedures 31 direct-access 13 data format--device type relationships magnetic tape 15 36 macro-instruction usage 39 OPEN modes (data set usage) 33,34 WRITE macro-instruction read backwards considerations 44 use in BDAM 65,68 update-in-place considerations 43 use in BISAM 62 Queued telecommunications access method use in BSAM 46 (QTAM) 32 use in language for basic access 31 Write validity check option 15,43,48,60,63,68

72 READER'S COMMENTS

Title: IBM System/360 Operating System Form: C28-6537-1 Data Management

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 an introduction to the subject For additional knowledge Other ______fole

Please check the items that describe your position: _ Customer personnel _ Operator _ Sales Representative ___ IBM personnel _ Programmer _Systems Engineer ___ Manager _Customer 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) _ Error on page (s)

Explanation:

fole

Name ______

Address ______

FOLD ON TWO LINES,STAPLE AND MAIL No Postage Necessary if Mailed in U.S.A. Form C28-6531-1 staple st

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. J I 1IIII1 II1II1 POSTAGE WILL BE PAID BY IIIIII IBM CORPORATION P.O. BOX 390 IIIII1 POUGHKEEPSIE, N. Y. 12602 IIIII1 ATTN: PROGRAMMING SYSTEMS PUBLICATIONS 111111 DEPT. 058 IIII11 fold

t"O I'i f-J. :::J rt ro 0.. f-J. ::;l .c .en ~

n I'V 00 I 0\ U'1 w ..J I ~ ~rnoo