Y28-6604-1

Program Logic

IBM System/360 Sequential Access Methods

Program Number 3S0S-DM-50B

This publication describes the internal logic of the routines of the queued sequen­ tial , the basic sequential access method, and the basic partitioned access method of IBM System/360 Operating System. Program Logic Manuals are intended for use by IBM customer engineers involved in program maintenance, and by system pro­ grammers involved in altering the program design. Program logic information is not necessary for program operation and use; therefore, distribution of this manual is limited to persons with program maintenance or modification responsibilities.

Restricted Distribution PREFACE

This publication describes the sequen­ • Buffer pool management routines that tial access method facilities in IBM Oper­ furnish buffer space in main storage. ating System/360. It describes routines in five categories: PREREQUISITE PUBLICATIONS • Queued sequential access method rou­ tines that cause storage and retrieval Knowledge of the information in the of data records arranged in sequential following publications is required for an order .• understanding of this publication: • Basic sequential access method routines IBM system/360 Operating System: Data that cause storage and retrieval of Management, Form C28-6537 data blocks arranged in sequential order. IB,M Systerol360 Operating System: Intro­ duction to Control Program Logic. Pro­ • Basic partitioned access method rou­ gram Logic Manual, Form Y28-6605 tines that cause storage and retrieval of data blocks in a member of a parti­ tioned , and construct entries and search for entries in the directory RECOMMENDED READING of a partitioned data set. The publication IBM System/360 Operating • Executors that operate with System: Control Program SerVices, Form input/output supp~rt routines. C28-6541, provides useful information.

Second Edition (January 1967) This publication is a major revision of Form Y28-6604-0 and obsoletes it. Significant additional material has been added; material released in a Technical Newsletter has been included, and prior material has been updated.

This publication was prepared for production using an IBM computer to update the text and to control the page and line format. Page impressions for photo-offset printing were obtained from an IBM 1403 Printer using a special print chain. Copies of this and other IBM publications can be obtained through IBM Branch Offices. A form for readers' 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 CONTENTS

INTRODUCTION • • • • • • 7 Track Overflow Asynchronous Error Processing Module IGG019C1 • • 46 QUEUED SEQUENTIAL ACCESS METHOD ROUTINES. • • • • • • • • 10 Appendages • • • • • • • • • • • • 47 End-of-Extent Appendages. • • 48 GET Routines • • • • • • • ••• • • 11 Appendage IGG019AW Simple Buffering GET Routines 12 (End-of-Extent - Update - QSAM) 48 GET Module IGG019AA. ••• • • 13 Appendage IGG019BM GET Module IGG019AB. • • 14 (End-of-Extent - Update - BSAM) 50 GET Module IGG019AC. • • • • 15 Appendage IGG019CH GET Module IGG019AD. • • 15 (End-Of-Extent - Ordinary). • 50 GET Module IGG019AG Appendage IGG019CZ (CNTRL - Card Reader) • • • 16 (End-of-Extent - Chained GET Module IGG019AH Channel-Program Scheduling) 50 (CNTRL - Card Reader) • • • • 16 start I/O (SIO) Appendages. • •• 51 GET Module IGG019AM (RDBACK) ••• 17 Appendage IGG019CG (SIO - GET Module IGG019AN (RDBACK) ••• 17 Update) • • • • • • • • • •• 51 GET Module IGG019AT (Paper Tape Appendage IGG019CL (SIO - PRTOV) • 51 Character Conversion) • • • 18 Channel End Appendages •••••••• 51 Exchange Buffering GET Routines • 19 Appendage IGG019CI (Channel End GET Module IGG019EA. • • • • 20 - Fixed-Length Blocked Record GET Module IGG019EB. • 20 Format) • • • • • • • • • • •• 52 GET Module IGG019EC. • • • • • 21 Appendage IGG019CJ (Channel End GET Module IGG019ED. • • • 21 - Variable-Length Record Update Mode GET Routine • • 22 Format) ••••••••••••• 52 GET Module IGG019AE. • • 24 Appendage IGG019CK (Channel End - SYSIN) ••••••••••••• 53 PUT Routines • • • • • • • • • • • • • • 25 Appendage IGG019CS (Channel End Simple Buffering PUT Routines • • • • 25 - Paper Tape) . • • • • •• • 53 PUT Module IGG019AI. • • • • 27 Program Controlled Interruption PUT Module IGG019AJ. • 27 (PCI) Appendage (Execution of PUT Module IGG019AK. • • • 28 Channel Programs SCheduled by PUT Module IGG019AL. • • • • • 29 Chaining). • • • • • • • • •• • 53 Exchange Buffering PUT Routines • • • 29 Appendage IGG019CU (Channel End, PUT Module IGG019EE. • • 30 PCI, Abnormal End - Chained PUT Module IGG019EF. • • • 31 Channel-Program Execution). • 54 Update Mode PUTX Routine.. • • • • • 33 Abnormal End Appendages • • •• • 55 Appendage IGG019C3 (Abnormal End End-of-Block Routines. •• • • • • • 33 - Track Overflow) • • • • •• • 55 Ordinary End-of-Block Routines. • • • 33 End-Of-Block Module IGG019CC • 34 QSAM Control Routines. • • • • • -.. • 56 End-of-Block Module IGG019CD • • • 35 Control Module IGG019CA

Open Executors • .• • '. • • • • • • • 18 APPENDIX E: FEOV EXECUTOR IGC0003A Stage 1 OPEN Executors •••••••• 18 (SVC 31) - OPERATION FOR OUTPUT UNDER Stage 1 OPEN Executor IGG0191A • • 18 QSAM. • • • • • • •• 109 Stage 1 OPEN Executor IGG0191B • • 78 Stage 1 OPEN Executor IGG0191C INDEX •• •••• 113 (and Dummy Data Set Module IGG019AV) • • • • • • • • • • • • 19

"'. ILLUSTRATIONS

FIGURES

Figure 1. Flow of Control in QSAM, Figure 10. Flow of Control - SAM OPEN BSAM, and in BPAM for Members • • • 8 Executor. • • • • • . • . 77 Figure 2. Flow of Control in QSAM • • • 11 Figure 11. Flow of Control To and Figure 3. Order of Records Using GET Frore the SYNAD/EOV Executor Routines for Data Sets Opened for (IGC0005E) in QSAM. • • • •• • •• 89 RDBACK (IGG019AM,IGG019AN) ••••••• 18 Figure 12. Flow of Control To and Figure 4. The Two Parts of an update Frore the SYNAD/EOV Executor Channel Program (Empty, Refill) •••• 23 (IGC0005E) in BSAM. • • • • • • • 89 Figure 5. Relation of Seek Addresses Figure 13. Buffer Pool Control Block •• 92 in Three Successive QSAM Update Figure 14. GETPOOL Buffer Pool Channel Programs. • •• • ••••• 23 Structures. • • • • . • • • 92 Figure 6. comparison of the ICB SAM Figure 15. BUILD Buffer Pool Prefixes for Normal and for Chained Structures. • • • • . • • •• 93 Scheduling. • • • • • • • • • • •• • 36 Figure 16. QSAM Control Blocks. • .106 Figure 7. Track Overflow Records.. • • • 41 Figure 17. BSAM Control Blocks ••••• 107 Figure 8. Relationship of I/O Figure 18. Flow of Control Between Supervisor and Appendages • • • • • • • 47 the FEOV Executor and Other Control Figure 9. Flow of Control in BSAM . 58 Prograre Routines ••••.•.••.•. 110

TABLES

Table 1. Flow of Control of QSAM Table 15. Control Routines That Are Routines. • • • • • .• • • • • • •• 10 Macro-Expansions ••••••••• , 56 Table 2. Module Selector - Simple Table 16. Flow of Control of BSAM Buffering GET Modules • • • • • • • • • 14 Routines ••.•••••••••.••• 59 Table 3. Module Selector - Exchange Table 17. Module Selector - READ and Buffering GET Modules ••••••••• 20 WRITE Modules • • • • • • • • • •• 60 Table 4. Module Selector - Update Table 18. Module Selector - CHECK Mode GET Module • • • • • • • • • • 24 Modules • • • • • • • • • • • • • 64 Table 5. Module Selector - Simple Table 19. Module Selector - Control Buffering PUT Modules • • • • • • 27 Modules Selected and Loaded by the Table 6. Module Selector - Exchange OPEN Executor • • • • • • • • • •• • 66 Buffering PUT Modules • • • • • •• 30 Table 20. Control Modules Loaded at Table 7. Module Selector - Ordinary Execution Time. • • • • • • . • 67 End-of-Block Modules. • • • • • • •• 34 Table 21. Control Routines That Are Table 8. Comparison of the lOB SAM Macro-Expansions •••••••• 67 Prefixes for Normal and for Chained Table 22. BPAM Routines Residence • 72 Scheduling. • • • • _ • • • • • • • • • 37 Table 23. sequential Access Method Table 9. Module Selector- Chained Executors - Control Sequence. • • • • 76 Channel-Program Scheduling Table 24. OPEN Executor Selector - End-of-Block Modules. • • • 38 Stage 1 OPEN Executors ••••••• • • 78 Table 10. Module Selector - Track Table 25. OPEN Executor Selector - Overflow End-of-Block Module. • • • 41 Stage 2 OPEN Executors ••••••• • • 80 Table 11. Module Selector - Table 26. OPEN Executor Selector - Synchronizing and Error Processing Stage 3 OPEN Executors ••••••• • • 85 Modules • • • • • • • • • • • • • 44 Table 27. CLOSE Executor Selector. 87 Table 12. Module Selector - Track Table 28. BUILD Buffer structuring Overflow Asynchronous Error Table • • • • • • • • • • . • . • • Processing Module • • • • • • • • • 44 Table 29. Path and Sequence of Table 13. Module Selector - Control of the FEOV Executor and Appendages ••••••••••••••• 49 Other Control Program Routines ••••• 111 Table 14. Module Selector - Ccntrol Modules • • • • • • • • • • • • • • • • 56

INTRODUCTION

. Sequential access methods are program­ input/output blocks. The five types of ming techniques for causing the storage and executor are: OPEN executor, CLOSE execu­ retrieval of data arranged in sequential tor, SYNAD/EOV executor, FEOV executor, and order. Sequential access method facilities EOV/new volume executor. in Operating system/360 consist of routines in five categories: Buffer pool management routines form buffers in main storage and return main storage space (for buffers no longer • Queued sequential access method CQSAM} needed) to available status. A buffer pool routines. management routine is entered when a GET­ • Basic sequential access method (BSAM) POOL, BUILD, GETBUF, FREE BUF, or FREEPOOL routines. macro-instruction is encountered in a pro­ • Basic partitioned access method CBPAM} gram. routines. • sequential access method executors. The GETPOOL and BUILD routines both form • Buffer pool management routines. a pool of buffers in main storage. Howev­ er, the GET POOL routine also obtains the main storage space for the buffer pool. A processing program using QSAM routines Main storage space must be provided by the deals with records. For input, QSAM rou­ processing program when the BUILD routine tines turn the blocks of data of the is used. channel programs into a stream of input records for th~ processing program = for The GETBUF and FREEBUF routines handle output, QSAM routines collect the succes­ individual buffers. GETBUF obtains a buf­ sive output records of the processing pro­ fer from a buffer pool and FREEBUF returns gram into blocks .of data to be written by a buffer to a buffer pool. channel programs. The FREE POOL routine returns the main storage space used for a buffer pool. A processing program using BSAM routines deals with blocks of data. For input, BSAM Figure 1 shows the relationship among routines cause a channel program to read a sequential access method routines, other block of data for the processing program; portion~ of the control program, and the for output, BSAM routines cause a channel process1ng program. Certain routines program to write a block of data for the (e.g. ,end-of-block routines and processing program. BSAM routines are also appendages) are identical for all three used to read and write blocks of data for sequential access methods. Other routines members of a partitioned data set. (e.g., GET or PUT for QSAM and READ or WRITE for BSAM and BPAM) depend upon the access method used. (QSAM andBSAM also A processing program using BPAM routines include control routines not shown in Fig­ also deals with blocks of data. For out­ ure 1.) put, BPAM routines construct and cause writing of entries in the directory; for A processing program passes control to input, BPAM routines cause searching for sequential access method routines via a and read entries in the directory. To read macro-instruction. A GET, RELSE, PUT, and write the blocks of the members, a PUTX, or TRUNC macro-instruction is used processing program uses the BSAM routines. for QSAM, and a READ or WRITE macro­ instruction is used for BSAM. The GET, PUT, READ, and WRITE routines pass control Sequential access method executors are to the same end-of-block routines. modules that operate with the OPEN, CLOSE, However, a GET or a PUT routine passes and EOV routines of I/O support. When a control only when an end-of-block condition is opened, an executor occurs, and a READ or a WRITE routine constructs control blocks and loads the always passes control. An end-of-block access method routines unless the resident routine causes the I/O supervisor to sche­ access method (RAM) option is used. If the dule a channel program for execution. The RAM option is used, the selected QSAM or end-of-block routine then returns control BSAM routines are permanently resident. to the GET or PUT routine (for QSAM) or to When the end of a data set or volume is the READ or WRITE routine (for BSAM and re(!,ched, an executor processes.· the pending BPAM).

Introduction 7 Processing Program (Using QSAM)

CHECK

CHECK -I I­ Routine I I EROPT I I I User's SYNAD I User's SYNAD Routine I I Routine I I I I I I I I I J ______I --~

I/o Interruption

I/o Supervisor Appendages r I~I~~~~ I ,------Supervisor I I rl --l---~E~X=C~P----i------~ Appendages I I I I Supervisor ------1 I L Channel Status I I SIO (b) I I Word _---1 I I I I I LPSW I I I I Channel L_ -~ I : POST (a) Program I I I lOB I I L_~_ ~~-~~ __ -jL.... __E_~_B---'f- __ ~ _____ ~M ______~ ___ ~

Legend: ~ (a) Previous Channel Program -- Control (b) Next Channel Program --- Reference ~Routinl's Described in This Publication

Figure 1. Flow of control in QSAM, BSAM, and in BPAM for Members

After receiving control back from an If execution of the channel program result­ end-of-block routine, a GET or a PUT rou­ ed in permanent errors the synchronizing tine passes control to a synchronizing and routine causes control to pass to the error processing routine. This routine user's SYNAD routine. examines the lOB to determine the status of the channel program. If the channel pro­ gram is not yet executed, the synchronizing The asynchronous error processing rou­ routine awaits execution. If the channel tine gains control as a result of being program executed successfully, control scheduled by an appendage. The routine returns to the GET or PUT routine which processes permanent error conditions that returns control to the processing program. are encountered by a channel program for

8 input data with track overflow record for­ If execution of the channel program result­ mat. The routine establishes the address ed in a permanent error, a CHECK routine of the segment beyond the one in error. causes control to pass to the user's SYNAD routine. After receiving control back from an end-of-block routine, the READ or WRITE When an I/O interruption occurs, the I/O routine returns control to the processing interruption supervisor posts the status of program. To determine the status of the the execution of the channel program in tbe channel program the processing program must event control block (ECB). For QSAM, the pass control to a CHECK routine via a CHECK ECB is located in the input/output block macro-instruction. A CHECK routine deter­ (lOB): for BSAM, the ECB is located in the mines the status of the channel program by data event control block (DECB). The EXCP referring to the DECB. If the channel supervisor then receives control and causes program is not yet executed, the CHECK the next scheduled channel program to be routine awaits execution. If the channel executed. Both the I/O interruption super­ program has been executed successfully, visor and the EXCP supervisor may use control returns to the processing program. access method appendages.

Introduction 9 QUEUED SEQUENTIAL ACCESS METHOD ROUTINES

Queued sequential access method (QSAM) the ~rocessing program unless the output . routines cause storage and retrieval of buffer is full. records and furnish buffering and blocking facilities. There are six types of QSAM When an input buffer is empty, or an routines: output buffer is full, an end-of-block routine receives control from the GET or • GET routines. the PUT routine. An end-of-block routine • PUT routines. provides device ori.enteddata for the chan­ • End-of-block routines. nel program. If normal channel-program • Synchronizing and .error processing rou­ scheduling is used, the routine passes tines (including the track overflow control to the I/O supervisor (via an EXCP asynchronous error processing routine). macro-instruction) to cause scheduling of • Appendages. the buffer. If chained channel-program • Control routines. scheduling is used, it attempts to add the present channel program to the last one in Table 1 and Figure 2 show the relation­ the chain of scheduled channel programs. ship of QSAM routines, other portions of If it is successful, control returns to the the operating system, and the processing processing program. If it is unsuccessful, program. control passes to the I/O supervisor (via an EXCP macro-instruction). A GET or a PUT routine receives control after a GET, PUT, PUTX, RELSE, or TRUNC After the end-oi-block routine returns macro-instruction is encountered in a proc­ control, the GET or PuT routine passes essing program. A GET routine presents an control to a synchronizing and error proc­ input record to the processing program and essing routine. The synchronizing routine returns control to the processing program examines the next lOB to determine the unless the input buffer is empty. A PUT status of the channel program. (For a des­ routine accepts output records from the cription and diagram of the relationship of processing program and returns control to QSAM Control Blocks refer to Appendix B.)

Table 1. Flow of Control of QSAM Routines r------~------T------, " , I ,Routine Passing Control I Condition IRoutine Receiving Control I 'I I I ~------+------+------~ , Processing Program' GET or PUT Macro-instruction I GET or PUT I ~------+------+------~ I GET or PUT , Buffer ready for scheduling ,End-af-block I ~------+------+------~ 'End-of-block I EXCP Macro-instruction I I/O Supervisor , ~------~------+------+------~ , I/O Supervisor I End I End-of-block I ~------+------+------~ 'End-of-block I End I GET or PUT , ~------+------+------~ , GET or PUT I New buffer needed I Synchronizing , ~------+------+------i , Synchronizing 'Channel program executed I GET or PUT I I , wi thout error I I ~------+------+------i , GET or PUT , No other I ProceSSing Program , ~------+------+------1 I supervisor I I/O interruption , I/O supervisor , ~------+------+------~ I I/O Supervisor I Appendage exit condition ,Appendage I ~------+------+------1 'Appendage , End I I/O supervisor , ~------t------t------1 ,L ______I/O Supervisor LI ______End· ~ ______LI ______Supervisor J,

10 Depending on the status of the execution, a The track overflow asynchronous error synchronizing routine may retain control processing routine gains control as a (using the WAIT macro-instruction), return result of being scheduled by an appendage. control to the GET or PUT routine, or pass The routine processes permanent error con­ control to the user's SYNAD routine or to ditions that are encountered by a channel the SYNAD/EOV executor. (For a description program for input data with track overflow of the SYNAD/EOVexecutor (IGC0005E), and record forma.t. The routine establishes the the flow of control to and from it, refer address of the segment beyond the one in to the section: "sequential Access Method error. Executors.") Appendages receive control from the I/O supervisor and return control to the I/O supervisor. Some appendages operate with the I/O interruption supervisor, others operate with the EXCP supervisor.

Processing Control routines (not shown in Figure 2) Program receive control from the processing program via the control macro-instructions (CNTRL, PRTOV). These QSAM routines control the printer and the card reader. Appendix A contains decision tables that r-r-::"-:'-:' show, for each type of routine, the proc­ I essing characteristics that differentiate I the routines within that type. I I I I GET ROUTINES I I EROPT User's SYNAD Routine There are 14 different GET routines. A particular GET routine is used with a specific data set on the basis of the access condition options specified by the processing program for access to that data set. I/o Interruption A GET routine gains CPU control when a I 0 Su ervisor GET or a RELSE macro-instruction is encoun­

r I/o Interruption tered. The GET routine returns control to i~===-,... s_u,-pe_rV_i,_or_--I the processing program, unless either an : __ input buffer is empty and ready to be I I I scheduled for refilling or a new full input L_ J I buffer is needed. If a buffer is ready to I Word I be scheduled for refilling, the GET routine I I LPSW I lOB I passes control to an end-of-block routine. L _____ ~Q"l.U If a new full input buffer is needed, the I GET routine passes control to a synchroniz­ I ing and error processing routine. A GET I routine presents the processing program I with a record from a block of data 1n an I input buffer filled by a channel program. r Appendages I A RELSE routine causes the present buffer I I to be considered empty and ready for I I refilling. I I L_ _S!9 i!')_ J Every GET routine determines in each pass through the routine: Legend: (a) Previous Channel Program • The address of the next record. (b) Next Channel Program Control Reference • Whether an input buffer is empty and ready to be scheduled for refilling. ~ Routines Described in This Publication • Whether a new full input buffer is Figure. 2. Flow of Control in QSAM needed.

Queued sequential Access Method Routines 11 In each entry into a GET routine, the The GET routine descriptions that follow processing program is presented with the are accordingly grouped as: next record. • Simple Buffering GET Routines. GET routines differ mainly .in the buf­ • Exchange Buffering GET Routines. fering techniques they support. GET rou­ tines for simple buffering deal with buf­ • Update Mode GET Routine. fers that are permanently associated with one DCB. GET routines for exchange buffer­ ing deal with buffers that are exchanged between the input DCB, the output DCB, and the processing program. The GET routine for the Update mode of OPEN uses simple SIMPLE BUFFERING GET ROUTINES buffering~ it differs from other simple buffering GET routines in that the same buffer is used for both input and output. Simple buffering GET routines use buf­ The manner in which a GET routine performs fers whose beginning and ending addresses its processing depends on the buffering are in the data control block (DCB). The mode. beginning address is in the field DCBRECAD (address of the next record)~ the ending address is in the field DCBEOBAD (address of the end of the buffer). In each pass Simple buffering GET routines determine through a routine, it determines: the address of the next record by referring to the DCB. To determine whether a -buffer • The address of the next record. is empty and whether a new buffer is needed, these routines compare the begin­ • Whether an input buffer is empty and ning and ending address of the buffer. To ready to be scheduled for refilling. present a record to the processing program., a simple buffering GET routine either moves • Whether a new full input buffer is the record to a processing program work needed. area or permits processing to be performed in the buffer space. In the latter case" if the record is to become part of an If the records are unblocked, the output data set it must be moved to an address of the next record is always that output buffer. of the next buffer.

Exchange buffering GET routines deter­ If the records are blocked, a GET rou­ mine the address of the next record by tine determines the address of the next referring to the channel program. To record by adding the length of the last determine whether a buffer is empty and record to the address of the last record. whether a new buffer is needed, these The address of the last record is in the routines compare the beginning and ending DCBRECAD field of the data control block address of the channel program. To present (DCB). If the records are fixed-length a record to the processing program, an blocked records the length of each record exchange buffering GET routine presents the is in the DCBLRECL field. If the records processing program with the buffer or buf­ are variable-length blocked records, the fer segment. The buffer (or segment) is length of each record is in the length exchanged with a work area of the process­ field of the record itself. ing program, or with a buffer (or segment) from an output DCB (by a PUT routine using exchange buffering). A GET routine determines whether a buf­ fer is empty and ready for refilling, and whether a new full buffer is needed, by The update mode GET routine determines testing for an end-of-block (EOB)condi­ the address of the next input record by tion. referring to the DCB. (The next output record is the last input record.) To When a buffer is empty, a GET routine determine whether a new input buffer is passes control to an end-of-block routine needed, and whether the buffer is to be to refill the buffer. The buffers are emptied (that is, whether the last block is filled for the first time by OPEN executor to be updated) before being filled with a IGG01911. Thus the buffers are primed for new block, the routine also refers to the the first entry into a GET routine. DCB. The record is presented to the proc­ essing program, and accepted for updating, When a new full buffer is needed, a GET in the same buffer space. routine obtains it by passing control to

12 the Input Synchronizing and Error Process­ GET Module IGG019AA ing routine (module IGG019AQ). The syn­ chronizing routine updates the DCBIOBA field (thus pointing to the new buffer) and Module IGG019AA presents the processing returns control to the GET routine. A GET program with the address of the next fixed­ routine updates the DCBRECAD field by length or undefined-length record. The inserting in it the starting address of the OPEN executor selects and loads this module buffer from the channel program associated if the OPEN parameter list specifies: with the new lOB. To update the DCBEOBAD field a GET routine adds the actual length of the block read to the buffer starting - Input address. These two fields" DCBRECAD and DCBEOBAD, define the available buffer. and the DCB specifies: For unblocked records, an EOB condition exists after every entry into the GET - GET routine. For blocked records" an EOB con­ - Simple buffering dition exists when the values in the DCBRE­ - Locate operating mode CAD field and the DCBEOBAD field are equal. - Fixed-length (unblocked, blocked, or In the move operating mode, the buffer can blocked standard) or undefined-length be scheduled for refilling as soon as the record format. last record is moved out; accordingly, an EOB test is made after moving each record, to schedule the buffer as soon as possible. The module consists of a GET routine and a Another EOB test is made on the next entry RELSE routine. to the routine to determine whether a new full buffer is needed. In the locate roode, the empty buffer is scheduled when the The GET routine operates as follows: routine is entered, if the last record was presented in the preceding entry; accord­ • It receives control when a GET macro­ ingly, an EOB test is made on entry into instruction is encountered in a the routine to determine both whether a processing program. buffer is empty and ready for refilling and also whether a new full buffer is needed. • It tests for an EOB condition to deter­ mine whether a buffer is empty and When the proceSSing program determines ready for refilling and also whether a that the balance of the present buffer is new buffer is needed. (When the OPEN to be ignored and the first record of the executor primes the buffers, it sche­ next buffer is desired, the processing dules all buffers except one and sets program issues a RELSE macro-instruction. an EOB condition.> - Control passes to a RELSE routine which sets an EOB condition. • If no EOB condition exists, it deter­ mines the address of the next record, The OPEN executor• primes (that is, sche- and then presents the address to the dules for filling) the buffers if QSAM is processing program and returns control used with a DCB opened for Input, Update, to the processing program. or Readback. (For the locate mode, all buffers except one are primed; for the move • If an EOB condition exists, it issues a mode all buffers are primed.) The OPEN BALR instruction to pass the present executor also sets an end-of-block condi­ buffer to the end-of-block routine to tion; the first time that a GET routine be scheduled for refilling. The GET gains control, it processes this condition routine issues another BALR instruction in the way it normally dqes. to obtain a new full buffer through the Input Synchronizing and Error Process­ There are nine simple buffering GET ing routine (module IGG019AQ). The GET routines. Table 2 lists the routines avai­ routine then presents the address of lable and the conditions that cause a the first record of the new buffer to particular routine to be used. The OPEN the processing program and returns con­ executor selects one of the routines, loads trol to the processing program. it, and puts its address into the DCBGET field. The table shows, for example, that when the OPEN parameter list specifies Input and the DCB specifies the GET macro­ The RELSE routine causes an EOB condi­ instruction, simple buffering, the locate tion by setting the DCBRECAD and DCBEOBAD mode, and .the fixed-length record format, fields so that they are equal; it then routine IGG019AA is selected and loaded. returns control to the processing program.

Queued sequential Access Method Routines 13

""r'. Table 2. Module Selector - Simple Buffering GET Modules r------T------, I I I I Access Conditions I Selections I I I I ~------+---T---T---T---T---T---T---T---T---T---T---T---T---T---i I INPUT, GET, Simple Buffering I X I X I X I X I X I X I X I X IX I I I I I X I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I RDBACK, GET, Simple Buff ering I I I I I I I I I I X I X I X I X I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---i ILocate operating mode I X I X I X I I I I I I I X I X I I I I ~------+---+---+---+---+---+---+---+---+---+---+---t---+---+---i IMove operating mode I I I I X I X I X I X I X I X I I I X I X I X I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---i IFixed-length record format I X I I I X I I I X I I I X I I X I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---i IUndefined-length record format I I X I I I X I I I X I I I X I I X I I ~------t---+---+---+---+---+---+---+---+---+---+---t---+---+---i IVariable-length record format I I I X I I I X I I I X I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---i ICard reader, I I I I I I I I I I I I I I I lonly a single buffer, CNTRL I I I I I I I X I X I X I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---i ICharacter conversion for I I I I I I I I I I I I I I I I paper tape I I I I I I I I I I I I I I X I ~------+---~---+---+---~---+---+---~---+---+---~---+---~---+---i I I I I I I I I I I I I GET Modules I I I I I I I I I I I I I I I I I I I I I ~------+---T---t---+---T---+---+---T---+---+---T---t---T---t---i I IGG019AA I X I X I I I I I I I I I I I I I / ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGG019AB I I I X I I I I I I I '. I I I I I ~------+---+---+---+---+---+---+--~+---+---+---+---+---+---+---i I IGG019AC I I I I X I X I I I I I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGG019AD I I I I I I X I I I I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGG019AG I I I I I I I X I X I I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGG019AH I I I I I I I I I X I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGG019AM I I I I I I I I I I X I X I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---t---+---i

~------~::~~~~~------+---+---+---t---t---t---t---t---t---t---t---~-~-t-~-t---~I IGG019AT1 I I I I I I I I I I I I I I X I ~------~---~---~---~---~---~---~---~---~---~---~---~---~---~---i 11This module also includes the Paper Tape Character Conversion Synchronizing and I LIError ______Processing ------routine. ______JI

GET Module IGG019AB - Simple buffering . - Locate operating mode - Variable-length (unblocked or blocked) Module IGG019AB presents the processing record format. program with the address of the next variable-length record. The OPEN executor The mOdule consists of a GET routine and a selects and loads this module if the OPEN RELSE routine. parameter list specifies: The GET routine operates as follows: - Input and the DCB specifies: • It receives control when a GET macro­ instruction is encountered in a - GET processing program.

14 • It determines the address of the next • If no EOB condition exists·, the routine record and tests for an EOB condition moves the next record to the work area. to determine whether a buffer is empty and ready for refilling and also wheth­ • If an EOB condition exists, the routine er a new buffer is needed. (When the issues a BALR instruction to obtain a OPEN executor primes the buffers, it new buffer through the Input Synchron­ schedules all buffers except one and izing and Error Processing routine sets an EOB condition.) (module IGG019AQ), and moves the first record of the new buffer to the work • If no EOB condition exists, it presents area. the address of the next record to the processing program and returns control • It tests for a new EOB condition to to the processing program. determine whether a buffer is empty and ready for refilling. (For unblocked • If an EOB condition exists, it issues a records, this condition E;xistsat every BALR instruction to pass the present entry into the routine.) buffer to the end-of-block routine to be scheduled for refilling. The GET • If no new EOB condition exists, the routine issues another BALR instruction routine returns control to the process­ to obtain a n~w buffer through the ing program. Input Synchronizing and Error Process­ ing routine (module IGG019AQ).The GET • If a new EOB condition exists, the routine then presents the address of routine issues a BALR instruction to the first record of the new buffer to pass the present buffer to the end-of­ the processing program and returns con­ block routine to be scheduled for trol to the processing program. refilling, and then returns control to the processing program. The RELSE routine causes an EOB condi­ tion by setting the DCBRECAD and DCBEOBAD The RELSE routine sets a bit in the DCB fields so that they are equal; it then so that the GET routine passes the buffer returns control to the processing program. for refilling and obtains a new full buffer the next time the routine is entered. GET Module IGG019AC GET Module IGG019AD Module IGG019AC moves the next fixed­ length or undefined-length record to the Module IGG019AD moves the next variable­ work area. The OPEN executor selects and length length record to the work area. The. loads this module if the OPEN parameter OPEN executor selects and loads this module list specifies: if the OPEN parameter list specifies:

- Input - Input and the DCB s~ecifies: and the DCB specifies:

- GET - GET - Simple buffering - Simple buffering - Move operating mode - Move operating mode - Fixed-length (unblocked, blocked, or - Variable-length (unblocked or blocked) blocked standard) or undefined-length record format record format (but not the CNTRL macro-instruction). The (but not the CNTRL macro-instruction). The module consists of a GET and a RELSE module consists of a GET routine and a routine. RELSE routine. The GET routine operates as follows: The GET routine operates as follows: • It receives control when a GET macro­ • It receives control when a GET macro­ instruction is encountered in a instruction is encountered in a processing program~ processing program. • It tests fOlC an EOB condition to deter­ • It tests for an EOB condition to deter­ mine whether a new full buffer is mine whether a new full buffer is needed. (When the OPEN executor primes needed. (When the OPEN executor primes the buffers, it also sets an end-of­ the buf.fers, it sets this EOB 90ndition block condition for the first GET for the first GETmacro"'instruction.) macro-instruction.)

Queued sequential Access Method Routines 15 • If an EOB condition exists, the routine the new buffer, and then tests for issues a BALR instruction to obtain a blocked records. new buffer through the Input Synchron­ izing and Error Processing routine • If no EOB condition exists, it tests (module IGG019AQ), and moves the first immediately for blocked records. record to the work area. • For blocked records, it updates the • If no EOB condition exists, the routine DCBRECAD field, moves the present moves the next record to the work area. record to the work area, and returns control to the processing program. • It tests for a new EOB condition to determine whether a buffer is empty and • For unblocked records, it sets the ready for refilling. (For unblocked DCBRECAD and DCBEOBAD fields so that records, the condition exists after they are equal, moves the present every entry to this routine.) record to the work area, and returns control to the processing program. • If no new EOB condition exists, the routine returns control to the process­ The RELSE routine sets the value of the ing program. DCBEOBAD field equal to that of the DCBRECAD field to establish an EOB condi­ • If a new EOB condition exists, the tion. Control then returns to the process­ routine issues a BALR instruction to ing program. pass the present buffer to the end-of­ block routine to be scheduled for refilling, and returns control to the processing program. GET Module IGG019AH (CNTRL - Card Reader) The RELSE routine sets a bit in the DCB so that the GET routine passes the buffer Module IGG019AH moves the next variable­ for refilling and obtains a new full buffer length record to the work area without the next time the routine is entered. scheduling the buffer for refilling. To refill the buffer, the processing program issues a CNTRL macro-instruction. The OPEN GET Module IGG019AG (CNTRL - Card Reader) executor selects and loads this module if the OPEN parameter list specifies: Module IGG019AG moves the next fixed­ - Input length or undefined-length record to the work area without scheduling the buffer for and the DCB specifies: refilling. To refill the buffer, the processing program issues a CNTRL macro­ - GET instruction. The OPEN executor selects and - Simple buffering loads this module if the OPEN parameter - Move operating mode list specifies: - Variable-length (unblocked or blocked) record format - Input - CNTRL (card reader). and the DCB specifies: The module consists of a GET routine and a RELSE routine. - GET - Simple buffering The GET routine operates as follows: - Move operating mode Fixed-length (unblocked, blocked, or • It receives control when a GET macro­ blocked standard) or undefined-length instruction is encountered in a record format processing program. - CNTRL (card reader). • If an EOB condition exists, it resets The module consists of a GET routine and a the DCBRECAD and DCBEOBAD fields for RELSE routine. the new buffer, and then tests for clocked records. The GET routine operates as follows: • If no EOB condition exists, it tests • It receives control when a GET macro­ immediately for blocked records. instruction is encountered in a processing program. • For blocked records, it updates the DCBRECAD field, moves the present • If an EOB condition exists, it resets record to the work area, and returns the DCBRECAD and DCBEOBAD fields for control to the processing program.

16 • For unblocked records, it sets the The RELSE routine causes an EOB condi- DCBRECAD and DCBEOBAD fields so that tion by setting the DCBRECAD and DCBEOBAD . they are equal, moves the present fields so that they are equal; it then record to the work area, and returns returns control to the processing program. control to the processing progranl. Figure 3 illustrates the ordering of The RELSE routine sets the value of the records using this module. When reading DCBEOBAD field equal to that of the backwards under QSAM, each block is read DCBRECAD field to establish an EOB condi­ from the tape from the end of the block to tion. control then returns to the process­ the beginning, each buffer is filled from ing program. the end of the buffer to the beginning, and the records are presented to the processing program in order of the record in the last segment of the buffer first, and the record in the first one last. In this manner of GET Module IGG019AM (RDBACK) reading, buffering, and presenting, each record follows in backward sequence, from the record presented last out of one buffer Module IGG019AM presents the processing to the record presented first out of the program with the address of the next record next buffer. when the data set is opened for backward reading. The OPEN executor selects and loads this module if the OPEN parameter list specifies: GET Module IGG019AN (RDBACK)

- RDBACK Module IGG019AN moves the next record to and the DCB specifies: the work area when the data set is opened for tackward reading. The OPEN executor - GET selects and loads this module if the OPEN - Simple buffering parameter list specifies: - Locate operating mode - Fixed-length (unblocked, blocked, or - RDBACK blocked standard) or undefined-length record format. and the DeB specifies: - GET The module consists of a GET routine and a - Simple buffering RELSE routine. - Move operating mode - Fixed-length (unblocked, blocked, or The GET routine operates as follows: blocked standard) or undefined-length record format. • It receives control when a GET macro­ instruction is encountered in a The module consists of a GET routine and a processing program. RELSE routine.

• It tests for an EOB condition. The GET routine operates as follows: • If no EOB condition exists, it deter­ • It receives control when a GET macro­ mines the address of the next record by instruction is encountered in a subtracting the DCBLRECL value from the processing program. DCBRECAD value. The routine presents the result to the processing program, • It tests for an EOB condition. and returns control to the processing program. • If nc EOB condition exists, it moves the next record to the work area, and • If an EOB condition exists, it issues a updates the DCBRECAD field by reducing BALR instruction to pass the present it by the value of the DCBLRECL field. buffer to the end-of-block r"outine. The GET routine issues another BALR • If an EOB condition exists, it issues a instruction to obtain a new buffer BALR instruction to obtain a new buffer through the Input Synchronizing and through the Input Synchronizing and Error Processing routine (module Error Processing routine (module IGG019AQ). The GET routine then pre­ IGG019AQ). The GET routine then moves sents the address of the last record of the last record of the new buffer to the new buffer to the processing pro­ the work area. gram, and returns control to the proc­ essing program. • It tests for a new EOB condition.

Queued Sequential Access Ivlethod Routines 17 i I i

• If no new/ EOB condition exists, it - Input returns control to the processing pro­ gram • and the DCB specifies: • If a new EOB condition exists, it - GET issues a BALR instruction to pass the - simple buffering present buffer to the end-of-block rou­ - Move opera.ting mode tine, and then returns control to the - Paper tape character conversion. processing program. The module consists of a GET routine and a The RELSE routine issues a BALR instruc­ paper Tape Character Conversion Synchroniz­ tion to pass the present buffer to the ing and Error Processing routine. end-of-block routine, and then returns con­ trol to the processing program. The GET routine operates as follows: Figure 3, described for GET module IGG019AM, also illustrates the ordering of • It receives control when a GET macro­ records using this module. instructiun is encountered in a processing program.

• It conve~ts the next character and moves it to the work area.

,.Direction of Tape Direction of Tape ... • It continues converting and moving When Reading Backward When Writing until one of the following conditions is met, with the stated effect: Last GET for this block addresses this segment The number of characters specified in the DCBBLKSI field of the DCB First channel progrom fills this buffer have been moved: The routine First GET for this block _ beginning here returns control to the processing addresses this segment program.

An EOB condition is encountered: Last GET for th is block The routine passes control to the addresses this segment end-of-block routine to refill the buffer, and then enters the Paper 5 Next channe I progrom Tape Character Conversion Synchron­ fills this buffer izing and Error Processing routine First GET for this block _ beginning here addresses this segment 6 to obtain a new buffer. An end-of-record character is Last GET for this block encountered . (undefined-length addresses this segment records only): The routine returns control to the processing program. 2 Next channel program fills this buffer The tape is exhausted: The routine First GET for this block _ beginning here addresses this segment 3 returns control to the processing program.

Figure 3. Order of Records Using GET Rou­ A paper tape reader-detected error tines for Data sets opened for character is encountered: The rou­ RDBACK (IGG019AM,IGG019A~) tine moves the character to the work area without conversion and enters the Paper Tape Character Conversion Synchronizing and Error GET Module IGG019AT (Paper Tape Character Processing routine. Conversion) • If one of the characters in the buffer is an undefined character, the module Module IGG019AT converts paper tape converts it to the hexadecimal charac­ characters into EBCDIC characters and moves ter FF, moves it to the work area, and them to the work area. The OPEN executor continues conversion. When one of the selects and loads this module (and one of afore-mentioned conditions is met, con­ the code conversion modules listed in trol passes to the Paper Tape Character Appendix D) if the OPEN parameter list Conversion Synchronizing and Error specifies: Processing routine.

18 \ \

\ \ \ , I The Paper Tape Character Conversion Syn­ The next CCW is found by addi'ng 8 to the chronizing and Error Processing routine address of the previously current CCW (the operates as follows: value stated in the DCBCCCW field in the DCB). ' • For an EOB condition, the routine finds the next buffer, and returns control to If an input buffer is empty and ready to the GET routine to resume converting be scheduled for refilling, a GET routine and moving. passes control to an end-of-block routine. The end-of-block routine passes control to • For a reader-detected error character the I/O supervisor to have it schedule the and for an undefined character, the buffer. After scheduling, the I/O supervi­ routine passes control to the process­ sor returns control to the end-of-block ing program's SYNAD routine. When con­ routine, and it returns control to the GET trol returns from the SYNAD routine, or routine. if there is no SYNAD routine present, one of the error options is implement­ If a new full buffer is needed, a GET ed. routine passes control to a synchronizing and error processing routine. The syn­ • For the ACCEPT error option, the rou­ chronizing routine enters the address of tine returns control to the processing the inpUt/output block (lOB) that points to program. that channel program into the DCBIOBA field in the DCB. • For the SKIP error option., the routine fills the work area again. If an end~of-block condition exists then either an input buffer is empty and ready • For the TERMINATE error option, or if to be scheduled for refilling, or anew no error option is specified, the rou­ buffer is needed. An end-of-block condi­ tine issues the ABEND macro­ tion exists for unblocked records during instruction. each pass through a routine; for blocked records it exists if the values in the Appendix D lists the modules composed of fields DCBCC~w (the address of the current the tables used for code conversion. CCW) and DCBLCCW (the address of the last CCW) are equal.

In the locate operating mode, the empty buffer is scheduled when the routine is EXCHANGE BUFFERING GET ROUTINES entered if the last record was presented in the preceding entry; accordingly a test for an end-of-block condition is made on entry Exchange buffering GET routines use to the routine to determine both whether a buffers whose addresses and lengths are buffer is empty and also whether a new stated in the channel program. For buffer is needed. unblocked records, the buffer address and length are in one channel command word In the substitute operating mode, the (CCW) • For blocked records, the addresses' buffer can be scheduled for refilling as of the buffer segments. are in successive soon as a work area has been substituted ccw~ (thoughr the segments themselves are for the last buffer segment; accordingly, ~ necessarily located next to one an end-of-blocktest is made before leaving another). In each pass through an exchange the routine to determine whether the buffer buffering GET routine., it determines: is empty, and another end-of-block test is made on entry to the routine to determine whether a new buffer is needed. • The address of the next record. A RELSE routine sets an end-of-block • Whether an input buffer is empty and condition. This end-of-block condition is ready to be scheduled for refilling. processed so that, when the GET routine is entered next, it operates as usual. • Whether a new full input buffer is needed. The OPEN executor primes (that is, sche­ dules for filling) the buffers if QSAM is , ·If the records are unblocked, a GET used with a DCB opened for Input. (For the routine finds the address ,of the next locate mode, all buffers except one are record in the Read CCW for the next input primed; for the substitute mode all buffers buffer. are primed.) The OPEN executor also sets an end-of-block condition; the first time If the records are blocked, a GETrou­ that a GET routine gains control, it proc­ tine finds the address of the neJct record esses this condition in the way it normally in the next ReadCCW for the same buffer. does.

Queued Sequential Access Method Routines 19 There are four exchange buffering GET The module consists of a GET routine and a routines. Table 3 lists the routines avai­ RELSE routine. lable 'and the conditions that cause a particular routine to be used. The OPEN The GET routine operates as follows: executor selects one of the routines, loads it., and places its address into the DCBGET • It receives control when a GET macro­ field. The table shows, for example, that instruction is encountered in a if Input, GET, exchange buffering, locate processing program. mode, and fixed-length blocked record for­ mat are specified module IGG019EA is • It tests for an end-of-block condition selected for use .• to determine whether a buffer is empty and ready for refilling and also wheth­ er a new full buffer is needed. (When Table 3. Module Selector - Exchange Buf- the OPEN executor primes the buffers, fering GET Modules it schedules all buffers except one and r------T------, sets an end-of-block condition.) I I I I Access Conditions I Selections I • If no end-of-block condition exists, it I I I presents the address of the next record ~------+--T--T--T--T--T--T--1 (found in the next CCW), and returns I Input, GET., Exchange I X I X I X I X I X I X I X I control, to the processing program. ~------+--+--+--+--+--+--+--1 I Locate IX IX IX IX I I I I • If an end-of-block condition exists, ~------+--+--+--+--+--+--+--1 the routine passes control to the end­ I Substitute I I I I IX IX IX I of-block routine to cause scheduling of ~------+--+--+--+--+--+--+--1 the buffer for refilling. On return of I Fixed-length IX IX I I IX I IX I control, the GET routine passes control ~------+--+--+--+--+--+--+--1 to the Input Synchronizing and Error I Variable-length I I IX I I I I I Processing routine (module IGG019AQ) to ~------+--+--+--+--+--+--+--1 obtain a new full buffer. On return of I Undefined-length I I I IX I IX I I control, the GET routine then presents ~------+--+--+--+--+--+--+--1 the address of the first record, and I Unblocked I IX IX IX IX IX I I returns control, to the processing ~------+--+--+--+--+--+--+--1 program. I Blocked I X I I I I I I X I ~------+--+--~--~--+--~--+--1 The RELSE routine causes an end-of-block I I I I I I condition by setting the DCBCCCW and I GET Modules I I I I I DCBLCCW fields equal and returns control to I I I I I I the processing program. ~------+--+--T--T--+--T--+--~ I IGG019EA I X I I I I I I I Note: If an input DCB using this module is ~------+--+--+--+--+--+--+--~ paired with an output DCB using module I IGG019EB I IX IX IX I I I I IGG019EF (Output, PUT, Exchange), a PUTX ~------+--+--+--+--+--+--+--~ macro-instruction addressed to the output I IGG019EC I I I I IX IX I I DCB causes an exchange of the addresses of ~------+--+--+--+--+--+--+--~ the current buffer segments of each DCB. I IGG019ED I I I I IX I These are found in the CCws pointed to by L ______~I __ ~ __ ~ __~ __ ~I __ ~ __ ~ __ J the input and output DCBs.

GET Module IGG019EA GET Module IGG019EB

Module IGG019EA uses the locate mode to Module IGG019EB uses the locate mode to present the processing program with the present the processing program with the address of the next fixed-length blocked address of the next unblocked record. The record,. The OPEN executor selects and OPEN executor selects and loads this module loads this module if the OPEN parameter if the OPEN parameter list specifies: list specifies: - Input - Input and the DCB specifies: and the DCB specifies: - GET - GET - Exchange buffering - Exchange buffering - Locate operating mode - Locate operating mode - Unblocked record format (fixed-, - Fixed-length blocked record format. variable-, or undefined-length).

20 \ \ ,

The module consists of a GET routine and a • It passes control to the synchronizing RELSE routine. routine to obtain the next full buffer. The GET routine operates as follows: • It exchanges the address of the work area and the address of the buffer. • It receives control when a GET macro­ instruction is encountered in a • It passes control to the end-of-block processing program. routine to cause the work area offered by the processing program to be sche­ • It passes control to the end-of-block duled for filling. routine to cause scheduling of the previous buffer for refilling. • It presents the address of the new record, and returns control, to the • It passes control to the Input Syn­ processing program. (When the OP~N chronizing and Error Processing routine executor primes the buffers, it sche­ (module IGG019AQ) to obtain the next dules all buffers.) full buffer. (When the OPEN executor primes the buffers, it schedules all • When undefined-length records are spec­ buffers except one .• ) ified, the routine also presents the record length. • It presents the address of the record, and returns control, to the processing The RELSE routine returns control with­ program. For variable- or undefined­ out performing any processing. length records, the routine also presents the record length. The RELSE routine returns control with­ out performing any processing. GET Module IGG019ED Note: If an input DCB using this module is paired with an output DCB using module Module IGG019ED uses the substitute mode IGG019EE (Output., PUT, Exchange) , a PUTX to present the processing program with the macro-instruction addressed to the output address of the next fixed-length blocked DCB causes an exchange of the addresses of record. The OPEN executor selects and the current buffer segments of each DCB. loads this module if the OPEN parameter These addresses are found in the CCWs list specifies: pointed to by the DCBCCCW fields in the input and output DCBs. - Input and the DCB specifies: GET Module IGG019EC - GET - Exchange buffering - Substitute operating mode Module IGG019EC uses the substitute mode - Fixed-length blocked record format. to present the processing program with the address of the next unblocked record. The The module consists of a GET routine and a OPEN executor selects and loads this module RELSE routine. if the OPEN parameter list specifies: - Input The GET routine operates as follows: and the DCB specifies: • It receives control when a GET macro­ instruction is encountered in a - GET processing program. - Exchange buffering - substitute operating mode • It tests for an end-of-block condition - Unblocked record format (fixed-, or to determine if a new full buffer is undefined-length). needed. (When the OPEN executor primes the buffers, it schedules all buffers The module consists of a GET routine and a and sets an end-of-block condition.) RELSE routine. • If no end-of-block condition exists, it The GET routine operates as follows: exchanges the address of the work area for the address stated in the current • It receives control when a GET macro­ CCW. The current CCW is found by instruction is encountered in a adding 8 to the value of the field processing program. DCBCCCW.

Queued Sequential Access Method Routines 21 • If an initial end-of-block condition • Whether a new buffer is needed. exists, it passes control to the Input Synchronizing and Error Processing rou~ • Whether to schedule the buffer for tine (module IGG019AQ) to obtain the Empty-and-Refill or for Refill-only. next full buffer. It then exchanges the address of the work area for the The first three of these det~rminations address stated in the first Read CCW of are made at every pass through the routine. the channel program. The last determination is made after the routine establishes that the buffer can be • It tests for a new end-of-block condi­ scheduled. tion to determine if a buffer is empty and ready for refilling. If the records are unblocked, the address of the next record is the address • If no new end-of-block condition of the next buffer. exists, it presents the address of the next record, and returns control, to If the records are blocked, the address the processing program. of the next record is found by adding the record length (found in the DCBLRECL field) • If a new end-of-block condition exists, to the value in the DCBRECAD field. it passes control to the end-of-block routine to cause scheduling of the Whether the buffer can be scheduled and empty buffer for refilling. It then whether a new buffer is needed is deter­ presents the address of the next mined by whether an end-of-block condition record, and returns controL, to the exists. In the Update mode, one determina­ processing program. tion that an end-of-block condition exists causes both the last buffer to be scheduled The RELSE routine sets an end-of-block and a new buffer to be sought. An end-of­ condition and passes control to the end-of­ block condition exists for unblocked block routine to cause scheduling of the records at every pass through the routine; buffer for refilling. It then returns for blocked records it exists if the values control to the processing program. in the DCBRECAD (the address of the current record) field and the DCBEOBAD (the address of the end of the block) field are equal. To cause scheduling of the buffer, the GET UPDATE MODE GET ROUTINE routine passes control to the end-of-block routine. To obtain a new buffer, the GET routine passes control to the Update Syn­ The Update mode GET routine differs from chronizing and Error Processing routine other GET routines in that it shares its (module IGG019AF). buffers (as well as the DCB and the lOBs) with the Update mode PUT routine. The QSAM To cause scheduling of the buffer for Update mode of access uses simple buffering either Empty-and-Refill or Refill-only, the (in which the buffer is defined by the Update mode GET routine sets the lOB to start and end address of the buffer). point to the beginning of either of the two parts of QSAM Update channel program. If a PUTX macro-instruction addressed a These. two parts are the Empty part, which record in a block, the Update mode GET empties (writes out of) the buffer, and the routine determines, when the end of the Refill part, which refills (reads into) block is reached, that that buffer is to be that same buffer. (See Figure 4.) If emptied (that is, that the block is to be execution of a QSAM Update channel program updated) before being filled with a new begins with the Empty part, it is always block of data. If no PUTX macro­ followed by execution of the Refill part. instruction addressed a record in a block, Each part of the QSAM Update channel pro­ the Update mode GET routine determines, gram addresses a different location in when the end of the block is reached, that auxiliary storage: The Empty part addresses the buffer is to be refilled only, that is, the location from which the block to be that t.he last block need not be updated and updated was read; the Refill part addresses the buffer can be filled with a new' block the location from which the last block was of data. These characteristics of the read. Addressing the last known block and buffer, simple buffering, sharing the skipping over its data field leads to the buffer with the PUT routine, and emptying beginning of the next block, irrespective the buffer before refilling, influence the of its address. (This method of addressing manner in which the Update mode GET routine a Search command to the block read pre­ determines: . viously .to address a Read (Count, Key, and Data) command to the next block is known as • The address of the next record. the search-previous technique. It makes the count field of the present block being • Whether the buffer can be scheduled. read the Seek address of the Refill portion

22 of the next channel program.) When a The PUTX routine sets the Update flag in buffer is to be emptied (back to the the lOB and returns control to the process­ original location of the block in auxiliary ing program. storage), the Update mode GET routine obtains the block address from the Seek address of the Refill part of the next channel program. It copies the address so that it becomes the Seek address for the Channel Program Empty part of the present channel program. C" MBBCCHHR (See Figure 5.) (For a description of the A SEARCH The Empty portion of an Update Channel Program processing for a Refill-only QSAM Update TIC } channel program, refer to the description ~ WRITE (Data) of the Update 510 appendage.) 00-- SEEK B Whether to schedule the buffer for SEARCH Empty-and-Refill or for Refill-only depends TIC 1The Refill portion of an on whether the block is to be updated. If READ (Count) J"_'~"M''''_ the block is to be updated, the PUTX ..- --1 READ (Dala) routine will have set the Update flag on in --oi MBBCCHHR the lOB; else the flag is off. To schedule the buffer for Empty-and-Refill, the GET Buffer routine sets the lOB to point to the Empty ~ \ portion of the channel program and obtains the Seek address of the block to be updated lOB from the Refill portion of the next channel program. To schedule the buffer for Refill-only, the GET routine sets the lOB CPAD to point to the Refill portion of the channel program. The end-of-block condi­ Legend: tion which triggers this processing also A - Address of channel program (CPAD) used to empty and refill the buffer. causes control to pass to the end-of-block (A PUTX macro-instruction was addressed to a record in this buffer.) routine (module IGG019CC) for issuing the B ;.. Address' of channel program (CPAD) used only to refill the buffer. EXCP macro-instruction and to the Update (No PUTX macro-instruction was addressed to any record in this buffer.) Synchronizing and Error Processing routine (module IGG019AF) for obtaining the next Figure 4. The Two Parts of an Update Chan­ buffer. nel Program (Empty, Refill)

Channel Program for the Buffer Channel Program for the Buffer Channel Program for the Suffer Scheduled to be Emptied and Refilled Ta be Processed Next Just Emptied and Refilled

B 0 1-1 1-3 C ~---I 1-2 C ...P--- c: SEARCH c: SEARCH c: SEARCH I

WRITE {Data} f-- WRITE {Data} I WRITE (Data) --I I 1--, I I r- SEARCH .-- SEARCH I r- SEARCH ~ I I I A A I A ; READ (Count) ~- READ (Count) I READ (Count) I I I (Data) ---: (Data) (Data) L_= L_~ C? 1+1 il L__ ~ 1-1 ]1 I ~ ~ l!~ Data of Block I-l ~ Data of Block I i Data of Block 1+1 1 Buffer Contents Buffer Contents Buffer Contents

Legend:' A -'The Refill portion reads the count field of the block being read into the search argument, of the next Refill portion.

B - To empty the buffer, the search argument of the next Refill portion is used as the ,search a'gument of this Empty portion.

C - To empty the buffer, the search argument of the next Refill portion was copied before the last time this buffer was scheduled.

o - To emPty the buffer, the search argument of the hext Refill portion will be copied before the next time this buffer is scheduled.

~--- Present entries ---.-- Future entries Figure 5. Relation of Seek Addresses in Three Successive QSAM Update Channel Programs

Queued Sequential Access Method Routines 23 The RELSE routine sets an end-of-block The module consists of a GET routine, a condition and returns control to the proc­ RELSE routine, and a PUTX routine. essing program. The GET routine operates as follows: The OPEN executor primes (that is, sche­ dules for filling) all the buffers except • It receives control when a GET macro­ one if QSAM is used with a DCB opened for instruction is encountered in a Update. The OPEN executor also sets an processing program. end-of-block condition; the first time that the Update mode GET routine gains control, • It tests for an end-of-block condition it processes this condition in its normal to determine whether the buffer can be manner. scheduled and whether a new buffer is needed. (When the OPEN executor primes There is one Update mode GET routine .• the buffers, it schedules all buffers If the access conditions shown in Table 4 except one and sets an end-of-block are specified for a DCB., the OPEN executor condition. ) selects this routine, loads it, and places its address into the DCBGET field. • If no end-of-block condition exists, it presents the address of the next Table 4. Module Selector - Update Mode GET record, and returns control, to the Module processing program. For variable­ r------T------, length and undefined-length records, it I I I also determines the length of the I Access Conditions I Selections I record and places it in the DCBLRECL I I I field in the DCB. ~------+--T-T-T-T-~ I Update, GET IX IXIXIXIXI • If an end-of-block condition exists, it ~------+--+-+-+-+-~ tests whether the buffer is to be IFixed-length record format IX IXI I I I emptied and refilled or is to be ~------+--+-+-+-+-~ refilled only. IVariable-length record format I I IXIXI I ~------+--+-+-+-+-~ • If it is to be refilled only, it sets IUndefined-length record format I I I I IXI the lOB to point to the start of the ~------+--+-+-+-+-~ Read portion of the Update channel IBlocked record format IX I IX I I I program and passes control to the end­ ~-----~------+--+-+-+-+-~ of-block routine to cause scheduling of IUnblocked record format I IXI IXIXI the buffer. ~------+--~-~-~-~-~ I I I • If it is to be emptied and refilled, it I GET Module I I sets the lOB to point to the start of I I I the Update channel program. The ~------+--T-T-T-T-~ routine obtains the auxiliary storage I IGG019AE1 IX IXIXIXIXI address to be used by the Write portion ~------~--~-~-~-~-~ of the channel program by copying the 11This module also carries the Update model address used by the Read portion of the I PUTX routine I channel program associated with the L ______------______J next lOB. The routine then passes control to the end-of-block routine to cause scheduling of the buffer. GET Module IGG019AE • On return of control from the end-of­ block routine, the GET routine passes control to the Update Synchronizing and Module IGG019AE presents the processing Error Processing routine (module program with the next input record, flags IGG019AF) to obtain a new full buffer. the lOB if the block is to be updated (that is~ emptied and refilled), and sets the lOB • On return of control from the to address a QSAM Update channel program synchronizing routine, the GET routine for either Empty-and-Refill or Refill-only. updates the DCBLRECL field and presents The OPEN executor selects and loads this the address of the next record, and module if the OPEN parameter list speci­ returns control, to the processing pro­ fies: gram. - Update The RELSE routine operates as follows: and the DCB specifies: • It receives control when a RELSE macro­ instruction is encountered in the - GET. proceSSing program.

24 • It sets an end-of-block condition. ing deal with buffers that are exchanged between the output DCB, the input DCB, and • It returns control to the processing the processing program. The PUTX routine program. for the Update mode of OPEN uses simple buffering; it differs from other PUT rou­ The PUTX routine operates as follows: tines in that it shares the buffer used by the Update mode GET routine. The manner in • It receives control when a PUTX macro­ which a PUT routine performs its processing instruction is encountered in the depends on the buffering mode. processing program. Sireple buffering PUT routines determine • It sets the Update flag in the. lOB to the address of the next buffer segment by show that the buffer is to be emptied referring to the DCB. To determine whether before being refilled. a buffer is ready for scheduling and wheth­ er a new buffer is needed, these routines • It returns control to the processing compare the beginning and ending address of program. the buffer (or the record and the remaining space in the buffer). To accept a record, a PUT routine using simple buffering either moves the record into the buffer or PUT ROUTINES requires the processing program to do so. Exchange buffering PUT routines deter­ There are seven different PUT routines. mine the address of the next buffer segment A particular PUT routine is used with a by referring to the channel program. To specific data set on the basis of the determine whether a buffer is to be sche­ access condition options specified by the duled and whether a new buffer is needed, processing program for access to that data these routines compare the beginning and set. ending address of the channel program. To accept a record, an exchange buffering PUT A PUT routine gains CPU control when a routine exchanges its buffer segment for a PUT., PUTX, or TRUNC macro-instruction is work area or for a buffer segment of an encountered. The PUT routine returns con­ input DCB, or may move the record into the trol to the processing program., unless buffer segment. either an output buffer is ready to be scheduled for emptying or a new empty The Update mode PUTX routine flags the buffer is needed. If a buffer is ready for buffer from which the last record was emptying, the PUT routine passes control to presented for updating. an end-of-block routine. If a new empty output buffer is needed, the PUT routine The PUT routine descriptions are accord­ passes control to a synchronizing and error ingly grouped as: processing routine. A PUT routine accepts a record from the processing program to • Simple Buffering PUT Routines. assemble a block of data for an output channel program. A PUTX routine accepts an • Exchange Buffering PUT Routines. output record from an input data set; a RELSE routine causes the present buffer to • Update Mode PUTX Routine. be considered ready for scheduling. Every PUT routine determines in each pass through the routine: SIMPLE BUFFERING PUT ROUTINES • The address of the next buffer segment. Simple buffering PUT routines use buf­ • Whether, an output buffer is to be fers whose beginning and ending addresses scheduled for emptying .• are stated ln the DCB. The beginning address is in the field DCBRECAD (address • Whether a new empty output buffer is of the next record); the ending address is needed. in the field DCBEOBAD (address of the end of the buffer). In each pass through a In each entry into a PUT routine, it routine, it determines: accepts a record for output. • The address of the next buffer segment. PUT routines differ mainly in the buf­ fering techniques they support. PUT rou­ • Whether an output buffer is to be tines for simple buffering deal with buf­ scheduled for emptying. fers that are permanently associated with one DCB. PUT routines for exchange buffer- • Whether a new empty buffer is needed.

Queued Sequential Access Method Routines 25 These three determinations are made at the next entry to the routine, after the every pass through a PUT routine. processing program has moved the record into the tuffer. If the records are unblocked, the For blocked records, the time that an address of the next available buffer seg­ EOB condition occurs depends on the record ment is always that of the next buffer. format. For fixed-length blocked records, an EOB If the records are blocked, a PUT rou­ condition occurs when the DCBRECAD field tine determines the address of the next equals the DCBEOBAD field. (The DCBRECAD available buffer segment by adding the field shows the address of the segment for length of the last record to the address of the next record. The DCBEOBAD field shows the last buffer segment. The address of a value equal to one more than the address the last buffer segment is in the DCBRECAD of the end of the buffer.) If using the field of the data control block (DCB). If move operating mode, the PUT routine moves the records are fixed-length blocked the last fixed-length record into the buf­ records, the length of each record is in fer, updates the DCBRECAD field, and esta­ the DCBLRECL field. If the records are blishes that an EOB condition exists for variable-length blocked records, the length the present buffer. If using the locate of each record is in the length field of operating mode, the processing program the record itself. moves the last fixed-length record into the buffer. On the next entry to the PUT routine, the routine updates the DCBRECAD A PUT routine determines that a buffer field, and establishes that an EOB condi­ is ready for emptying, and that a new empty tion exists for the present buffer. buffer is needed, by establishing that an end-of-block (EOB) condition exists. For variable-length blocked records, an EOB condition occurs when the next record exceeds the buffer balance, that is, the If an output buffer is to be scheduled record length is greater than the space for emptying, a PUT routine passes control remaining in the buffer. If using the move to an end-of-block routine, to cause the operating mode, the PUT routine establishes present buffer to be scheduled for output. that an EOB condition exists when the record length stated in the first word of the record exceeds the buffer balance. If If a new empty buffer is needed, a PUT using the locate operating mode, the PUT routine obtains a new buffer by passing routine establishes that an EOB condition control to the Output Synchronizing and exists when the value stated in the Error Processing routine (module IGG019AR). DCBLRECL field in the DCB exceeds the For a buffer that was emptied without buffer balance. error, the synchronizing routine updates the DCBIOBA field (thus pointing to the new A TRUNC routine sets an end-of-block buffer) and returns control to the PUT condition to empty the buffer. This end­ routine. The PUT routine updates the of-block condition is processed so that the DCBRECAD field by inserting the starting next entry to the PUT routine permits it to address of the buffer from the channel operate as usual. Successive entries to a program associated with the new lOB.. To TRUNC routine without intervening entries update the DCBEOBAD field, the routine adds to a PUT routine cause the TRUNC routine to the length of the block stated in the return control without performing any DCBBLKSIZE field to the buffer starting processing. address. These two fields., DCBRECAD and DCBEOBAD, define the available buffer. To permit a PUT routine to operate normally when it is entered for the first time, the OPEN executor initializes the DCB An EOB condition is established by dif­ fields DCBRECAD and DCBEOBAD. For an out­ ferent criteria for different record for­ put data set using QSAM and simple buffer­ mats and operating modes. ing, the values entered in these fields depend on the operating mode. For locate For unblocked records, an EOB condition mode routines, it sets them to show the exists after each record is placed in the beginning and end of the first buffer; for buffer. If using the move operating mode, move mode routines it sets an end-of-block a PUT routine establishes that an EOB condition. condition exists for the present buffer after the routine has moved the record into There are four simple buffering PUT the buffer. If using the locate operating routines. (Modules for the move operating mode, a PUT routine establishes that an EOB mode include PUTX routines.) Table 5 lists condition exists for the present buffer on the routines available and the conditions

26 that cause a particular routine to be used. The PUT routine operates as follows: The OPEN executor selects one of the rou­ tines, loads it, and places its address into the DCBPUT field. The table shows, • It receives control when a PUT macro­ for example, that when the DCB specifies instruction is encountered in a the locate mode and fixed-length records, processing program. routine IGG019AI is selected and loaded.

• It determines the address of the next Table 5. Module Selector - Simple Buffer- buffer segment using the value in the ing PUT Modules DCBLRECL field. r------T-·------, I I I I Access Conditions ISelections I • It tests for an EOB condition to deter­ I I I mine whether a buffer is full and ready ~------+-T-T-T-T-T-i for emptying and also whether a new I Output, PUT/PUTX, Simple IXIXIXIXIXIXI empty buffer is needed. I buffering I I I I. I I I t--~------+-+-+-+-+-+-i ILocate operating mode IXIXIXI I I I • If no EOB condition exists, it presents t------~------+-+-+-t~+-+-i the address of the next buffer segment IMove operating mode I I I IXIXIXI to the processing program, and returns ~------+-+-+-+-+-+-i control to the processing program. IFixed-length record format IXI I IXI I I t------f-f-f-+-+-f-i IUndefined-length record I IXI I IXI I • If an EOB condition exists, it issues a I format I I I I I I I BALR instruction to pass the present t------+-+-f-+-f-f-i buffer to the end-of-block routine. I Var iable-length record format t t IX I I I X I The PUT routine issues another BALR t------+-~-+-+-~-+-i instruction to obtain a new buffer I I I I I I through the Output Synchronizing and I PUT. Modules I I I I I Error Processing routine (module I I I I I I IGG019AR), and determines the address ~------+-T-f-f-T-f-i of the first segment of the new buffer. I IGG019AI IXIXI I I I I The PUT routine then presents this t------f-f-f-+-f-+-~ address to the processing program and I IGG019AJ I I IXI I I I returns control to the processing pro­ t------:------...;....;.-----f-+-+-+-f-+-i gram. I IGG019AK I I I IXIXI I t------~------+-+-+-f-+-+-i The TRUNC routine causes anEOB condi­ tion by setting the DCBRECAD and DCBEOBAD LI ______IGG019AL ~~_~_~_~~_JI I I I I IXI fields so that they are equal; it then returns control to the processing program.

PUT Module I.GG019AI PUT Module IGG019AJ

Module IGG019AI presents the processing program with the address of the next avail­ Module IGG019AJ presents the processing able buffer segment for a fixed-length or program with the address of the next avail­ undefined-length record. The OPEN executor able buffer segment for a variable-l.ength selects and loads this module if the OPEN record. The OPEN executor selects and parameter list specifies: loads this module if the OPEN parameter list specifies: - Output - Ou.tput and the DCB specifies: and the DCB specifies: - PUT - Simple buffering - PUT - Locate operating mode - Simple buffering -Fixed-length (unblocked, blocked, or - Locate operating mode blocked standard) or undefined-length - Variatle-length (unblocked, blocked) record format. record format. The module consists of a PUT· routine and a· The module consists of a PUT routine and a TRUNC routine. TRUNC routine.

Queued Sequential Access Method Routines 27 The PUT routine operates as follows: - PUT - Simple buffering - Move operating mode • It receives control when a PUT macro­ Fixed-length (unblocked, blocked, instruction is encountered in a blocked standard) or undefined-length processing program,. record format. The module consists of a PUT routine, a • It determines the address of the next PUTX routine, and a TRUNC routine. buffer segment using the length field of the record moved by the processing The PUT routine operates as follows: program into the buffer segment located last. • It receives control when a PUT macro­ instruction is encountered in a processing program. • It tests for an EOB condition to deter­ mine whether a buffer is ready for • If an EOB condition exists, it issues a emptying and also whether a new empty BALR macro-instruction to obtain a new buffer is needed, using the value buffer through the Output Synchronizing placed into the DCBLRECL field by the and Error Processing routine (module processing program. IGG019AR), and then moves the record from the work area into the first buffer segment. • If no EOB condition exists, it tests for blocked records. • If no EOB condition exists, it moves the record from the work area into the next buffer segment. • If blocked records are specified, it presents the address of the next buffer • It tests for blocked records. segment to the processing program, and returns control to the processing pro­ • If blocked records are specified, it gram. determines the address of the next segment and tests for a new EOB condi­ tion. • If an EOB condition exists or if unblocked records are specified, it • If unblocked records are specified or issues a BALR instruction to pass the if a new EOB condition exists, it present buffer to the end-of-block rou­ issues a BALR instruction to pass the tine. The PUT routine issues another present buffer to the end-of-block rou­ BALR instruction to obtain a new buffer tine, and then returns control to the through the Output Synchronizing and processing program. Error Processing routine (module IGG019AR), and determines the address • If no new EOB condition exits, it of the first segment of the new buffer. returns control to the processing pro- The PUT routine then presents this gram. address to the processing program and returns control to the processing pro­ gram. The PUTX routine operates as follows:

The TRUNC routine causes an EOB condi­ • It receives control when a PUTX macro­ tion by setting the DCBRECAD and DCBEOBAD instruction is encountered in a fields so that they are equal; it then processing program. returns control to the processing program. • It obtains the DCBRECAD value of the input DCB, which points to the present record in the input buffer. PUT Module IGG019AK • It enters the PUT routine at the start. The PUT routine then uses the input Module IGG019AK moves the present fixed­ DCBRECAD value in place of the work length or undefined-length record into the area address. next available buffer segment. The OPEN executor selects anq loads this module if the OPEN parameter list specifies: The TRUNC routine operates as follows:

- Output • It receives control when a TRUNC macro­ instruction is encountered in a and the DCB specifies: processing program.

28 • It simulates an EOB condition. the record from the work area to the buffer, updates the block-length field, and returns control to the processing • It issues a BALR instruction to pass program. the present buffer to the end-of-block routine. The PUTX routine operates as follows:

• On return of control from the end-of­ • It receives control when a PUTX macro­ block routine it returns control to the instruction is encountered in a processing program. processing program. • It obtains the DCBRECAD value of the input DCB, which points to the present record in the input buffer. PUT Module IGG019AL • It enters the PUT routine at the start. The PUT routine then uses the input Module IGG019AL moves the present DCBRECAD value in place of the work variable-length record into the next avail­ area address. able buffer segment. .The OPEN executor selects and loads this module if the OPEN parameter list specifies: The TRUNC routine operates as follows: - Output • It receives control when a TRUNC macro­ instruction is encountered in a and the DCB specifies: processing program.

- PUT • It issues a BALR instruction to pass - Simple buffering control of the present buffer to the - Move operating mode end-of-block routine. - Variable-length (unblocked or blocked) record format. • It issues another BALR instruction to obtain a new buffer through the Output The module consists of a PUT routine, a Synchronizing and Error Processing rou­ PUTX routine, and a TRUNC routine. tine (module IGG019AR).

• It determines the address of the first The PUT routine operates as follows: segment of the new buffer, and then returns control to the processing pro­ • It receives control when a PUT macro­ gram. instruction is encountered in a processing program,.

• It determines the address of the next EXCHANGE BUFFERING PUT ROUTINES buffer segment and compares the length of the next record with the remaining buffer capacity. Exchange buffering PUT routines use buf­ fers whose addresses and lengths are in the • If the record fits into the buffer" it channel program. For unblocked records, a moves the record., updates the length buffer address and length are in one chan­ field of the block" and tests for nel command word (CCW). For blocked blocked records. records, addresses of buffer segments are in successive CCWs (though the segments • If blocked records are specified, it themselves are not necessarily located next returns control to the processing pro­ to one another). Ineach.pass through an gram. exchange buffering GET routine, it deter­ mines:

• If the record does not fit into the • The address of the next buffer segment. buffer or if unblocked records are specified, it issues a BALR instruction • Whether an output buffer is to be to pass the present buffer to the scheduled for emptying. end-of-block routine. It issues anoth­ er BALR instruction to obtain a new • Whether a new empty buffer is needed. buffer through the output Synchronizing and Error Processing routine (module These three determinations are made at IGG019AR). The PUT routine then moves every pass through a PUT routine.

Queued sequential Access Method Routines 29 If the records are unblocked, a PUT There are two exchange buffering PUT routine finds the address of the next routines. Table 6 lists each of these buffer in the Write ecw for the next routines and the conditions that cause buffer. either routine to be used. The OPEN execu­ tor selects one of the routines, loads it, If the records are blocked" a PUT rou­ and places its address into the DCBPUT tine finds the address of the next buffer field. The table shows" for example, that segment in the next Write CCW. The next if output, PUT, exchange, move, and CCW is found by adding 8 to the address of unblocked record format are specified, the previous cew, the value in the DCB module IGG019EE is selected for use as the field DCBcecw. PUT routine. If an output buffer is to be scheduled Table 6. Module Selector - Exchange Buf- for emptying, a PUT routine passes control fering PUT Modules to an end-of-block routine to cause sche­ r------T------, duling of the buffer. An end-of-block I I I routine passes control to the I/O supervi­ I Access Conditions I Selections I sor to have it schedule the buffer,. After I I I scheduling, the I/O supervisor returns- con­ ~------~+-T-T-T-T-T-T-~ trol to the end-of-block routine, and it I Output" PUT/PUTX, Exchange IXIXIXIXIXIXIXI returns control to the PUT routine,. ~------+-+-+-+-+-+~+-~ IMove mode IXIXIXI I IXI I If a new empty buffer is needed" a PUT ~------+-+-+-+-+-+-+-~ routine passes control to the output syn­ ISubstitute mode I I I IXIXI IXI chronizing and error processing routine. ~------+-+-+-+-+-+-+-~ If the channel program for the next buffer IUnblocked record format IXIXIXIXIXI I I has been executed without error, the syn­ ~------+-+-+-+-+-+-+-~ chronizing routine enters the address of IBlocked record format I I I I I IXIXI the input/output block (lOB) that points to ~------+-+-+-+-+-+-+-~ that channel program into the DCBIOBA field I Fixed-length II I I I I I I in the DCB. Irecord format IXI 1 IXI IXIXI ~------+-+-+-+-+-+-+-~ An output buffer is to be scheduled for I Variable-length I I I I I I I I emptying and a new buffer is needed if an Irecord format I IXI I I I I I end-of-block condition exists. When using ~------+-+-+-+-+-+-+-~ exchange buffering with an output data set, I Undefined-length I I I I I I I I the buffer can be scheduled for emptying I record format I I I X I I X I I I when the address of the last record has ~------+-~-~-~-~-+-~-~ been placed in the last ecw or a record has I I I I been moved into the last segment. Accord­ I PUT Modules I I I ingly" an end-of-block test is made before I I I I leaving the routine. This test determines ~------+-T-T-T-T-+-T-~ whether the buffer is to be scheduled. I IGG019EE IXIXIXIXIXI I I another test is made on entry to determine ~------+-+-+-+-+-+-+-~ whether a new buffer is needed. An end-of­ LI ______IGG019EF ~~_~_~~~_~_~_JI I II I IXIXI block condition exists for unblocked records each time the routine is entered; for blocked records it exists if the address of the current CCW (in field PUT Module IGG019EE DeBCCCW) and the address of the last CCW (in field DCBLCCW) are the same. Module IGG019EE puts an unblocked record A TRONC routine sets an end-of-block into the next buffer. The OPEN executor condition to empty the buffer. This end­ selects and loads this module if the OPEN of-block condition is processed so that the parameter list specifies: next entry to the PUT routine permits it to operate as usual. Successive entries to a - Output TRUNC routine without intervening entries to a PUT routine cause the TRUNe routine to and the DCB specifies: return control without performing any processing. - PUT, PUTX - Exchange buffering The processing performed by the OPEN - Unblocked record format executor for an output data set using QSAM - Move operating mode and fixed-, and exchange buffering includes setting an variable-, or undefined-length record end-of-block condition. On the first entry format; or substitute operating mode to an exchange buffering PUT routine it and fixed-, or Undefined-length record processes this condition as usual. format.

30 The module consists of a PUT routine, a • It passes control to the Output Syn­ PUTX routine, and a TRUNC routine. chronizing and Error Processing routine (module IGG019AR) to obtain the next buffer. The PUT routine operates as follows for the Move mode: • It finds the address of the input buffer in the DCBRECAD field of the input DCB and the input buffer length • It receives control if a PUT macro­ in the DCBLRECL field. instruction is encountered in the processing program. • It moves the record from the input buffer to the output buffer and enters the length in the Write (data) CCW. • It passes control to the Output Syn­ chronizing and Error Processing routine • It passes control to the end-of-block (module IGG019AR) to obtain the next routine to cause scheduling of the buffer. buffer for output.

• It returns control to the processing • It determines the address of the Write program. (data) CCW, enters the length in the CCW and finds the buffer address. The PUTX routine operates as follows if • It moves the record from the work area the input DCB specifies exchange buffering: into the buffer. • It receives control when a PUTX ma.cro­ • It passes control to the end-of-block instruction is encountered in a routine to cause scheduling of the processing program. buffer. • It passes control to the Output Syn­ • It returns control to the processing chronizing and Error Processing routine program. (module IGG019AR) to obtain the next buffer.

The PUT routine operates as follows for • It finds the address of the Read CCW the Substitute mode: and the length of the buffer in the DCBCCCW and DCBLRECL fields of the • It receives control when a PUT macro­ input DCB; it finds the address of the instruction is encountered in a Write CCW in the DCBCCCW field of the processing program. output DCB.

• It passes control to the output Syn­ • It exchanges the buffer addresses and chronizing and Error Processing routine enters the length into the Write CCW. (module IGG019AR) to obtain the next buffer. • It passes control to the end-of-block routine to cause scheduling of the • It determines the address of the Write buffer for output. (data) CCW, enters the length in the CCW and finds the buffer address. • It returns control to the processing program. • It exchanges the address of the work area and the address of the buffer The TRUNC routine receives control when area. a TRUNC macro-instruction is encountered in a processing program; it returns contralto • It passes control to the end-of-block the processing program without performing routine to cause scheduling of the any processing. buffer for output.

• It returns control, and the address of the buffer, to the processing program. PUT. Module IGG019EF

The PUTX routine operates as follows if Module IGG019EF puts .c;t blocked record the input DCB specifies simple buffering: into the next buffer segment. The OPEN executor selects and loads this module if • It receives control when a PUTX macro­ the OPEN parameter list specifies: instruction is encountered in a processing program. - Output

Queued Sequential Access Method Routines 31. and the DeB specifies: • If there is an end-of-block condition on entry to the routine, it passes - PUT, PUTX control to the Output Synchronizing and - .Exchange l:uffering Error Processing routine (module - Move or substitute operating mode IGG019AR) to obtain the next buffer. - Fixed-length blocked record format. The module consists of a PUT routine, a PUTX routine, and a TRUNe routine. • If the input DeB uses simple buffering, and either there is no end-of-block condition or control has returned from The PUT routine operates as follows: the synchronizing routine, the PUTX routine moves the record from the input l:uffer segment into the next output • It receives control when a PUT macro­ buffer segment. instruction is encountered in the processing program. • If the input DeB uses exchange buffer­ • If there is an end-of-block condition ing, and either there is no end-of­ on entry to the routine, it passes block condition or control has returned control to the Output Synchronizing and from the synchronizing routine, the Error Processing routine (module PUTX routine exchanges the buffer IGG019AR) to obtain the next buffer. segment addresses of the current output and input eews. • If the move mode is used, and either there is no end-of-block condition or • It tests for another end-of-block con­ control has returned from the synchron­ dition to determine if the buffer is to izing routine, the PUT routine moves be scheduled for output. the record from the work area into the next buffer segment. • If there is no end-of-block condition, it returns control to the processing • If the substitute mode is used, and program. either there is no end-of-block condi­ tion or control has returned from the synchronizing routine, the PUT routine • If there is an end-of-block condition, exchanges the current buffer segment it passes control to the end-of-block address of the output DeB for either routine to cause scheduling of the the current buffer segment address of buffer for output. On return of con­ the input DeB or the address of a work trol to the PUTX routine, it then area. returns control to the processing pro­ gram.

• It tests for another end-of-block con­ dition to determine if the buffer is to The TRUNe routine operates as follows: be scheduled for output. • It receives control when a TRUNC macro­ • If there is no end-of-block condition, instruction is encountered in a it returns control to the processing processing program. program.

• It returns control to the processing • If there is an end-of-block condition, program without any further processing it passes control to the end-of-block if the buffer was scheduled f'or output routine to cause scheduling of the on the preceding entry into the PUT or buffer. On return of control to the PUTX routine. PUT routine, it returns control to the processing program. • It turns off the chain-data bit in the ecw used in the preceding pass through The PUTX routine operates as follows: the PUT or PUT X routine. (The chain­ data bit is set on in every ecw in the • It receives control when a PUTX macro­ normal course of operation of the PUT instruction is encountered in the or PUTX routine to offset any possible processing program. prior truncation.)

32 • It passes control to the end-of-block • Ordinary end-of-block routines. These routine to cause pcheduling of the routines perform device oriented proc­ buffer for output. On return of essing when normal channel program control, the TRUNC routine then returns scheduling is used (except when it is control to the processing program. used with an output data set with track overflow) •

• Chained channel-program scheduling end­ UPDATE MODE PUTX ROUTINE of-block routines. These routines perform device o,riented processing and attempt to chain channel programs when The Update mode PUTX routine differs chained channel-program scheduling is from other PUT routines in that it shares used. its buffers (as well as the DCB and the lOBs) with the Update mode GET routine. It • Track overflow end-of-block routine. is the Update mode GET routine that deter­ This routine performs device oriented mines the address of the segment, when the processing and computes segment lengths end of the buffer is reached, and when a and constructs count fields when track new buffer is needed~ Thus all that is overflcw (which uses normal channel­ left for the PUTX routine to do is to flag program scheduling) is used with an the block for output. output data set.

There is one Update mode PUT routine; it is part of module IGG019AE which also carries the Update mode GET routine. The ORDINARY END-OF-BLOCK ROUTINES module (including the PUTX routine) is described in the Update mode GET routine section of this manual. \ Ordinary end-af-block routines process channel programs for all devices. This processing is independent of the progress of a previous channel program and causes access to proceed one channel program at a END-OF-BLOCK ROUTINES time. In the case of output data sets on direct-access devices, the routines limit the size of the block to the track There are nine different end-of-block capacity. For direct-access devices, an routines. They are selected for use with a ordinary end-of-block routine computes aux­ particular data set on the basis of the iliary storage addresses fer output data access conditions specified by the process­ sets and input data sets with fixed-length ing program for that data set. Unless standard record format to avoid end-of­ Inout or Outin is specified in the OPEN track interruptions. For unit record parameter list, one end-of-block routine is devices these routines process control selected. If Inout or Outin are specified, characters and PRTOV macro-instructions. two end-of-block routines may be required. For an input data set with track overf~ow progression from track to track is con­ trolled by the track overflow bit in the An end-of-block routine receives control overflowing segment, not by computation of from a GET or a PUT routine (when using the end.... of-block routine nor by an entry in QSAM), or from a READ or WRITE routine the channel program. (when using BSAM). In general, end-of­ block routines pass control to the I/O supervisor. An end-of-block routine There are four ordinary end-of-block receives control from a GET or a PUT routines. Table 7 lists the routines a­ routine when a buffer is ready forschedul­ vailable and the conditions that cause a ing. An end-of-block routine receives con­ particular routine to be used. For QSAM, trol from a READ or WRITE routine at each the OPEN executor selects one of the rou­ pass through those routines. Control pass­ tines, loads it and places its address into es from an end-of-block routine to the I/O the DCBEOB field. For BSAM and BPAM the supervisor, except when a channel program OPEN executor selects one of the routines, is chained to another one not yet executed. loads it, and places its address into both End-of':"block routines provide device ori­ the DCBEOBR and DCBEOBW fields. If Inout ented entries for the channel program, such or Outin is specified, a second end-of­ as control characters and auxiliary storage block routine may be selected and loaded. addresses. ' Its address replaces one of the duplicate addresses in the DCB. The table, for End-of-block routine descriptions are example, shows that when normal channel­ grouped as follows: program program scheduling is used, and the

Queued Sequential Access Method Routines 33 device type is magnetic tape, routine End-Of-Block MOdule IGG019CC IGG019CC is selected and loaded for use as the end-of-block routine for that DCB. Module lGG019CC does nothing more than caUse a channel program to be schedUled. Table 7. Module Selector - Ordinary End- of-Block Modules r------T------, The OPEN executor selects and loads this I I I module if one of the following conditions I Access Conditions I Selections I exists: I I I ~------+-T-T-T-T-T-T-T-T-T-~ INormal channel- IXIXIXIXIXIXIXIXIXIXI - The DCB specifies normal channel­ Iprogram scheduling I I I I I I I I I I I program scheduling and magnetic tape, ~------+-+-+-+-+-+-+-+-+-+-~ card reader, or paper tape as the I Input, or I I I I X I X I X I I I I I device type. ~------+-+-+-+-+-+-+-+-+-+-~ I Upda te I I I X I I , , I I I I ~------+-+-+-+-+-+-+-+-+-+-~ The data set is opened for Input, and lout put, or I I I I I I I X I I I I the DCB specifies normal channel­ ~------+-+-+-+-+-+-+-+-+-+-~ program scheduling, direct-access I Inout, outin I I I I X I I X I X I I I I storage device, and a record format ~------+-+-+-+-+-+-+-+-+-+-~ other- than fixed-length length stand­ ICard reader or IXI I I I I I I I I I ard. Ipaper tape reader I I I I I I I I I I I ~------+-+-+-+-+-+-+-+-+-+-~ IPrinter or card I I I I I I I IXIXIXI - The d.Clta set is opened for Inout or I punch I I I I I I I I I I I Outin, and the DCB specifies normal ~------+-+-+-+-+-+-+-+-+-+-~ channel-program scheduling, direct­ IMagnetic tape I IXI I I I I I I I I access device storage and a record ~------+-+-+-+-+-+-+-+-+-+-~ format other than fixed-length IDirect-access I I I IXI IXIXI I I I standard. The address of this module I storage I I I I I I I I I I I is placed in the DCBEOBR field. ~------+-+-+-+-+-+-+-+-+-+-~ ITrack overflow I I I I IXI I I I I I ~------+-+-+-+-+-+-+-+-+-+-~ - The data set is opened for Update. IRecord format is I I I IXI I I I I I I Inot fixed-length I I I I I I I I I I I I standard I I I I I I I I I I I The module operates as follows: ~------+-+-+-+-+-+-+-+-+-+-~ I Record format is I I I I I I X I I I I I • It receives control when a GET or a PUT I fixed-length I I I I I I I I I I I routine finds that a buffer is ready to I standard I I I I I I I I I I I be scheduled, or at the conclusion of ~------~------+-+-+-+-+-+-+-+-+-+-~ the processing performed by a READ or INO control I I I I I I I IXI I I WRITE routine. t character I I I I I I I I I I I ~------+-+-+-+-+-+-+-t-+-t-~ IMachine control I I I I I I I I IXI I • If the device type is magnetic tape, I character I I I I I I I I I I I paper tape, or card reader, the module ~------+-+-+-+-+-+-+-+-+-+-i issues an EXCP macro-instruction and IASA control I I I I I I I I I IXI returns control to the GET, PUT, READ, I character I I I I I I I I I I I or WRITE routine. ~------+-+-+-+-+-+-+-+-+-+-~ IPRTOV-No user exit I I I I I I I pqxlxl ~------+-~-~~-~-+-~-+-~-+-~ • If the device type is direct-acces$ and I I I I I t more than one lOB is associated with I End-of-Block I I I I I the DCB, the IPodule issues an EXCP I Modules I I I I I macro-instruction. and returns control I I I I I I to the GET or READ routine. ~------+-T-T-T-T-+-T-+-T-+-~ I IGG019CC IXIXIXIXIXI I I I I I ~------+-+-+-+-+-+-+-+-+-+-~ • If the device type is direct-access and I IGG019CD I I I I I I X I X I I I I only one lOB is associated with the ~------.:.------+-+-+-t-+-+-+-t-t-+-~ DCB, the module copies the DCBFDAD I IGG019CE I I I I I I I IXIXI I field in the DCB into the IOBSEEK field ~------+-+-+-+-+-+-+-+-+-+-~ in the. lOB, issues an EXCP macro­ I IGG019CF I I I I I I I I I IXI instruction and returns control to the L ______~_~_~_~_~_~_~_~_~_~_J GET or READ routine.

34 End-of-Block ModuleIGG019CD It converts the full device address (MBBCCHHR) of the present track into a relative address (TTR) by Module IGG019CD schedules a channel passing control to the IECPRLTV program after determining that the next routine. block fits on a track within the allocated extents. It adds 1 to the value of TT. It converts the relative address of the next track into the full device The OPEN executor selects and loads this address by passing control to the module if one of the following conditions IECPCNVT routine. exists: • If there is another track in the allo­ - The data set is opened for output, and cated extents, its full address has the DCB specifies normal channel­ been entered in the field DCBFDAD and program scheduling, no track-overflow, the block fits on the track. and direct-access storage as the device type. • If there is no other track in the allocated extents (as shown by the - The data set is opened for Input, and error return code from routine the DCB specifies normal channel- IECPCNVT), an EOV condition exists. program scheduling, direct-access The module sets the DCBCINDl field in storage as the device type. the bCB and the CSW field in the lOB to show this, and returns control to the GET, PUT, READ, or WRITE routine with­ - The data set is opened for Inout or out issuing an EXCP macro-instruction. Outin, and the DCB specifies direct­ The EOV condition is eventually recog­ access device storage. If the record nized and processed, in QSAM by the format (also specified in the DCB) is synchronizing routine, in BSAM by the other than fixed-length standard the CHECK routine. address of this module is placed in the DCBEOBW field. If the record format is fixed-length standard, the address of • When the module determines that the this module is placed in both DCBEOBR block fits on the track, the module and DCBEOBW fields. calculates the actual block length, using the value OVerhead-not last record. (This value is found in the The module operates as follows: resident I/O device table.) It adjusts the value in the DCBTRBAL field by this amount, and updates the DCBFDAD field • It receives control when a GET or a PUT and the ID field of the count area of routine finds that a buffer is ready to the block (located immediately after be scheduled, or at the conclusion of the channel program). It then issues the processing performed by a READ or an EXCP macro-instruction and returns WRITE routine. control to the GET, PUT, READ, or WRITE module.

• It calculates the block length using the value overhead-last record. (This value is found in the resident 1/0 device table. The address of the table End-af-Block ModuleIGGCl19CE is in the field DCBDVTBL.) It compares the calculated block length with the value in the DCBTRBAL field of the DCB. Module IGG019CE, if necessary, modifies channel programs for unit record output devices when ASA control characters are not • If the block length is equal to or less used. The module then causes scheduling of than the DCBTRBAL field value, the the channel program, whether it was modi­ module determines that the block fits fied or not. The OPEN executor selects ana on the track. loads this module if the bCB specifies:

- Normal channel~program scheduling • If the block length exceeds the - Punch, Or printer DCBTRBAL field value, the module finds - Machine control charactE31:, or no con- the next track as follows: trol character.

Queued Sequential Access Method Routines 35 The module operates as follows: • It translates the control character and inserts it as the command byte of the • It receives control when a PUT routine control channel command word (CCW) finds that a buffer is ready to be which precedes the Write CCW. scheduled, or at the conclusion of the processing performed by a WRITE rou­ • It tests the DCB field at location tine. (DCBDEVT+l) for a PRTOV mask. If a PRTOV mask is present, the module inserts it into the length field of the • It adjusts, in the channel program, the Control CCW and sets the first bit in length and starting address either for the lOB. The PRTOV appendage the length field of variable-length (IGG019CL) tests for the presence of records or for a control character. If the lOB bit and the CCW R,ask. there are variable-length records and a control character, the module adjusts • It issues an EXCP macro-instruction and for both. returns control to the PUT or WRITE routine. • If a control character is present, it inserts it as the command byte of the Write channel command word (CCW). CHAINED CHANNEL-PROGRAM SCHEDULING END-OF-BLOCK ROUTINES • It tests the DeB field at location (DCBDEVT+l) for a PRTOV mask. If a Chained channel-program scheduling con­ PRTOV mask is present, the module tem­ sists of joining the channel programs porarily inserts it into the length before execution and parting and posting field of the NOP CCW and sets the first the channel programs after execution. bit in the lOB. The PRTOV appendage Joining is performed by the end-of-block (IGG019CL) tests for the presence of routines and mainly uses the input/output the lOB bit and the CCW mask. block (lOB); parting and posting is per­ formed by appendages and uses the interrup­ tion control block (ICB). (For a descrip­ • It issues an EXCP macro-instruction and tion of the parting process, refer to the returns control to the PUT or WRITE program controlled interruption -PC I­ routine. appendages.) The lOB constructed by the OPEN executor when chained channel-program scheduling is used differs from the lOB used in normal channel-program scheduling. These differences are illustrated in Figure End-of-Block Module IGG019CF 6 and tabulated in Table 8.

Module IGG019CF modifies channel pro­ grams for unit record output devices when an ASA control character is present. The module then causes scheduling of the chan­ (a) (b) nel .program, whether it was modified or SAM Prefix to lOB when SAM Prefix to lOB when normal channel-program chained channel-program not. The OPEN executor selects and loads scheduling is used scheduling is used this module if the DCB specifies: Flags I Offsets I Event Control Block Next lOB I Event Contro I Block First ICB I Last NOP CCW - Normal channel-program scheduling - Punch, or printer - ASA control character.

Standard lOB Standard lOB

The module operates as follows: I EeB Address * I ECB Address **

• It receives control when a PUT routine • 2 Words • _----2Words---_ finds that a buffer is ready to be .. When QSAM is used, the address 'II'll Always shows the address of scheduled, or at the conclusion of the is that of the ECB in the the ECB in the SAM prefix, processing performed by a WRITE rou­ SAM prefix; when BSAM is used irrespective of whether QSAM the address is that of the ECB Of. BSAM is used. tine. in the data event control block (DECB). • It adjusts, in the channel program, the length and starting address for the Figure 6~ Comparison of the lOB SAM Pre­ control character" and for the length fixes for Normal and for Chained field of variable-length records. Scheduling

36 These routines join channel programs so since it and chained scheduling are mutual­ that the channel executes successive chan­ ly exclusive.) nel programs without interruption as if they were one continuous channel program. To join the present channel program to one already scheduled, the end-of-block routine finds the last CCW of the preceding channel There are four chained scheduling end­ program, by referring to the lOB, and of-block routines, each performing joining changes that CCW from a NOP command to a and. channel program entry processing for a TIC command. If this joining is performed different set of access condition options. before the channel attempts to execute Table 9 lists the routines available and (more precisely, before it fetches) that the conditions that cause a particular CCW, the joining process is successful. If routine to be used. the execution of the preceding channel program is completed while the routine is operating the joining is unsuccessful. The routine tests the success or failure of the For QSAM, the OPEN executor selects one joining by testing whether the lOB has been of the routines, loads it and places its posted as completed. If successful, con­ address into the DCBEOB field. For BSAM trol returns to the calling program; if and BPAM the OPEN executor selects one of unsuccessful, the routine resets the lOB the routines, loads it, and places its for the EXCP macro-instruction and passes address into both the DCBEOBR and DCBEOBW control to the I/O supervisor. fields. If Inout or Outin is specified, a second end-of-block routine may be selected and leaded. Its address replaces one of the duplicate addresses in the DCB. The chained scheduling end-of-block rou­ tines, like the ordinary end-of-block rou­ tines, provide device oriented entries for The table, for example, shows that when channel programs. For direct-access devi­ chained scheduling is used, the Open mode ces they compute auxiliary storage address­ is Input, and the device type is magnetic es; for unit record devices they process tape, routine IGG019CW is selected and control characters. (NO processing is per­ loaded for use as the end-of-block routine formed for the PRTOV macro-instruction for the DCB.

Table 8. Comparison of the lOB SAM Prefixes for Normal and for Chained Scheduling r------T------T------, I I I I I Prefix Parameter I Normal Scheduling I Chained SCheduling I t I I I .------+------+------~ I Number of lOBS I As many as there are buffers I Only 1 (There are as many I I I or channel programs I ICBs as there are buffers or I I I I channel programs) I ~------+------+------f I Size of SAM Prefix I 2 words I 4 words I ~------+------+------~ I Contents of I Address of the next lOB I Flags I I Link Address field I I Offsets I ~------+------+------1 I Use of I Used in QSAM to post channel I Used in QSAM and BSAM to post J I ECB field I program execution (In BSAM, I a channel program execution I I I the ECB in the DECB is used) I that is terminated by I I I I channel end interruption I I I I (that is, channel program I I I I chaining has been broken) I ~------+------+------~------1 I Contents of I Field does not exist I Address of the first ICB I I IOBFICB field I I I .------+------+------~ I Content$of I Field does not exist I Address of NOP CCW of channel I LI ______IOBLNOP field ~I ______~I ______program scheduled last ~ ____ JI

Queued sequential Access Method Routines 37 Table 9. ModQle Seleqtor-ChaineQ Channel­ • It receives control from a PUT routine Program SchedQling End-of-Block when that routine finds that a buffer ModQles is ready to be schedQled, or from a r------T------, WRITE routine at the conclQsionOf its I I I processing. I I I I Access Conditions I Selections I I I I • It calculates the block length using ~--~------+~-T-T-T-T-T-T-i the overhead valQe for a last biock on IChained channel-program IXIXIXIXIXIXIXIXI a track. (This value is found in the I scheduling I I I I I I I II resident I/O device table. The address ~------'"'---+-+-+-+-+-+-+-+-i at the table is in the field DCBDVTBL.) I Input I X I X I I X I I I I I It compares the calculated block length ~------+-t-+-+-+-t-+-+-i with the value in the DCBTRBAL field of I Output I I IXI IXIXIXIXI the DCB. ~------+-+-+-+-+-+-+-+-i ICard re.ader IXI I I I I I I I ~------+-+-+~+-+-+-+-+-i • If the block length is equal to or less IPrinter or card punch I I I I I IXIXIXI than the DCBTRBAL field value, the ~------~-----+-+-+-+-+-+-+-+-i module determines that the block fits IMagnetic tape I IXIXI I I I I I on the track. ~------+-+-+-+-t-+-+-+-i IDirect-access storage I I I IXIXI I I I ~------+-+-+-+-+-t-+-+-i • If the block length exceeds the INO control character I I I I I IXI I I DCBTRBAL field value, the modQle calcu­ ~------+-+-+-+-t-+-+-+-i lates the next sequential track address I Machine control character I I I· I I I I X I I and compares it with the end address of ~------+-+-+-+-+-+-+-+-i the current extent shown in the data I ASA control character I I I I I I I I X I extent block (DEB). ~------+-+-+-+-+-+-+-+-i I I I I I I I I I I I End-of-Block Modules I I I I I I I I I • If.no end-of-extent condition exists, I I I I II I I I I it determines that the block fits on ~------+-+-+-+-+-+-+-+-i the track. I IGG019CV I I I I IXI I I I ~------+-+-+-+-+-+-+-+-i I IGG019CW IXlxlXIXI I I I I • If an end-of-extent condition exists, ~------t-+-+-+-+-+-t-+-i it seeks a new extent in, the DEB. I IGG019CX I I I I I IXIXI I ~------+-+-+-+-+-+-+-+-i I IGG019CY I I I I I I I IXI • If a new extent exists, it updates the L ______------_--______~_~-~_~-~-~_~_~_J DCBFDAD and DCBTRBAL fields and deter­ mines that the block fits on the track.

• If there is no further extent, an EOV End-ot-Block Module IGG019CV condition exists. The module sets the DCBCINDl field in the DCB and the CSW field in the lOB to show this, and Module IGG019CV compQtes from the track returns control to the GET, PUT, READ, balance (and from further allocated extents or WRITE routine wit.hout issuing an on this volume, if necessary) a valid EXCP macro-instruction. The EOV condi­ storage address for a channel program for tion.is eventually recognized and proc­ an output data set on a direct-access essed, in QSAM by the synchronizing device, and attempts to join the channel rOQtine, in BSAM by the CHECK routine. program to the preceding one. The OPEN executor selects· and loads this modQle if • If the module determines that the block the OPEN parameter list specifies: fits on the track, the module calcu­ lates the actual block length using the - Output overhead value fOr a block that is not the last on a track. (This value is and the DCB specifies: found in the resident I/O device table.) It adjusts the value in the - Chained channel-program scheduling DCBTRBAL field by this amount, and - Direct-access storage. Qpdates the DCBFDAD field and the ID field of the COQnt area Of the block (located immediately after the channel The module operates as follows: program) •

38 • If the block fits on the track, the End-ot-block Module IGG019CW module next attempts to join the chan­ nel program for the current buffer to the preceding channel program (that is, Module IGG019CW attempts to join the chain schedule) by: present channel program to the last one in the chain of scheduled channel programs. The OPEN executor selects and loads this Setting the ICB to not-complete. module if either of the following condi­ tions exists: Inserting the address of either the Write or the Search CCW of this channel program into the NOP CCW of - The OPEN parameter list specifies Input the preceding channel program. The and the DCB specifies chained channel­ address of the Write CCW is insert­ program scheduling and any device. ed if the present and the preceding channel program address the same - Tbe OPEN parameter list specifies track. The address of the Search output and the DCB specifies chained CCW is inserted if the present and cbannel program scheduling and magnetic the preceding channel programs ad­ tape. gress different tracks. In this case, the Search CCW addresses rec­ ord zero of the next track. The module operates as follows: Changing the NOP CCW in the preced­ ing channel program to a TIC CCW. • It receives control fron: a GET or a PUT routine when that routine finds that a Updating the SAM lOB prefix block buffer is ready to be scheduled, or to point to the end of the current from a READ or WRITE routine at the channel program. conclusion of its processing.

• If the device type is magnetic tape, • It determines whether the joining was the routine determines the increment successful by testing the ECB (pointed value and stores it in the rCB. to by the lOB) for a completion posting by the I/O supervisor. • The module attempts to join the channel program for the current buffer to the preceding channel program (that is, , If the I/O supervisor did not post the chain schedule) by: event as completed, the joining was successful and the routine returns con­ Setting the rCB to not-complete. trol to the calling routine. Inserting the address of the cur­ • If the I/O supervisor did post the rent channel program into the NOP event as completed, the routine tests CCW of the preceding channel pro­ the IeB for the present channel program gram. to find whether the joining was suc­ cessful or not. Ch(l.nging the NOP CCW in the preced­ ing channel program to a TIC CCW. • If the present ICB remains unposted, the present channel program was not Updating the SAM lOB prefix block joined to the preceding one. The rou­ to point to the end of the current tine prepares to cause restart of the channel program. channel by copying the Seek address and the channel program start address from the current ICB into the lOB, and uses • It determines whether the joining was the EXCP macro-instruction to cause succeSsful by testing the ECB (pointed scheduling of the channel progran:. It to by the rOB) for a completion posting then returns control to the calling by the I/O supervisor. routine. • If the I/O supervisor did not post the • If the present ICB is posted complete, event as completed, the joining was the present channel program was joined successful and the routine returns con­ successfully. (The routine was inter­ trol to the calling routine. rupted long enough, between the joining and the testing, for the channel pro­ • If the I/O supervisor did post the gram to be executed and for the channel event as completed, the routine tests .end appendage to post the rCB.) The the ICB for the present channel program routine returns control to the calling to find whether the joining was suc­ routine. cessful or not.

Queued Sequential Access Method Routines 39 • If the present ICB remains unposted, Changing the NOP CCW in the preced­ the present channel program was not ing channel program to a TIC CCW. joined to the preceding one. The rou­ tine prepares to cause restart of the Updating the SAM lOB prefix block channel by copying the channel program to point to the end of the current start address (and the Seek address, if channel program. direct-access storage) from the current ICB into. the lOB, and uses the EXCP • It determines whether the )01n1ng was macro-instruction to cause scheduling successful by testing the ECB pointed of the channel program. It then to by the lOB for a completion posting returns control to the calling routine. by the I/O supervisor.

• If the present ICB is posted complete, • If the I/O supervisor did not post the the present channel program was joined event as completed, the joining was successfully. (The routine was inter­ successful and the routine returns con­ rupted long enough, between the joining trol to the calling routine. and the testing, for the channel pro­ gram to be executed and for the channel • If the I/O supervisor did post the end· appendage to post the ICB.) The event as completed, the routine tests routine returns control to the calling the ICB for the present channel program routine. to find whether the joining was suc­ cessful or not.

End-of-block Module IGG019CX • If the present ICB remains unposted, the present channel program was not joined to the preceding one. The rou­ Module IGG019CX, if necessary, modifies tine prepares to cause restart of the channel programs for unit record output channel by copying the channel program devices when ASA control characters are not start address from the current ICB into used. The module then attempts to join the the lOB, and uses the EXCP macro­ current channel program to the preceding instruction to cause scheduling of the one. The OPEN executor selects and loads channel program. It then returns this module if the DCB specifies: control to the calling routine.

- Chained channel-program scheduling • If the present ICB is posted complete, - Printer or card punch the present channel program was joined - No control character, machine control successfully. (The routine was inter­ character. rupted long enough, between the joining and the testing, for the channel pro­ The module operates as follows: gram to be executed and for the channel end appendage to post the ICB.) The • It receives control from a PUT routine routine returns control to the calling when that routine finds that a buffer routine. is ready for scheduling, or from a WRITE routine at the conclusion of its processing. End-of-Block Module IGG019CY • It adjusts the length entry and the start address entry in the channel program for either a control character Module IGG019CY modifies channel pro­ or a variacle-length block length field grams for unit record output devices when or for both, if both are present. ASA control characters are used. The module then attempts to join the current • It inserts the control character, if channel program to the preceding one. The present, as the command byte of the OPEN executor selects and loads this module Write channel command word (CCW). if the DCB specifies:

• It attempts to join the channel program - Chained channel-program scheduling for the current buffer to the preceding - Printer or card punch channel program (that is, chain ASA control character. schedule) by: The module operates as follows: setting the ~CB to not-complete. • It receives control from a PUT routine Inserting the· .address of the cur­ when that routine finds that a buffer rent channel program into the NOP is to be scheduled, or from a WRITE CCW of the preceding channel pro­ routine at the conclusion of its proc- gram. essing.

40 • It adjusts the length entry and the TRACK OVERFLOW END-OF-BLOCK ROUTINE start address entry 1n the channel program for either the control charac­ The track overflow end-of-block routine ter or a variable-length block length processes channel programs for output data field or for both, if both are present. sets whose blocks may overflow from one track onto another. (See Figure 1.> Such • It translates the control character and a block is written by a channel program inserts it as the command byte of the consisting of a channel program segment for Control CCW (which precedes the Write each track to be occupied by a segment of CCW> • the block. The track overflow end-of-block routine computes the address of each track • It attempts to join the current channel written oni to progress from track to track program to the preceding one (that is, (to continue writing successive segments of chain schedule) by: one block) the channel program uses the Search command with the multiple-track setting the ICB to not-complete. (M/T) mode. a - Block Length is Less Than Track Balance Inserting the address of the cur­ (No Overflowing Segment) rent channel program into the NOP Data CCW of the preceding channel pro- gram. . b - Block length is Greater Than Track Balance Changing the NOP CCW in the preced­ (First Segment Overflows Track) ing channel program to a TIC CCW. Doto

Updating the SAM lOB prefix block Data (Continued) to point to the end of the current channel program. c - Block Length is Greater Thon Track Copacity (Severed Overflowing Segments) • It determines whether the joining was successful by testing the ECB pointed to by the lOB for a completion posting by the I/O supervisor. Data (Continued)

Data (Continued) • If the I/O supervisor did not post the event as completed, the )01n1ng was Data (Continued) successful and the routine returns con­ trol to the calling routine. IDoto (Continued) I

Figure 1. Track Overflow Records • If the I/O supervisor did post the event as completed, the routine tests There is ene track overflow end-of-block the ICB for the present channel program routine (module IGG019C2)i it is used with to find whether the joining was suc­ output data sets. If the access conditions cessful or not. shown in Table 10 are specified for a DCB, the OPEN executor selects this routine, loads it, and places its address into the • If the present ICB remains unposted, DCBEOB field or DCBEOBW. (For an input the present channel program was not data set with track overflow, end-of-block joined to the preceding one. The rou­ module IGG019CC is used.> tine prepares to cause restart of the channel by copying the channel program Table 10. Module Selector - Track Overflow start address from the current ICB into End-of-Block Module the lOB, and uses the EXCP macro­ r------T------, instruction to cause scheduling of the I I I channel program. It then returns I Access Conditions I Selections I control to the calling routine. I I I ~------t------~ I Output, Inout, Out in I X I • If the present ICB is posted complete, ~------~------t------~ the present channel program was joined I Track Overflow I X I successfully. (The routine was inter­ .------t------i rupted long enough, between the joining I I I and the testing, for the channel pro­ I End-of-Block Module I I gram to be exec'uted and for the channel I I I end appendage to post the ICB.) The ~·------t------~ routine returns control to the calling IL ______IGG019C2 ~I ______X JI routine.

Queued Sequential Access Method Routines 41 End-of-Block Module IGG019C2 • If the next track is not in this extent, the module passes . control to the track balance routine via anSVC 25 instruction. (That routine will erase all tracks in the current extent that Module IGG019C2 performs device-oriented were found insufficient for the block processing when track overflow is permitted to be written.) On return of control with an output data set. The OPEN executor from the track balance ~outine, the selects and loads this module If the OPEN module tests if there is another parameter list specifies: extent. • If there is another allocated extent on - Output, Inout, or outin this volume, the module reconstructs the channel program by proceeding when at least one byte fits on a track. and the DCB specifies: • If there is no other allocated extent - Track overflow. on this volume, an end-of-volume condi­ tion exists. The module sets the The module operates as follows: DCBCINDl field in theDCB and the CSW field in the lOB to show this, and • It receives control from a PUT routine returns control to the PUT or WRITE when that routine finds that a buffer routine without issuing an EXCP macro­ is to be scheduled, or from a WRITE instruction. The EOV condition is routine at the conclusion of its proc- eventually recognized and processed, in essing,. QSAM by the synchronizing routine, in BSAM by the CHECK routine. • It compares the block length with the space remaining on the track last writ­ ten on. SYNCHRONIZING AND ERROR PROCESSING ROUTINES

• If the entire block fits on this track, A synchronizing and error processing the module completes a channel program routine synchronizes execution of the proc­ (consisting of one channel program essing program with execution of the chan­ segment) for writing the block, upqates nel programs, and performs error processing the track balance, and passes control to permit continued access to the data set to the I/O supervisor. after an error was encountered during the execution of a channel program. • If at least a one-byte data-field fits There are five synchronizing and error on this track, the module completes a processing routines. FOUr of the five channel program segment for the segment routines: of the block that fits on the track (by entering the Seek address, main storage - Are unique to QSAM address, and count field for the chan­ nel program segment) and tests if there - Both synchronize and process errOrS is another track in the same extent. - Receive control from a GET or a PUT routine • If the next track is in this extent, it compares the remaining block length - Are pointed to by an address in the with the track capacity. DCB.

The fifth routine, the track overflow • If the remainder of the block exceeds asynchronous error processing routine: the track capacity,. the module proceeds as when at least one byte fits on the - Is shared between QSAM and BSAM track. - Only processes errors • If the remainder of the block is less - Receives control by being Scheduled by than the track capacity. the module the track overflow abnormal end appen­ completes the final channel program dage segment for the final segment of the block, updates the track balance. and - Is pOinted to by an address in an passes control to the I/O sup~rvisor. interruption request block (IRB).

42 To synchronize, the QSAM Input and out­ ing routine (module IGG019Cl) distinguishes put Synchronizing and Error Processing rou­ t1lll0 ·kinds of errors - those in the block tines (modules IGG019AQ and IGG019AR) being read. and those in the block being return control to the GET or PUT routine skipped over to read the next one. For immediately if the channel program executed errors in the block being read, the routine without error; or use the WAIT macro­ sets the channel program to permit the instruction if the channel program has not processing program to continue reading the yet executed. To process errors, these segments and blOCkS beyond the one in routines pass control to the SYNAD/EOV error; for errors in the block being executor (using SVC 55) to distinguish skipped, the routine resets the channel between the processing necessary for unit program and uses the EXCP macro­ check - that is. a permanent error and instruction, so that the processing program unit exception - that is, an end-of-volume is unaware of the error. condition.

For an error whose character and For a unit check the executor returns occurrence the processing program must know control to the synchronizing routine, which about (errors in l;legments of the block in turn passes control to the SYNAn being read into the buffer), the track routine. On return of control from the overflow routine addresses the loa to the SYNAD routine, the synchronizing routine next track and its channel program and again passes control to the executor to causes control to return to the processing implement the error options. For the program via the TCB queue. For errors ACCEPT and SKIP options, control returns Whose correction does not affect the proc­ once more to the synchronizing routine. It essing program (errors in segments of the now operates as when it is first entered. block being skipped over>, tbe module uses the EXCP macro-instruction to skip arQund the defective segment to present the proc­ For a unit exception the executor causes essing program with the block it expects to end-of-volume processing by the end-of­ obtain. This latter condition only holds volume routine of I/O support. That if an error occurs on a Read-Data CCW with routine passes control to the EOV/new vol­ the Skip bit on for a segment that is not ume executor. The executor returns control the last or only segment on an alternate to the synchronizing routine. It now oper­ track. In that case control returns to the ates as when it is first entered. processing program when the desired block is in the buffer ip its entirety. For errorS that ,do not permit reading the To synchronize the Paper 'l'apeCharacter entire block in one pass witho~t error, Conve.rsion Synchronizing routine (contained control returns to the processing program in the paper tape GET module IGGQ19AT) with the IO~ set to a track and channel returns control to the GET routine immedi­ program that permits reading the segments ately if the channel program executed with­ following the defectiVe one. The defective out error; or uses the WAIT macro­ segment and the preceding good segments Of instruction if the channel program has not the block are in the buffer at the time yet executed. To proceSs errors, the control is returned to the processing pro­ routine passes control to the SYNAn rou­ gram. tine. When control returns from the SYNAn routine to the synchronizing routine. the latter implements the error option. (The Four of the five routines described here equivalent of an end-of-volume condition is (those enumerated in Table 11) are uni'!ue handled by the paper tape GET routine.) to QSAM. One of these routines ga1ns control when a GET or a PUT routine finds To synchronize, the Update Synchronizing that it needs a new buffer. Table 11 lists and Error Processing routine (module the routines available and the conditions IGG019AP), returns control to the GET rou­ that cause a particular routine to be used. tine immediately if the channel program The QPEN executor selects one of the rou­ executed without error; or uses the WAIT tine.s, loads it, and puts its address into macro-instruction if the channel program the DCEGERR/PERR field~ has not yet executed. To process an end­ of-volume condition, the routine suspends The fifth routine (identified in Table volume-switching until processing on the 12) is shared between QSAM and ESAM. It old volume is finished. To process gains control be being scheduled for even~ permanent errors, the routine ·interprets tual execution by track overflow flow the error option to assure that·neither a abnormal end appendage IGG01ge3. The OPEN buffer nor a black is skipped. executor loads it and enters its address in an IRE: the address of the IRE is in the The. error p~ocessing performed by the DEE.

Queued Sequential Access Method Routines 43 Table 11. Module Selector - Synchronizing SYNCHRONIZING }o]ODULE IGG019AF (UPDATE) and Error Processing Modules r------T------, I I I Module IGG019AF finds the next buffer I Access Conditions ISelections I and assures that it has been refilled. If I I I a unit status prevented refilling the buf­ ~------+--T--T--T--i fer. the module processes the pending chan­ IGET IX IX I IX I nel programs according to whether they are ~------+--+--+--+--i Empty-and-Refill or Refill-only channel I PUT , I I IX I I programs. The OPEN executor selects and ~------+--+--+--+--i loads this module if the OPEN parameter IInput. Readback I IX I I I list specifies: ~------+--+--+--+--i ,output I I IX I I - Update ~------+--+--+--+--i I Update IX I I I I and the DCB specifies: ~------+--+--+--+--i IPaper tape I I I IX I - GET. Icharacter conversion I I I I I ~------...,--,------+--+--+--+--i The module operates as follows if no I I I I I I error occurred: I Modules I I I , I I I , I I I • It receives control when the Update GET ~------+--+--+--+--i routine finds that a new buffer 1S I IGG019AF IX I I I I needed. It also receives control after ~------+--+--+--+--i the FEOV macro-instruction is encoun­ I IGG019AQ I IX I I , tered in a processing program, once ~------~------+--+--+--+--i from the Update GET routine (when the I IGG019AR I I IX I I FEOV executor schedules the last ~------+--+--+--+--i buffer) and once directly from the FEOV , IGG019AT1 I I I IX I executor (when it awaits execution of ~------~------~--~--~--~--~ the scheduled buffers.) 11This module includes both the paper tapel I synchronizing and error processing rou-I • If the next buffer has been refilled, I tine and the paper tape GET routine. I the module returns control to the I Both routines are described in the GET I Update GET routine. LI ______routines section of this publication. J I • If the channel program for the' next huffer has not yet executed. the module awaits its execution. The module operates as follows if an end-of-volume condition was encountered: • It receives control when the Update GET routine finds that a neW buffer is Table 12. Module Selector - Track Overflow needed or when the FEOV executor awaits Asynchronous Error processing execution of the scheduled buffers. Module ' r------T------, • If the channel program for the next I I· I buffer encountered an end-of-volume I Access Conditions I Selections I condition, or if control has come to I I I this ,module due to an FEOV macro­ ~------+-----T------~ instruction, the module finds the lOBs I GET I X I I flagged for output. It then resets the ~------7'""'----+-----+------i command-chain flag at the end of the I READ I I X I Empty portion of the channe! program to ~------+-----+------i off, and schedules the Empty channel I Input, Inout. Outin I X I X I programs for execution via an EXCP ~------~------+-----+------i macro-instruction. ITrack Overflow I X I X, I ~------+-----+------i • If all Empty channel programs have been I I I I executed, or if none are pending, the I Module I I I module passes control to the SYNAD/EOV I . I I I executor via an avc 55 instruction. If ~------+-----+------i this module has control due to an FEOV LI ______IGG019C1 ~I _____X 4I ______X J I macro-instruction, control returns to the routine that passed control.

44 • If a permanent error is encountered If the error occurred in the Refill during execution of Empty channel portion of a channel program, the programs for an end-of-volume condition module issues an EXCP macro­ or for an FEOV macro-instruction, con­ instruction for all lOBs. trol passes to the SYNAD routine, if one is present. The SYNAD routine The module assures refilling of the returns control to this module. buffer associated with the first lOB and then returns control to the • The module then processes the error Update GET routine. option as follows: • Termina.te Option: • Accept or Skip Option: If the error occurred in the Empty The pending Empty channel programs portion of a channel program, the are rescheduled for execution via module passes control to the ABEND EXCP macro-instructions. routine.

• Terminate Option: If the error occurred in the Refill portion of a channel program, the Control passes to the ABEND, rou­ module finds the end of the Empty tine. portion of any pending Empty-and­ Refill channel programs, resets the The module operates as follows if a command-chain flag to off, and permanent error was encountered: issues an EXCP macro~instruction for these Empty channel programs. • It receives control when the update GET On execution of all the channel routine finds that a new buffer is programs, the module passes control needed. to the ABEND routine. • If the channel program for the next buffer encountered a permanent error and a SYNAD routine is present, the module passes control to the SYNAD SYNCHRONIZING MODULE IGG019AQ (INPUT) routine. • If control returns from the SYNAD rou­ Module IGG019AQ finds the next input tine, or if there is no SYNAD routine, buffer, determines its status, and passes a the module processes the error option full buffer to the GET routine. The OPEN in the following manner: executor selects and loads this module if the OPEN parameter list specifies: • Accept Option: - Input, Readback If the error occurred in the Empty portion of a channel program, the and the DCB specifies: module resets the lOB to point to the Refill portion of the channel - GET. program and issues an EXCP macro­ instruction for it and all The module operates as f'ollows: following lOBs.

If the error occurred in the Refill • It receives control when a GET routine portion of a channel program, the determines that a new buffer is needed. module posts the current lOB as complete without .error and issues an EXCP macro-instruction for all • It finds the next lOB and tests the the lOBs except the present one. status of the channel program associat­ ed with that lOB. The module assures refilling of the buffer associated with the first lOB and then returns control to the • If the channel program is not yet Update GET routine.• executed, the module issues a WAIT macro-instruction. • Skip Option: If the error occurred in the Empty • If the channel program has been execut­ portion of a channel program, the ed normally, the module updates the module operates as it does for the DCBIOBA field to point to this lOB and Accept option. returns control to the GET routine.

Queued sequential Access Method Routines 45 • If an error occurred during the execu­ TRACK OVERFLOW ASYNCHRONOUS tion of the channel program, the module ERROR PROCESSING MODULE IGG019C1 issues an SVC 55 instruction to pass .control to the SYNAD/EOV executor (IGc0005E). (For an EOV condition, ModUle IGG019C1 (used in both QSAM and control eventually passes to the end­ BSAM) processes error conditions that are of-volume routine or I/O support and encountered in the execution of a channel returns after the next volume has been program for an input data set with track found and the purged channel programs overflow. Its processing of error condi­ have been rescheduled. For a tions is asynchronous to the execution of description of the flow of control from the channel program, the I/O supervisor, Or the SYNAD/EOV executor for a permanent the processing program. It receives con­ error condition, refer to the section: trol by being scheduled for execution by Sequential Access Method Executors, in the track overflow abnormal end appendage this publication.) IGG019C3. It passes control to the proc­ eSSing program through the supervisor. The module determines the Seek address for reading the segments and blocks beyond the segment in error and inserts it in the IOBSEEK field. If the error occurred in a SYNCHRONIZING MODULE IGG019AR (OUTPUT) segment of the block being read into the buffer, the segment following the segment in error is read, if the processing program Module IGG019AR finds the next output chooses the ACCEPT option in the SYNAD buffer, determines its status, and passes routine. If the error occurred in a seg­ an empty buffer to the. PUT routine. The ment in the block preceding the block to be OPEN executor selects and loads this module read into the buffer (that is, the error if the OPEN parameter list specifies: occurred in the block being skipped over to find the block to be read into the buffer), - Output the wanted block is in the buffer when the processing program obtains the buffer. and the DCB specifies: The OPEN executor selects and loads this - PUT. module (and places its address into an IRB pointed to in the DEB) if the OPEN paramet­ The module operates as follows: er list specifies: • It receives control when a PUT routine - Input, Inout, or Outin determines that a new buffer is needed. and the DCB specifies: • It finds the next lOB and tests the status of the channel program associat­ - Track Overflow ed with that lOB. - Gl!:T or READ.

• If the channel program is not yet The module operates as follows if the executed, the module issues a WAIT error occurred in a ccw other than a macro-instruction. Read-Data CCW:

• If the channel program has been execut­ • It receives control from the supervi­ ed normally, the module updates the sor. DCBIOBA field to pOint to this lOB and returns control to the PUT routine. • It increases the track address in the lOB by 1., posts the ECB with the error • If an error occurred during the execu­ code, and causes control to return to tionof the channel program, the module the processing program. issues an SVC 55 instruction to pass control to the SYNAD/EOV executor The module operates as follows if the (IGC0005E). (For an EOV condition, error occurred in a .Read-Data CCW (without control eventually passes to the end­ a Skip bit on): of-volume routine of I/O support and returns after a new volume or more • It receives control from the supervi­ space has been found and the purged sor. channel programs have been rescheduled. For a description of the flow of • If the segment in error is the last or control from the SYNAD/EOV executor for only segment of the block, the module a permanent error condition, refer to posts the ECB with the. error code and the section:' Sequential. Access Method causes contralto .return to the proc­ Executors, in this publication.) essing program.

46 • If the segment in errer is net the last APPENDAGES segment and it is net en an alternate track, the medule sets the lOB to' address the track fellewing the track Appendages are access methed reutines in erJ;er, pests the ECB with the errer that receive centrel from and return cen­ cede, and causes centrel to' return to' trol to the I/O superviser and that eperate the precessing program. in the superviser state. (The same appen­ dages used in QSAM and in BSAM.) An • If the segment in errer is net the last appendage that receives centrel frem the segment and it is en an alternate I/O interruptien superviser, tests and may track, the medule increases the track alter the channel status .werd (CSW). The address in the lOB by 1" pests the ECB I/O interruptien superviser uses the csw to' with the errer cede, and causes centrel post the event .centrol bleck (ECB). An to' return to' the precessing pregram. appendage that receives centrel from the EXCP supervisor, before the latter causes executien ef the c.hannel pregram by using The medule eperates as fellews if the the SIO instructien, may update or alter errer eccurred in a Read-Data CCW with the channel commands just before channel pro­ Skip bit en: gram executien. The relationship ef the I/O supervisor and the appendages are • It receives centrel frem the supervi­ illustrated in Figure 8. sere • If the segment in errer is the final er enly segment ef a bleck and it is net en an alternate track, the medule sets PCI the lOB to' address the track in errer, Exit changes the Read-Data cemmand to' a NOP cemmand and issues an EXCP macre­ Channel instructien fer the changed channel End pregram. Exit • If the segment in errer is the final er enly segment ef a bleck and it is en an a~ternate track, the medule sets the IO~ to' address the track fellewing the Abnormal End ene eriginally addressed, pests the ECB Exit with the errer cede, and causes centrel to' return to' the precessing pregram. (In .the case ef an errer in a final or I--___PO_ST-t' - --~ B enly segment en an alternate track, the I'" remaining segment er blecks en that I I track will net be read.) I ~ • If the segment in errer is net the .last I "-::::::::::::::::=:::=='--I ene and it is not on an alternate I track, the medule sets the lOB to' address the track fellowing the one in LS\ ~,:I f -- '-S_IO___ --' 'errer and issues an EXCP macro­ instruction fer the readdressed channel Legend: pregram. -- Confrol ---- Referenee" • If the segment in errer is net the last QJ Described In This PublicatIon ene and it is en an alternate track, the medule successively increases the Figure 8. Relationship of I/O Supervisor track address in the lOB by 1 and and Appendages issues an EXCP macro-instructiO'n fer the readdressed channel prO'gram. The 1/0 supervisor permits an appendage to gain control at certain exit points. At • When centrel .returns from the I/O that time the I/O supervisor refers .to' the superviser, this. module awaits execu­ entry associated .with that exit in the tien ef the channel program via a WAIT appendage vector table (whose a.ddressis in macro-instruction.' On channel program the data enent bleck- DEBh If.an €Dtry exectltion, the module resteres the contains the address of an appendagE'!:;cen­ purged lOBs (and the Read~Skip command, trol passes toLt; else control·, relliains if it was changed to'. a NOP command) and with the I/O superviser. The five. I/O causeS control to' return to' the proc- superviser exits" at whi.ch appendages eSSing pregram. . receive control, are:

Queued sequential Access Method Routines 47 - End-of-Extent Appendage IGG019AW (End-of-Extent - Update - SIO - QSAM) - Channel End - PCI - Abnormal End. Appendage IGG019AW readdresses the Refill porticns of all QSAM Update channel Appendages differ from other sequential programs to a new extent. The OPEN execu­ access method routines that are loaded by tor selects and loads this module for use the OPEN executor into processing program as the end-of-extent appendage if the OPEN main storage in that they operate in the parameter list specifies: supervisor state and in that they operate asynchrcnously with the processing program, - Update that is, the events that cause them to gain control depend, not on the progress of the and the DCB specifies: processing program, but on the progress of the channel program. There are twelve - GET. appendages. No, one, or several appendages may be used with one DCB. Table 13 lists The appendage operates as follows: the appendages, the conditions that cause the different appendages to be used, and • It receives control from the EXCP the I/O supervisor exits that pass control supervisor under one of the following to them. The OPEN executor selects and conditions: loads all the necessary appendages to be used with that DCB, and places their A Refill portion of QSAM Update addresses into the various fields of the channel program attempts to read appendage vector table. For example, if the first block beyond the present the update mode of OPEN is specified, extent. appendage IGG019CG, associated with the SIO appendage exit, is selected and loaded by The remaining channel programs the Open executor. attempt to refill their buffers from the new extent.

END-OF-EXTENT APPENDAGES • If there is no other extent, the appen­ dage sets error indications in the lOB and the DCB (to show an end-of-volume End-of-extent appendages gain cpu con­ condition) and returns control to the trol if the EXCP supervisor finds an end­ EXCP supervisor. The EXCP supervisor of-extent condition. This condition exists then issues a PURGE macro-instruction if the direct-access device storage address for that channel program. (The Update associated with a channel program is synchronizing routine assures writing outside of the extent currently pointed to out of the Empty portions of pending in the data extent block (DEB). channel programs.)

Four end-of-extent appendages are pro­ • If the interruption occurred in a Read­ vided for use with sequential access method Count CCW and there is a new extent, routines: the appendage builds a Seek address for the new extent using the starting • IGG019AW processes an end-of-extent address from the DEB. It then copies condition for QSAM Update mode channel this new seek address into the lOB and programs. UCB (), and updates the M value in the Refill portion of • IGG019BM processes an end-of-extent each channel program. condition for BSAM Update mode channel programs. • If the interruption occurred in a Seek CCW, the appendage copies the Seek • IGG019CH processes an end-of-extent address from the Refill portion of the condition when neither the Update mode present channel program into the lOB nor chained channel:"program scheduling and UtB. is specified. • It resets the lOB and UCB to address • IGG019CZ processes end-of-extent condi­ the next track and its channel progranl tions when chained channel-program and returns control to'the I/O supervi­ scheduling is used. sor.

48 Table 13. Module Selector - Appendages

Access Conditions Selections

I nput I I nout I Outi n X X X

Readback X

Update X X X

Sysin X

GET X

READ X

Record format is fixed-length X

Record format is fixed-length blocked X

Record format is variable-length X

Record format is not fixed-length standard X

Direct-access storage X X

Printer X

Paper tape X

Chained scheduling X X

Track overflow X

Appendages

IGG019AW AW

IGG019BM BM

IGG019CG CG

IGG019CH CH

IGG019CI CI

IGG019CJ CJ

IGG019CK CK

IGG019CL CL

IGG019CS CS

IGG019CU CU

IGG019CZ CZ

IGG019C3 C3

Exits

End-of-Extent AW BM CH CZ

SIO CG CL

Channel End CI CJ CK CS CU

PCI CU

Abnorma I End CU C3

Queued Sequential Access Method Routines 49 Appendage IGG019BM (End-of-Extent - Update The appendage operates as follows: - BSAM)

• It receives control when a channel .Appendage IGG019BM readdresses channel program attempts to read a block beyond programs to a new extent for a DCB opened the present extent. for Update and using BSAM. The OPEN execu­ tor selects and loads this appendage for use as the end-of-extent appendage if the • The appendage examines the DEB for OPEN parameter list specifies: another extent.

- Update • If there is another extent, the appendage enters the new full device and the DCB specifies: address in the DCB, the unit control block (UCB), and the lOBs, and returns - READ. control to the EXCP supervisor. The EXCP supervisor restarts the channel program. The appendage operates as follows:

• It receives control from the EXCP • If there is no other extent, the appen­ supervisor when a channel program to dage sets error indications in the lOB refill a buffer attempts to read the and thE DCB (to show an end-of-volume first block beyond the present extent. condition) and returns control to the EXCP supervisor. The EXCP supervisor • If there is no other extent (for a then issues a PURGE macro-instruction Refill channel program), the appendage for that channel program. sets error indications in the lOB and the DCB (to show an end-of-volume condition) and returns control to the EXCP supervisor. Appendage IGG019CZ (End-of-Extent - Chained • If there is a new extent (for a Refill Channel-Program scheduling) channel program), the appendage adds 1 to the value of M in the DCBFDAD field and in the Seek address of each Refill Appendage IGG019CZ readdresses the chain channel program for the DCB. It places of channel programs to a new extent when the new Seek address into the current the EXCP supervisor finds an end-of-extent lOB and into the UCB, and returns condition. The OPEN executor selects and control to the EXCP supervisor. The loads this appendage for use as the end-of­ supervisor restarts the channel pro­ extent appendage if the DCB specifies: gram. - Chained channel-program scheduling - Direct-access storage device.

The appendage operates as follows: Appendage IGG019CH (End-Of-Extent - Ordinary) • It receives control when an end-of­ track condition interrupts the chained scheduling and the I/O supervisor finds Appendage IGG019CH finds a new extent that the next track is not in the when the EXCP supervisor finds an end-of~ current extent. extent extent condition. The OPEN executor selects and loads this appendage for use as • If there is another extent, the the end-of-extent appendage if the OPEN appendage enters the new Seek address parameter list specifies: in the PCB, lOB, and unit control block CUCB), updates t.he Seek addresses of - Input, Inout, or outin the remaining ICBs, and returns control to the I/O supervisor to reschedule the and the DCB specifies: channel program for execution.

- Direct-access storage device • If there is no other extent, the appen­ - Record format other than fixed-length dage sets a volume-full indication in standard the DCB, lOB, and ICB and returns - NOrmal channel-program scheduling. control to the I/O supervisor to skip further scheduling for this DCB.

50 START I/O (SIO) APPENDAGES Appendage IGG019CL (SIO - PRTOV)

Start I/O (SIO) appendages, if present, Appendage IGG019CL causes a skip to the gain CPU control when the start I/O subrou­ top of a new page with the first channel tine of the EXCP supervisor reaches the program following a printer overflow condi­ start I/O appendage exit. These appendages tion. The OPEN executor selects and loads set channel program entries whose value this appendage for use as the SIO appendage depends on events associated with the exe­ if the DCB specifies: cution of the preceding channel program. There are two SIO appendages: - Printer. The appendage operates as follows: • IGG019CG. This appendage makes the Seek address accessible to the I/O • The appendage tests the lOB to deter­ supervisor for QSAM and BSAM Update mine whether a PRTOV macro-instruction channel programs that refill buffers. was issued with this PUT or WRITE (This is necessary because the Seek macro-instruction. address for such a channel program is read in by the preceding channel,pro­ • If a PRTOV macro-instruction was not gram into a location unknown to the I/O issued, the appendage returns control supervisor. ) to the EXCP supervisor immediately.

• If the PRTOV macro-instruction was • IGG019CL. This appendage causes the issued, the appendage resets the PRTOV next line to print at the top of a new bit in the lOB and tests the DCBIFLGS page if a printer overflow condition field to determine whether a printer was encountered in the execution of the overflow condition has occurred. last channel program. • If printer overflow has not occurred, the appendage returns control to the EXCP supervisor.

Appendage IGG019CG (SIO - update) • If printer overflow has occurred, the appendage resets the DCBIFLGS field, inserts the "skip to 1" command byte Appendage IGG019CG resets the lOB to the into the channel program, updates the Seek address and channel program for lOB channel program start address field refilling for a Refill-only Update channel and the channel address word (location program. The OPEN executor selects and 72), and returns control to the EXCP loads this appendage for use as the SIO supervisor. appendage if the OPEN parameter list speci­ fies: - update. CHANNEL END APPENDAGES The appendage operates as follows: Channel end appendages, if present, gain • It receives control whenever the EXCP CPU control when the I/O interruption supervisor reaches the SIO appendage supervisor reaches the channel end appen­ exit. dage exit. FOr a SYSIN data set, the SYSIN appendage recognizes the delimiter charac­ ters. For other data sets, other appenda­ • It tests the lOB to determine whether ges distinguish between valid and invalid the buffer is to be emptied and block lengths by computation. The five refilled or to be refilled only. channel end appendages are:

• IGG019CI. This appendage distinguishes • If the buffer is to be emptied and between wrong-length and truncated refilled, the module returns control to blocks when fixed-length blocked the EXCP supervisor. records are being read using normal channel program scheduling.

• If the buffer is to be refilled only, • IGG019CJ. This appendage distinguishes the module resets the lOB to the Refill between wrong-length and variable­ portion of the channel program and its length blocks when variable-length Seek address and returns control to the records are being read using normal EXCP supervisor. channel program scheduling.

Queued sequential Access Method Routines 51 • IGG019CK. This appendage recognizes • If the fixed-length blocked standard SYSIN delimiter characters. record format is specified and the block is a truncated block, the appen­ • IGG019CS. This appendage distinguishes dage determines that this is the last between valid and invalid wrong-length block of the data set. The appendage indications when paper tape is being sets bits in the DCB and the ECB to read. show that an end-of-volume (EOV) condi­ tion exists, and returns control to the • IGG019CU. This appendage (which also I/O interruption supervisor. appears at the PCI and abnormal end exits), parts executed channel programs • If the block length is not an integral that were scheduled by chaining, and multiple, the appendage returns control posts the completions.. For channel end to the I/O interruption supervisor channel status, this appendage dis­ immediately. The I/O interruption tinguishes between wrong-length and supervisor then sets the ECB to show truncated blocks when fixed-length that the channel program was executed blocked records are being read using with an error condition. chained channel-program scheduling. (Refer to the section for PCI appendages for a discussion of parting of chained channel-programs and a description of appendage IGG019CU.l Appendage IGG019CJ (Channel End - Variable-Length Record Format)

Appendage IGG019CI (Channel End - Fixed-Length Blocked Record Format) Appendage IGG019CJ distinguishes between valid wrong~length blocks and variable­ length blocks. The OPEN executor selects Appendage IGG019CI distinguishes between and loads this .appendage if the OPEN valid wrong-length blocks and truncated parameter list specifies: blocks. The OPEN executor selects and loads this appendage if the OPEN parameter - Input, Inout, Outin list specifies: and the DCB specifies: - Input, Readback, Inout, or Outin - Variable-length records. and the DCB specifies: (Under these conditions the SLI flag is off - Fixed-length blocked records. in the Read channel command word.)

(Under these conditions the SLI flag is off in the Read channel command word.) The appendage operates as follows:

The appendage operates as follows: • It receives control when the I/O inter­ ruption supervisor arrives at the chan­ • It receives control when the I/O inter­ nel end exit. ruption supervisor arrives at the chan­ nel end exit. • If the appendage finds a unit exception bit on in the channel status word, it • If the appendage finds either the unit returns control to the I/O interruption exception bit on in the channel status supervisor immediately. word, or the wrong-length indication off., it returns control to the I/O • The appendage calculates the length of interruption supervisor immediately. the block and compares it to that in the block length field. • The appendage calculates the length of the block and compares this length to • If the lengths are equal, the appendage that in the DCBLRECL field. turns off error indications in the ECB and DCB and returns control to I/O • If the fixed-length blocked record for­ interruption supervisor. mat is specified and the block length is an integral multiple of the DCBLRECL • If the lengths are not equal, control field value (showing it to be a trun­ is returned to the I/O interruption cated block), the appendage turns off supervisor immediately. The I/O inter­ error indications in the ECB and the ruption supervisor then sets the ECB to DCB and returns control to the I/O show that the channel program executed interruption supervisor. with an error condition.

52 Appendage IGG019CK (Channel End - SYSIN) PROGRAM CONTROLLED INTERRUPTION (PCI) APPENDAGE (EXECUTION OF CHANNEL PROGRAMS SCHEDULED BY CHAINING) Appendage IGG019CK translates the delim­ iter character for a SYSIN data set into an end-of-data-set indication for the access There is one program controlled inter­ method routine. The OPEN executor selects ruption (PCI) appendage. If chained and loads this appendage if the device channel-program scheduling is used, its assigned to this DCB is SYSIN. address is placed into the appendage vector table for all three I/O interruption super­ visor exits: PCI, channel end, abnormal The appendage operates as follows: end. • It receives control when the I/O inter­ ruption supervisor arrives at the chan­ A program controlled interruption (PCI), nel end exit. in the sequential access methods, signals the normal execution of a channel program that was scheduled by chaining. The inter­ • The appendage tests the buffer for the ruption occurs when control of the channel SYSIN delimiter characters /*. has passed to the next channel program. If the only channel status is PCI the I/O supervisor performs no processing; if other • If the characters read are not delimi­ channel conditions are also present, the ter characters, the appendage returns I/O supervisor processes these in normal control to the I/O supervisor. fashicn after it regains CPU control from the PCI appendage.

• If the characters read are deliwiter characters, the appendage turns on the This appendage performs the following unit exception bit in the channel sta­ three functions: tus word and the error flag in the DCB, indicating an end-of-data set condi­ tion, and returns control to the I/O • It performs the channel status analysiS supervisor. usually done by the I/O interruption supervisor. The interruption is caused by a condition in the logic of the channel program rather than a condition in the channel or the device. The Appendage IGG019CS (Channel End - Paper condition is meaningful only to the Tape) processing program (in this case, the access method routines, or, more speci­ fically, the appendage) and has no Appendage IGG019CS distinguishes between meaning to the I/O supervisor. valid wrong-length blocks and the wrong­ length indication characteristic when paper • It repeats this process for preceding tape is being read. The OPEN executor channel programs whose PCls were lost. selects and loads this appendage if the DCB PCls are not stacked. If a channel specifies: remains masked from the time of one PCI until after another PCI, only one PCI - Fixed-length record format occurs. - Paper Tape. • It performs processing normally neces­ The appendage operates as follows: sary for other interruptions (for exam­ ple, channel end). Interruptions other • It receives control when the I/O than PCls may terminate execution of interruption supervisor arrives at the chained channel programs. channel end exit. Accordingly, a PCI appendage not only • If the channel status word (CSW) resi­ does the processing implicit for the logi­ dual count is zero" the appendage turns cal condition that the interruption signals off error indications in the lOB and (namely, that the preceding channel program the DCB and then returns control to the executed normally), but also extends this I/O supervisor. processing back to any preceding channel programs whose PCI may have been masked • If the channel status word (CSW) resi­ and, finally, takes CPU control at other dual count is not zero, the appendage I/O interruption supervisor appendage exits returns control to the I/O supervisor if chained channel-program scheduling is immediately. used.

Queued Sequential Access Method Routines 53 Appendage IGG019CU(Channe1 End, PCI, It posts the ICB with the comple­ Abnormal End - Chained Channel-Program tion code and with channel end and Execution) updates the lOB SAM prefix to point to the next ICB.

Appendage IGG019CU disconnects (parts) It repeats this parting process chained channel programs that have executed until the lOB and the CSW point to and posts their completion; in addition, it the same channel program. performs normal channel end and abnormal end appendage processing. (For a descrip­ tion of the joining process of chained The appendage continues as follows if channel-program scheduling refer to the channel end occurred without an error: descriptions of the chained channel-program scheduling end-of-block routines.> The • It sets the lOB and the ICB to show the OPEN executor selects and loads this appen­ channel program completed without dage for use as the channel end, PCI, and error, and resets the lOB to point to abnormal end appendage if the DCB speci­ the next channel program and ICB. fies: • If there are more channel programs to be executed, the appendage resets the - Chained channel-program scheduling. lOB to not-complete and passes control to the EXCP supervisor tc schedule these channel programs. The appendage operates as follows: • If there are no more channel programs to be executed, the appendage returns • It receives control from the I/O inter­ control to the I/O supervisor for nor- ruption supervisor when the latter mal arrives at the PCI, channel end, and abnormal end appendage exits. The appendage continues as follows if the channel end interruption occurred with • It tests whether the CSW and the lOB a wrong length indication: field "First ICB" pOint to the same channel program. • It determines whether a truncated block has been read. • If they do" the appendage returns con­ trol to I/O supervisor, unless a chan­ • If a truncated block has been read in a nel end condition exists. data set with fixed-length blocked standard record format, it sets: • If they do not, the appendage discon­ nects (parts) the channel program the DCB to show an end-of-volume (pointed to by the ICB) from the next condition, channel program in the chain as fol­ lows: the current ICB to complete­ without-error. For input, the appendage tests the lOB for an end-of-vo1ume condition. the next ICB to complete-with- .If it exists, the appendage contin­ error, ues as for a channel end interrup­ tion with a permanent error. the CSW in the next ICB to show channel end and unit exception. For output, or for input without an associated end-of-vo1ume condition, It returns control to the I/O the appendage resets the COIr;mand in interruption supervisor. the last CCW from TIC to NOP and the address to the beginning of the • If a truncated block has been read in a next channel program. data set with fixed-length blocked record format, the appendage sets the If the device is magnetic tape, it ICB to complete-without-error and updates the DCBBLKCT field in the resets the lOB to point to the next ICB DCB. and its channel program. The appendage causes control to pass to the EXCP If a WAIT macro-instruction was supervisor to restart the channel. addressed to this channel program, the appendage causes the POST rou­ • If a hlock with wrong length data has tine to perform its processing and been read, the appEmdage continues as to return control to the appendage. for permanent errors.

54 The appendage continues as follows if ment in error. The processing necessary to channel end occurred with an error: accomplish this is performed by the track overflow asynchronous error processing rou­ • It isolates the channel program in­ tine (module IGG019Cl, described in the error by parting it from the next one. synchronizing and error processing routines section), rather than by the appendage. To • It sets the lOB to point to the permit other I/O operations to continue, channel-program in-error. the appendage suspends further processing of the condition by the I/O supervisor, • It sets the DCB to show that the schedules the asynchronous error processing channel program is being retried. routine, and returns control to the I/O supervisor. • It returns control to the I/O interrup­ tion supervisor. That routine then processes the channel program in the Error Retry procedure. Appendage IGG019C3 (Abnormal End - Track Overflow)

The appendage continues as follows if channel end occurred with a permanent Appendage IGG019C3 schedules the track error: overflow asynchronous error processing rou­ tine if a permanent error occurs in a channel program for an input data set with • It receives control after the I/O track overflow. The OPEN executor select supervisor Error Retry procedure is and loads this appendage for use as the found unsuccessful in correcting the abnorrr.al end appendage if the OPEN paramet­ error. e~ list specifies: - Input, Inout or Outin • It posts the ICB to show that the channel program as completed in-error. and the DCB specifies:

- Track overflow. • It parts the channel program in-error from the following one. The appendage operates as follows:

• It receives control from the I/O inter­ • It resets the lOB to point to the ruption supervisor when the latter channel program after the one in-error. reaches the abnormal end appendage exit. • It returns control to the I/O interrup­ • If the CSW that caused this appendage tion supervisor. to gain control addresses a Read-Data CCW (without a Skip bit) and shows a unit exception channel status, the appendage returns control to the I/O ABNORMAL END APPENDAGES interruption supervisor without further processing. (After control returns to the processing prograr<1, the synchroniz­ Abnormal end appendages receive control ing or CHECK routine processes this from the I/O interruption supervisor when channel status as an end-of-volume con­ the latter finds a unit check condition in dition. ) the channel status word (CSW). The appen­ dages for this exit are a track overflow • If the CSW that caused this appendage appendage and a chained channel-program to gain control addresses a Read-Data execution appendage shared with the channel CCW (with a Skip bit on) and shows a end and PCI exits. The shared appendage is unit exception or a unit check channel described under the PCI appendage. status, the appendage passes control to the exit effector routine together with the entry point address of I/O supervi­ A unit check status in a channel sor that causes the I/O supervisor not addressing an input data set with track to post the ECB and to retain the overflow may indicate a permanent error in request element for the channel pro­ one segment of a block. If there are gram. (The exit effector routine will further good segments, or if the segment in schedule the track overflow asynchron­ error is being skipped over to find the ous error processing routine for even­ next block, the sequential access methods tual execution and pass control to the attempt to continue access beyond the seg- given entry' point.)

Queued sequential Access Method Routines 55 QSAM CONTROL ROUTINES There are two PRTOV routines; they are macro-expansions. Whenever the assembler encounters either of the two macro­ These control routines, shared by QSAM instructions shown in Table 15, it and BSAM, consist of both modules loaded by substitutes the corresponding macro­ the OPEN executor and macro-expansions. expansion in the processing program object The selection and loading of one of the module. modules is done by the OPEN executor and depend on the access conditions; the pre­ sence of macro-expansions depends solely on Table 15. Control Routines That Are Macro- the use of the corresponding macro­ Expansions instruction in the processing program and r------T------, is independent of the presence or absence I I I of modules. I I Number of I I Macro-Instruction I Macro- I I I Expansions I If a CNTRL macro-instruction is I I I encountered in a processing program using ~------+------~ QSAM or BSAM, control passes to a control I PRTOV - User exit I 1 I routine. The PRTOV macro-expansions place ~------+------i the code to be executed in-line in the LI ______PRTOV - No user exit i I ______1 JI processing program. CNTRL routines pass control to the I/O supervisor; the macro­ expansions return control to the processing program. The CNTRL routine for the card reader causes execution of a channel program that stacks the card just read into the selected stacker. The CNTRL routine for the printer causes execution of a CONTROL MODULE IGG019CA (CNTRL - SELECT channel program with a command to space or STACKER - CARD READER) to skip. The printer overflow macro­ expansions cause the printer overflow condition to be sensed for. Module IGG019CA permits stacker selection on the card reader. The OPEN executor selects and loads this module if There are two CNTRL routines in QSAM; the DCB specifies: they are load modules. Table 14 lists the routines available and the conditions that - CNTRL cause a particular routine to be used. The OPEN executor selects one of the modules, - Card reader loads it, and puts its address into the DCBCNTRL field. - One buffer.

The module operates as follows: Table 14. Module Selector - Control • It receives control when the CNTRL Modules macro-instruction is 'encountered in a r------~------T------, processing program. I I I I Access Conditions Iselections I I I I • For QSAM, the module schedules a chan­ ~------+-----T-----~ nel program which stacks the card just I CNTRL I X I X I read, reads the next card into the ~------+-----+-----i buffer, and returns control to the I Printer I X I I processing program. (Card reader GET ~------+-----+-----i modules IGG019AG and IGG019AH depend on I Card Reader, I I X I the use of this routine to refill empty I a single buffer I I I l::uffers.) ~------+-----+-----i I I I I I Modules I I I • For BSAM, the module schedules a chan­ I I I I nel program which stacks the card just ~------+-----+~~---i read, and then returns control to the I IGG019CA . I X I I processing program. (The READ/WRITE ~------+-----+-----i module IGG019BA causes a channel pro­ IL ______IGG019CB i I _____i I _____X JI gram to be scheduled that reads the next card into the buffer.)

56 CONTROL MODULE IGG019CB (CNTRL - SPACE, PRTOV - User Exit SKIP - PRINTER) The coding operates as follows: Module IGG019CB causes printer spacing and skipping by use of macro-instructions~ • A WAIT macro-instruction is issued for the spacing or skipping to be performed are the lOB pointed to by the DCBIOBA specified as operands of the macro­ field. instruction. The OPEN executor selects and loads this module if the DCB specifies: • The DCBIFLGS field of the DCB is tested for an overflow condition.

- CNTRL • If an overflow condition exists, a BALR instruction is issued to pass control - Printer. to the user's routine. • If no overflow condition exists, con­ The module constructs a channel program trol passes to the next instruction. to control the device" issues an EXCP macro-instruction and then returns control to the processing program. PRTOV - No User Exit

The coding creates a test mask in the PRINTER OVERFLOW MACRO-EXPANSIONS DCB field located at (DCBDEVT+l) and returns control to the processing program. The PRTOV macro-expansions permit (The printer end-of-block routine tempo­ processing program response to printer rarily stores the mask in the NOP channel overflow conditions. command word (CCW) preceding the Write CCW, turns on a bit in the first byte of the lOB and resets the mask. The PRTOV appendage The following macro-expansions are tests the lOB bit, to determine whether to created as in-line coding during the expan­ respond to, or ignore, an overflow condi­ sion of the macro-instruction. tion, and resets it.)

Queued sequential Access Method Routines 57 BASIC SEQUENTIAL ACCESS METHOD·ROUTINES

Basic sequential access method (BSAM) returns to the CHECK routine, and it then routines cause storage and retrieval of passes control to the processing program's blocks of data. BSAM routines furnish SYNAD routine. (For EOV conditions, con­ device control, but do not provide block­ trol passes to the EOV routines.) ing. There are six types of BSAMroutines: Processing READ, Program CHECK • READ routines. WRITE • WRITE routines. • End-of-block routines. ---, • CHECK routines. --I I • Appendages. ""===r=r=:::=:'.l+--] I I • Control routines. I I I I Figure 9 and Table 16 show the relation­ I I ship of BSAM routines, other portions of Executor I I the operating system, and the processing program. ACCEPT A READ or a WRITE routine receives User's SYNAD control after a READ or a WRITE macro­ Routine instruction is encountered in a processing program. A READ or WRITE routine partially I completes a channel program using I parameters from the data event control I Track Overflow I block (DECB), and passes the DECB, together __ .-l with the input/output block (lOB), to an end-of-block routine. (For a description I/o Interruption and diagram of the relationship of the DECB, the lOB, the data control block I/o Supervisor (DCB) , channel prograrf, and buffer, refer I to Appendix C.) I/O Interruption -, I I-__S-,up_e_rv_is_o_r ----1L--.--ll I I I An end-of-block routine provides device EXCP I I I I Supervisor I I oriented data for the channel program. If ~----,----~ I I _...1 I normal channel-program scheduling is used, I I L I the routine passes control to the I/O LPSW I I supervisor (via an EXCP macro-instruction) I I I I DECB I to cause scheduling of the buffer. If __ J chained channel-program scheduling is used, it attempts to add the present channel i program to the last one in the chain of ~"(O§--- scheduled channel programs. If it is suc­ cessful, control returns to the processing program. If it is unsuccessful, control I passes to the I/O supervisor (via an EXCP I macro-instruction). (For a detailed des­ I Appendages ---, cription of the end-of-block routines refer I I to "Queued Sequential Access Method ROu­ I I tines" section in this publication.) I I I I L ____ A CHECK routine receives control from --.I the processing program via a CHECK macro­ SIO (b) instruction. A CHECK routine examines the Legend: DECB to determine the status of the channel (a) Previous Channel Program program. If the channel program executed (b) Next Channel Program normally, control returns to the processing -- Control program. However, if the channel program -- - Reference executed with an error, control passes from the CHECK routine to the SYNAD/EOV executor Idl Routines Described in This Publication (IGC0005E) for processing of error conditions. For permanent errors, control Figure 9. Flow of Control in BSAM

58 Table 16. Flow of Control of BSAM Routines r------T------~------r------~, I I I I IRoutine Passing Control I Condition IRoutine Receiving Control I I I I I ~------+------~------+------~ I Processing I READ or WRITE I READ or WRITE I I Program I Macro-instruction I I ~------+------+------~ I READ or WRITE I Branch instruction I End-of-block I ~------+------~------+------~~ I End-of-block I EXCP Macro-instruction I I/O supervisor I ~------+------+---.------~ I I/O supervisor I End I End-of-block I ~------+------+------.------~ I End-of-block lEnd I READ or WRITE I ~------+------;,.;------+------~ I READ or WRITE I End I Processing I I I I Program I ~------+------+------~ I Processing I CHECK Macro-instruction I CHECK I I Program I I I ~------+------~------+------~ I CHECK I Channel program not yet executed I WAIT I ~------+------+------~ I CHECK· I Channel program executed I SYNAD/EOV I I I with error I Executor I ~------~------~--+------+------~ I CHECK I Channel program executed I Processing I I I without error I Program I ~------+------+------~ I supervisor I I/O interruption 11/0 supervisor I ~------+-----~-----~------+------~ I I/O supervisor I Appendage exit condition I Appendage I ~------;,.;-~---+------+------~ I Afpendage I End I I/O supervisor I ~------+------+------;,.;------~ I I/O supervisor I End I Supervisor I L ______----____ --L _____'"- ______-'- ______.L_------_------J

The asynchronous error processing rou­ balance routine receives control from a tine (described in the "Queued Sequential WRITE routine or the track overflow end-of­ Access Methods Routines" section of this block routine. publication) gains control by being sche­ duled by an appendage. The routine proc­ Appendix A contains decision tables that esses permanent error conditions that are show for each type of routine, the encountered by a channel program for input processing characteristics that differenti­ data with track overflow record format. ate the routines within that type. The routine establishes the address of the segment beyond the one in error. An appendage receives control from the READ AND WRITE ROUTINES I/O supervisor and returns control to the I/O supervisor. Some appendages operate with the I/O interruption supervisor, and A READ or WRITE routine receives control others operate with the EXCP supervisor. when the processing program issues· a READ (Appendages are described in the "Queued or a WRITE macro-instruction. The READ and sequential Access Method Routines" section WRITE routines used with data sets organ...;. of this publication.) ized for the sequential . or partitioned access methods pass control to'the end-of­ Control routines (not shown in Figure 9) block routines, which in turn pass control permit the processing program to control to the I/O. supervisor. The WRITE routines the positioning of auxiliary storage devi­ used to create data sets organized for ces. They receive control when the CNTRL later access by basic direct"-access method (Printer, Tape, Card Reader), PRTOV, NOTE, (BDAM) routines, includetheend-of-block POINT or BSP macro-instructions are encoun­ function within themselves, and sopass tered in'a processing program. The track control to the I/O supervisor directly. A

Basic Sequential Access Method Routines 59 READ or WRITE routihe processes parameters READ/WRITE MODULE IGG019BA set by the processing program in the DECB, to permit scheduling of the next channel program. Module IGG019BA completes the channel program to be scheduled next, and relates There are six READ,. WRITE routines. control blocks used by the I/O supervisor Table 17 lists the routines available and to the channel program. The OPEN executor the conditions that cause a particular selects and loads this module if the OPEN module to be used. The OPEN executor parameter list specifies: selects one of these routines, loads it, and puts its address into the DCBREAD/WRITE - Input, Output, Inout, or Outin field. The table shows" for example, that module IGG019BH is selected and loaded if and the DCB specifies: Update and the READ macro-instruction are specified.• - READ or WRITE. Table 17. Module Selector - READ and WRITE The module operates as follows: Modules r------T------, • It receives control when a READ or I I I WRITE macro-instruction is encountered IAccess Conditions I Selections I in a processing program. I I I ~------+--T-~--T--T--T--T-_y--~ • It enters the address of the lOB into I Input or I X I I X I X I I I I I the DECB to permit the CHECK routine .------+--+--+--+--+--+--+--+--~ later to test execution of the channel 10utput or I IX I I I IX IX IX I program. ~------+--+--+--+--+--+--+--+--i IInout, Outin IX IX I I I I I I I • It completes the channel program by .------+--+--+--+--+--+--+--+--~ inserting the buffer address from the I Update I I I I IX I I I I DECB, and the length from either the .------+--+--+--+--+--+--+--+--~ DECB (for undefined-length records), I READ IX I IX IX IX I I I I the DCB (for fixed-length records, and .------+--+--+--+--+--+--+--+--i for input of variable-length records), I WRITE I I X I I I I I I I or the record itself (for output of .------+--+--+--+--+--+--+--+--~ variable length records). IWRITE (LOAD) I I I I I IX IX IX I I (Create--BDAM) I I I I I I I I I • If a block is to be written on a .-----~------+--+--+--+--+--+--+--+--~ direct-access storage device, the IPaper tape I I IX IX I I I I I module tests the DCBOFLGS field in the I character I I I I I I I I I DCB to establish the validity of the I conversion I I I I I I I I I value in the DCBTRBAL field • •------+--+--+--+--+--+--+--+--i I Fixed-length I I IX I I IX I IX I • If the DCBTRBAL value is valid, or if a I record format I I I I I I I I I block is to be written on a device .------.,.------+--+--+--+--+--+--+--+--i other than direct-access storage, or if IUndefined-length I I I IX I I IX I I a block is to be read from any device, Irecord format or I I I I I I I I I the module passes control to an end-of­ .------+--+--+--+--+--+--+--+--~ block routine. I Variable-length I I I II I IX I I I record format I I I I I I I I I • If the DCBTRBAL value is not valid .------+--+--+--+--+--+--+--+--~ (that is, the preceding operation was a ITrack Overflow I I I I I I I IX I READ, POINT, or OPEN for MOD) the .------+--~.,.-+--~-+--~-~--~--~ module issues an SVC 25 instruction to I READ, WRITE I I I I pass control to BSAM control module I Modules I I I I IGC0002E to obtain a valid track .------+--T--+--T--+--T--T--T--~ balance. When control returns to this I IGG019BA I X I X I I I I I I I module, it passes control to an end-of­ .------+--+--+--+--f--+--+--+--i block routine. I IGG019BF I I I X I X I I I I I ~------+--+--+--+--+--+--+--+--~ I IGG019BH I I I I I X I I I I .------+--+--+--+--+--+--+--+--i READ MODULE IGG019BF (PAPER TAPE CHARACTER I IGG019DA I I I I I I X I I I CONVERSION) ~------+--+--+--+--+--+--+--+--i I IGG019DB' I I I I I I I X I I ~------+--+--+--+--+--+--+--+--~ Module IGG019BF completes a channel program to read paper tape, awaits its lI ______IGG019DD ~I __ ~I __~ I __ ~I __ ~_~I I __ ~I __ ~IX __ JI execution, and converts the paper tape

60 characters into EBCDIC characters. The An end-of-record character is en­ OPEN executor selects and loads this module countered (undefined-length record (and one of the code conversion modules format only): The module returns listed in Appendix D) if the DCB specifies: control to the processing program.

- READ The tape is exhausted: The module - Fixed-length or undefined-length record returns control to the processing format program. - Paper tape. A paper tape reader-detected error character is encountered: If neces­ The module operates as follows: sary because of compression, the module moves the character to the • It receives control when a READ macro­ left (without conversion), and instruction is encountered in a returns control to the processing processing program. program.

• It enters the address of the lOB into • If one of the characters in the buffer the DECB, to permit the CHECK routine is an undefined character, the module to test execution of the channel pro­ converts the character to the hexadeci­ gram. mal character FF, sets an indication of this condition in the lOB for the paper • It completes the channel program by tape CHECK routine, and continues con­ inserting the buffer address from the version until one of the other condi­ DECB, and the length value from the tions is met. field DCBBLKSI (for fixed-length record format) or the DECB (for undefined­ Appendix D lists the modules composed of length record format). the tables used for code conversion. • It passes control to the end-of-block routine. READ/WRITE MODULE IGG019BH (UPDATE) • When control returns from the end-of­ block routine, the module issues a WAIT Module IGG019BH ascertains whether a macro-instruction to await execution of buffer supplied by the processing program the channel program. is to be written from or read into, and causes a corresponding BSAM Update channel • It converts each character in the program to be executed. The OPEN executor buffer until one of the following con­ selects and loads this module if the OPEN ditions is met, with the stated effect: parameter list specifies: - Update Conversion has provided the numcer of characters specified in the and the DCB specifies: length value: The module returns control to the processing program. - READ. All the characters read have been The module operates as follows: converted, but into a smaller num­ ber of characters. (Some input • It gains control when the processing character codes have no correspond­ program uses a READ or a WRITE macro­ ing EBCDIC translation in a speci­ instruction. fic code conversion module. There­ fore., after conversion of all char­ • If data is to be read into a buffer, acters in the buffer, the number of the module flags the lOB for a Read converted characters may be less operation, sets it to point to the Read than the length value): The module channel program, and copies the length completes a channel program for the and buffer address from the DECB or the number of additional characters DCB into the Read CCW. needed to fill the buffer, passes control to the end-of-block routine • If data is to be written from a buffer, which issues the EXCPmacro­ the module flags the lOB for a Write instruction to schedule the channel operation, sets it to point to the program, and issues a WAIT macro­ Write channel program, .copies the instruction for the channel auxiliary storage address from the program. When control returns, the DCBFDAD field into the IOBSEEK field module resumes converting charac­ and completes the length and buffer ters. address entries in the Write ccw.

Basic Sequential Access Method Routines 61 • The module passes control to end-of­ • If this is the first block of a new block module IGG019CC. On return of track and there is no other track in control from that module, it returns the allocated extent, the rr-odule sets control to the processing program. an EOV condition indication and returns control to the processing program.

WRITE MODULE IGG019DA (CREATE~BDAM) WRITE MODULE IGG019DB (CREATE-EDAM)

Module IGG019DA writes, for a data set later to be processed by BDAM, fixed-length Module IGG019DB writes, for a data set data blocks, fixed-length dummy blocks, and thereafter to be processed by BDAM, record-zero blocks. The OPEN executor variable-length and undefined-length blocks selects and loads this module if the DCB and record-zero blocks. The OPEN executor specifies: selects and loads this module if the DCB specifies: - WRITE (LOAD) - Fixed-length record format. - WRITE (LOAD) - Variable-length or undefined-length record format. The module operates as follows: The module essentially consists of two • It receives control from the processing routines: one to write data blocks; one to program when it encounters a WRITE write record-zero blocks. macro-instruction and also frow the EOV/new volume executor after the end­ To write a data block for BDAM, the of-volume routine of I/O support has routine operates as follows: obtained another extent. • It receives control from the processing • It connects the next available lOB to program when it encounters a WRITE-SF the DCB and the DECB. macro-instruction and also from EOV/new volume executor (to write the block not • It determines, in the same wanner as written into the previous volume) after end-of-block routine IGG019CD, whether the end-of-volume routine of I/O sup­ this block fits on the current track port has obtained another extent. and updates the DCBTRBAL field. • It determines whether this block fits • If this is neither the first nor the on the current track in the same manner last block of a track" the module as end-of-block routine IGG019CD and updates the full device address (FDAD) updates the DCBTRBAL field. in the DCB and the lOB and issues an EXCP macro-instruction. It then • If one of the following conditions returns control to the processing pro­ exists, it returns control (without any gram or the EOV/new volume executor further processing) to the processing (whichever it received control from). program or to the EOV/new volume execu­ tor (whichever it received control • If this is the last block of a track from) : (that is, no other block will fit on the track except the present block), A block other than the first block the module updates the full device on a track is to be written, but it address (FDAD) in the DCB and the lOB, does not fit on the balance of the expands the channel program to write track. the record-zero block for that track as well as the last data block, and issues The first block is to be written on an EXCP macro-instruction. The module a track, but the allocated extents then returns control to the routine are exhausted. (For this condi­ from which it received control. tion,themodule sets an EOV condi­ tion indication before it returns • If this is the first block Of a new control. ) track and there is another track in the allocated extent, the module finds the • If either of the following conditions next track in the allocated extent, exists, the module updates the full updates the· full device address (FDAD) device address (FDAD) in the DCE, the in the DCB and the lOB, and issues an lOB, and the channel program, issues an EXCP macro-instruction. It then EXCP macro-instruction" and then returns returns control to the routine from control to the· routine from which con­ which it received control. trol was received:

62 A block other than the first block programs. (The end-of-volume routine on the track is to be written and receives control from the CHECK routine it fits on the balance of the when that routine finds that a channel track. program did not execute because of an end-of-volume condition.) The first block is to be written on a track and there is another track • If no lOB is available, it returns in the allocated extents. control to the processing program.

• It returns control to the processing • If an lOB is available, it stores its program or the end-of-volume routine. address in the DCB and the DECB. To write a record-zero block for BDAM, • If the block last written was the last the routine operates as follows: one for this extent, the module erases the balance of the extent. • It receives control when a WRITE-SZ macro-instruction is encountered in the • If the block last written filled the processing program, or after the end­ last track used, the module obtains the of-volume routine has obtained another address of the next track. extent. • It sets the lOB and its channel program • It updates the record-zero area and the to write the block onto the next avail­ channel program to write the record­ able track. zero block and issues an EXCP macro­ instruction. The routine returns • If the block does not fill the track, control to the processing program or to the module completes the count field the end-of-volume routine. for this record and issues an EXCP macro-instruction. • If there are no data blocks on the track, the module modifies the channel • If the block fills the track, the program to clear the track after writ­ module sets the track-full indicator, ing the record-zero block. completes record zero for this track, links the channel program that writes record zero to the channel program that writes the data record, and issues an WRITE MODULE IGG019DD (CREATE-BDAM - TRACK EXCP macro-instruction. OVERFLOW) • If the block overflows the track, the module completes record zero for this Module IGG019DD creates data sets (with track and completes a channel program track overflow) of fixed-length data and to write record zero, completes the fixed-length dummy blocks that are subse­ count field and channel program for the quently to be processed by BDAM. The segment that fits on the track, and module segments the block, enters the seg­ constructs the identification for ment lengths and buffer segment addresses record one of the next track. in the channel program, updates storage addresses for the channel program, and • It repeats the preceding until a seg­ count fields for the block to be written ment is left that does not overflow a and for records zero of the tracks. The track. For the final segment, the OPEN executor selects and loads this module module operates as for a block that if the OPEN parameter list specifies: fits on the track. - output • On return of control from the IIO supervisor, the module returns control and the DCB specifies: to the routine from which it was received. - WRITE (LOAD) - Fixed-length record format - Track overflow. CHECK ROUTINES The module operates as follows:

• It receives control from the processing A CHECK routine synchronizes the execu­ program when the program finds a WRITE tion of channel programs with that of the macro-instruction, or from the end-of­ processing program. When the processing volume routine of IIO support after program issues a READ or WRITE macro­ that routine has obtained a new volume instruction, control returns to the to write out any pending channel processing program (from the. READ or WRITE

Basic Sequential Access Method Routines 63 routine> when the channel program has been CHECK MODULE IGG019BB scheduled for execution or, if reading paper tape, when the buffer has been filled Module IGG019BB synchronizes the execu­ and the data converted. To determine the tion of the channel program to that of the sta'te of execution of the channel program, processing program, and responds to any the processing program issues a CHECK exceptional condition remaining after the macro-instruction; control returns to the I/O supervisor has posted execution of the processing program (from the CHECK routine) channel program in the lOB. The OPEN if the channel program was executed suc­ executor selects and loads this module if cessfully, or if it was executed success­ the OPEN parameter list specifies: fully after the CHECK routine caused volume-switching. For permanent errors, - Input, Output, Inout, or Outin control passes to the processing program's SYNAD routine. Reading or writing under and the DCB specifies: BSAM, the SYNAD routine may continue proc­ essing the data set by returning control to - READ or WRITE. the CHECK routine; writing in the Create­ BDAM mode, processing cannot be resumed. The module operates as follows:

• It receives control when a CHECK macro­ There are four CHECK routines. Table 18 instruction is encountered in a lists the routines available and the processing program. conditions that cause a particular module to be used. The OPEN executor selects one • It tests the DECB for successful execu­ of the four routines, loads it, and places tion of the channel program. its address into the DCBCHECK field. For example, the table shows that module • If the channel program was executed IGG019BG is selected and loaded if READ and normally, the module returns control to paper tape character conversion is speci­ the processing program. fied. • If the channel program is not yet executed, the module issues a WAIT Table 18. Module Selector - CHECK Modules macro-instruction. r------T------, I I I • If the channel program encountered an I Access Conditions I Selections I error condition in its execution, the I I I rrodule issues an SVC 55 instruction to ~------+---T---T---T---T---~ pass control to the SYNAD/EOV executor I Input or , X, 'X I , I (IGC0005E). Two types of returns from ~------+---+---+---+---+---~ the executor are possible: 10utput or I I X I I I I ~------+---+---+---+---+---~ If the executor determines the I Inout, Outin I X I X I I , I error condition to be an EOV condi­ ~------~------+---+---+---+---+---~ tion, the executor passes control ,Update I I I 'X I I to the end-of-volume routine of I/O ~------+---+---+---+---+---~ support for volume switching. That I READ I X I I X I I I routine passes control to the ~------+---+---+---+---+---~ EOV/New Volume executor which res­ I WRITE I I X I I I I chedules the purged channel pro­ ~------+---+---+---+---+---~ grams. That executor returns con­ IWRITE(LOAD) I I I I I X I trol to the CHECK module. I (Create-BDAM) I I , I I I ~------+---+---+---+---+---~ If the executor determines the I Paper tape I I I X I I I error condition to be a permanent Icharacter conversion I I I I I I error, the executor returns control ~------+---i---+---i---i---~ to the CHECK module immediately. I I I I Centrol is then passed to the proc­ I CHECK Modules I I I essing program's SYNAD routine. If I I I I the SYNAD routine returns control ~------+---T---+---T---T---~ to CHECK routine, the routine I IGG019BB I X I X I I I I issues a second SVC 55 instruction ~------+---+---+---+---+---~ to pass control to the SYNAD/EOV I IGG019BG I I I X I I I executor (IGC0005E) again. The ~------+---+---+---+---+---~ executor treats this as an ACCEPT I IGG019BI I I I I X I I error option, implements it, and ~------+---+---+---+---+---~ returns control to the routine, which then returns control to the LI ______IGG019DC i I ___ iI ___ iI __ ~iI ___ iI ___X JI processing program.

64 CHECK MODULE IGG019BG (PAPER TAPE CHARACTER The module operates as follows: CONVERSION) • It receives control when the processing program uses the CHECK macro- Module IGG019BG processes error condi­ instruction. tions detected by READ module IGG019BF.

This module is loaded if the DCB speci­ • It tests the ECB in the DECB for fies the READ macro-instruction and paper successful execution of the channel tape character conversion. program associated with that DECB.

The module operates as follows: • If the channel program is not yet executed, the module uses a WAIT macro­ • It receives control when a CHECK macro­ instruction. instruction is encountered in a processing program. • If the channel program has been executed normally, the module returns • If the READ routine filled the buffer control to the processing program. with valid characters, the CHECK module returns control to the processing pro­ gram. • If the channel program encountered an error condition in its execution the module tests to determine if the error • If the READ routine stopped converting is an EOV condition. because of a reader-detected error character, or if the READ routine encountered an undefined character, the • If the error is an EOV condition, the CHECK module passes control to the module sets an indicator to show that processing program's SYNAD routine. this entry is from the CHECK module and passes control to the processing program's EODAD routine. • If control returns from the SYNAD rou­ tine, the CHECK module returns control • If the error is not an EOV condition to the processing program. the module issues an SVC 55 instruction to pass control to the SYNAD/EOV execu­ tor (module IGC0005E). • If the channel program encountered an EOV condition, the CHECK module issues • On return of control from the SYNAD/EOV an SVC 55 instruction. Control passes executor the CHECK module passes con­ to the SYNAD/EOV executor (IGC0005E), trol to the processing program's SYNAD then to the 2nd-of-volume routine of routine. If the SYNAD routine returns I/O support, and finally to the proc­ control to CHECK routine, the routine essing program's EODAD routine. issues a second SVC 55 instruction to pass control to the SYNAD/EOV executor (IGC0005E) again. The executor treats this as an ACCEPT error option, imple­ ments it, and returns control to this CHECK MODULE IGG019BI (UPDATE) routine, which then returns control t_o the processing program. Module IGG019BI synchronizes the execu­ tion of a BSAM Update channel program to the progress of the processing program. (A BSAM Update channel program either writes CHECK MODULE IGG019DC (CREATE-BDAM) data from a buffer or reads data into a buffer.) The module also causes processing of permanent errors and end-of-volun'e con­ Module IGG019DC synchronizes the execu­ ditions. The OPEN executor selects and tion of the channel program (to write a loads this module if the OPEN parameter block for a BDAM data set) to the progress list specifies: of the processing program, and responds to exceptional conditions encountered in the - update execution of the channel program. The OPEN executor selects and loads this module if and the DCB specifies: the DCB specifies: - READ. - WRITE (LOAD).

Basic Sequential Access Method Routines 65 The module operates as follows: Routines that are loaded by the OPEN executor are mutually exclusive; that is, • It receives control when the processing only one of them can be used with one DCB. program uses the CHECK macro- The PRTQV macro-expansions result in instruction. instructions that set or test bits that cause branching in either the processing • If the channel program is not yet program or in an appendage. executed, the module issues a WAIT macro-instruction. Tables 19, 20, and 21 list the various • If the channel program executed without kinds of control routines and the paramet­ error" the module returns control to ers that cause them to gain control. Table the processing program. 19 shows the access condition options that cause the OPEN executor to load a control • If the execution of the channel program routine for use with a DCB. Table 20 lists encountered a permanent error the SVC instructions that cause a control condition, the module passes control to routine to be loaded at execution time. the processing program's SYNAD routine. Table 21 lists the different macro­ If control is returned from the SYNAD expansions constructed by the assembler. routine, or if there is no SYNAD rou­ tine, the module issues an ABEND macro­ instruction. Table 19. Module Selector Control • If the WRITE routine encountered an EOV Modules Selected and Loaded by condition (and, therefore did not the OPEN Executor request scheduling of the channel pro­ r------T------, gram for execution), this module passes I I I control to the SYNAD/EOV executor I Access Conditions I Selection I (IGC0005E) by issuing an SVC 55 I I I instruction. On return of control this ~------+-T-T-T-T-T-T-~ module tests for completion of the I NOTE/POINT IXIXI IXIXI I I channel program. ~------+-+-+-+-+-+-+-~ I Update, Track Overflow, orl I I IXI I I I ~------+-+-+-+-+-+-+-~ I Chained Scheduling I I I IXIXI I I ~------+-+-+-+-+-+-+-~ BSAM CONTROL ROUTINES I CNTRL I I IXI I IXIXI ~------+-+-+-+-+-+-+-~ I Direct-Access Storage IXI I IXI I I I A control routine receives control when ~------+-+-+-+-+-+-+-~ a control macro-instruction (for example" I Magnetic Tape I IXIXI IXI I I CNTRL, NOTE, POINT, BSP) is used in a ~------+-+-+-+-+-+-+-~ processing program or in another control I Printer I I I I I I X I I routine. BSAM control routines (which ~------+-+-+-+-+-+-+-~ include those available in QSAM) pass con­ I Card Reader I I I I I I IXI trol to the I/O supervisor, another control ~------+-~-~-~-~-~-~-~ routine, or return control to the process­ I I I ing program directly. BSAM control rou­ I control Modules I I tines cause the physical or logical posi­ I I I tioning of auxiliary storage devices. ~------+-T-T-T-T-T-T-~ I IGG019 BC I X I I I I I I I ~------+-+-+-+-+-+-+-~ There are three types of BSAM control I IGG019BD I IXI I I I I I routines: ~------+-+-+-+-+-+-+-~ I IGG019BE I I I X I I I I I • Routines that are loaded into process­ t------+-+-+-+-+-+-+-~ ing program main storage by the OPEN I IGG019BK I I I IXI I I I executor (CNTRL, NOTE/POINT). ~------~------+-+-+-+-+-+-+-~ I IGG019BL I I I I I X I I I • Routines that are loaded into supervi­ ~------+-+-+-+-+-+-+-~ sory transient area main storage by an I IGG019CA1 I I I I I IXI I SVC instruction in a processing program ~------+-+-+-+-+-+-+-~ macro-expansion or in another control I IGG019CB'- 1 I I I I I IXI routine (BSP, Track Balance). ~------~-~-~-~-~-~-~-~ I'-These routines are also used in QSAM; I • Routines that are in-line macro­ I see that section for description of I expansions in the processing program IL ______these routines. JI (PRTOV).

66 Table 20. Control Modules Loaded at Execu- The NOTE routine operates as follows: tion Time r---T------T------T------, I I Macro- I I I • It receives control when a NOTE macro­ ISVCllnstruc-1 Function IModule No.1 instruction is encountered in a I No. I tion I I I processing program. ~---+------+------+------i 125 I (none) I Establish valid 1 IGC0002E 1 • It obtains the FDAD value used by the I I I track balance 1 I channel program last executed. The " , Erase balance I , address is found in either the lOB or I' I of extent for 1 I the DCB depending upon which macro­ I I , track overflow I I instruction the last channel program ~---+------+------+------i implemented. 169 ,BSP ,Device I IGC00061 I I I , Independent I I • If the macro-instruction was READ and " I Backspace (tape" I more than one buffer is used, the

"L ___ ~ ______~I ______direct-access) ~I ______JI channel program last executed placed the FDAD value into the IOBSEEK field in the lOB.

Table 21. Control Routines That Are • If the macro-instruction was READ and a Macro-Expansions1 2 single buffer is used, the channel program last executed placed the FDAD r------T------, value into the DCBFDAD field of the I ," Number of , DCB. I Macro-Instruction 1 Macro- I , I Expansions, • If the macro-instruction was WRITE, the , I' end-of-block routine placed the FDAD ~------+------i value into the DCBFDAD field. 1 PRTOV - User exit ,1, ~------+------~ • It issues a BALR instruction to pass ,L ______PRTOV - No user exit ~, ______1 J, control to the IECPRLTV routine; which converts full addresses into relative addresses. 1These routines are also used in QSAM; see that section for a description of • It returns the address and control to the routines. the processing program. 2This table duplicates Table 15; it is repeated here tc identify all control routines available in BSAM. POINT Routine

The POINT routine in module IGG019BC CONTROL MODULE IGG019BC (NOTE, POINT - converts a relative address (of the form DIRECT-ACCESS) TTRZ) to the full direct-access device address (FDAD) used by the next channel program to read or write the block noted. The OPEN executor selects and loads this module if the DCB specifies: The POINT routine operates as follows: .,.. POINT - Direct-access storage device. • It receives control when a POINT macro­ instruction is encountered in a The module consists of two routines: processing program. NOTE and POINT. • It issues a BALR instruction to pass control to the IECPCNVT routine. That routine converts the relative address NOTE Routine to the full address and returns control to the POINT routine. If the process­ ing program passed an invalid relative The NOTE routine in module IGG019BC address, the routine sets the DCBIFLGS converts the full direct-access device and IOBECBCC fields to show that an address (FDAD) for' the last block read or addressing error occurred, before written.", to a relative address (of the fortll returning control. (The CHECK routine TTR), and presents that value to the proc­ finds the error and processes accord­ essing program. ingly. )

Basic Sequential Access Method Routines 67 • It establishes the actual value to be • It follows the last Read channel pro­ used by the next channel program by gram by a NOP channel program to obtain testing the fourth byte of the relative device end information for the last address (TTRZ) • If the value of Z is spacing operation. zero, the full address is decrerrented by one; if Z is one, the address • It returns control to the processing calculated by the IECPCNVT routine is program, unless a tape mark, load left unchanged. (For an explanation of point, or permanent error is encoun­ how the value of Z is set, refer to the tered in one of the executions of the description of the POINT macro­ Read channel program. In that case, instruction in the publication IBM the routine sets the DCBIFLGS field to System/360 Operatinq System: control indicate a permanent error, before Program Services.) returning control to the processing program. (Subsequent processing by the • It inserts the value in the DCBFDAD and READ or WRITE routine to cause schedul­ IOBSEEK fields, sets the DCBOFLGS field ing of channel programs for execution to show that the contents of the will result in their not being sche­ DCBTRBAL field are no longer valid, and duled. On the next entry into the returns control to the processing pro­ CHECK routine, it detects and processes grarr. the error condition.>

CONTROL MODULE IGG019BE (CNTRL: SPACE TO TAPE MARK, SPACE TAPE RECORDS) CONTROL MODULE IGG019BD (NOTE, POINT - MAGNETIC TAPE) Module IGG019BE positions magnetic tape at a point within the data set specified by The OPEN executor selects and loads this the CNTRL macro-instruction. The OPEN exe­ module if the DCB specifies: cutor selects and loads this module if the DCB specifies: - POINT - Magnetic Tape. - CNTRL - Magnetic Tape. This rrodule consists of two routines: NOTE and POINT. The module consists essentially of two routines: One ~or spacing forward or back­ ward to the tape mark (the FSM/BSM routine), and one for spacing forward or NOTE Routine backward a number of tape records (the FSR/BSR routine).

The NOTE routine in module IGG019BD presents the contents of the DCBBLKCT field The FS~/BSM routine operates as follows: of the DCB to the processing program and returns control to the processing program. • It receives control when a CNTRL macro- instruction is encountered in a processing program.

POINT Routine • It constructs a channel program to space to the tape mark in the desired direction. The POINT routine in module IGG019BD positions the tape at the block for which • It issues an EXCP macro-instruction for NOTE was issued. the FSM or BSM channel program. Con­ trol returns to the routine at channel The POINT routine operates as follows: end for the FSM/BSM channel prograrr,.

• It receives control when a POINT macro­ • It issues an EXCP macro-instruction for instruction is encountered in a a NOP channel program to obtain device processing program. end information from the FSM/BSM chan­ nel program. • It constructs a channel program to read forward or backward one block. • It issues an EXCP macro-instruction for a BSR or FSR channel program to pOSi­ • It passes the channel program for exe­ tion the tape within the data set, cution the number of times required to after the FSM/BSM channel program position the tape at the desired block. encounters a tape-mark.

68 • It issues an EXCP macro-instruction for converts it to a relative address (of the a NOP channel program again, to obtain form 'I'TR), and presents that value to the device end information from the BSR/FSR processing program. channel program. The routine then returns control to the processing pro­ The NOTE routine operates as follows: graro. • It receives control when a NOTE macro­ The FSR/BSR routine operates as follows: instruction is encountered in a processing prograro. • It receives control when a CNTRL macro­ instruction is encountered in a • It obtains the FDAD value used by the processing program. channel program last executed. The location of this address depends on • It constructs a channel program to which macro-instruction the last chan­ space one record in the desired direc­ nel program implemented. tion. • If the macro-instruction was READ and • It reduces the count passed by the more than one buffer is used, the control macro-instruction and issues an channel program last executed placed EXCP macro-instruction for the FSR or the FDAD value into the IOBSEEK field BSR channel program. in the lOB if track overflow or Update is being used, and into the ICBSEEK • When the count is zero, it issues an field if chained scheduling is used. EXCP macro-instruction for a NOP chan­ nel program to obtain the device end • If the macro-instruction was READ and information from the last FSR/BSR chan­ only a single buffer is used the chan­ nel program. The routine then returns nel program last executed placed the control to the processing prograro. FDAD value into the DCBFDAD field of the DCB. • If a load point is encountered during spacing, the routine returns control to • If the macro-instruction was WRITE, the the processing program. end-of-block routine placed the FDAD value into the DCBFDAD field. • If a tape mark is encountered during spacing, the routine repositions the • It issues a BALR instruction to pass tape to a point within the data set by control to the IECPRLTV routine, which reverse spacing one block and returns converts full addresses into relative control to the processing program. addresses.

• If a permanent error is encountered • It returns the address and control to during spacing, the routine issues a the processing program. BALR instruction to pass control to the SYNAD routine, if one is present; if not, it issues an ABEND macro­ POINT Routine instruction. The POINT routine in module IGG019BK establishes the full direct-access device CONTROL MODULE IGG019BK (NOTE, POINT - address (FDAD) used by the channel program DIRECT-ACCESS - SPECIAL) to read or write the block noted. The POINT routine operates as follows: This module contains the NOTE and POINT routines for the special access conditions • It receives control when a POINT macro- of chained scheduling, track overflow, and instruction is encountered in a Update. The OPEN executor selects and processing program. loads this module if the DCB specifies: • It issues a BALR instruction to pass - POINT control to the IECPCNVT routine. That - Direct-access storage routine converts the relative address - Chained scheduling, track overflow, or to the full address and returns control the OPEN parameter is Update. to the POINT routine. If the process­ ing program passed an invalid relative address, the executor sets the DCBIFLGS NOTE Routine and the IOBECBCC fields to show that an addressing error occurred, before The NOTE routine in module IGG019BK returning control. (The CHECK routine finds the full direct-access device address finds the error and processes accord­ (FDAD) for the last block read or written, ingly. )

Basic sequential Access Method Routines 69 • It establishes the actual value to be • The last spacing channel program is used by the next channel program by fallowed by a NOP channel program to testing the fourth byte of the relative obtain device end information for the address (TTRZ). If the value of Z is last spacing operation. zero, the full address is decremented by one; if Z is one, the address • Control is returned to the proceSSing calculated by the convert routine is program, unless a tape mark, load left unchanged. (For an explanation of paint, or permanent error is encoun­ how the value of Z is set, refer to the tered in the execution of one of the description of the POINT macro­ channel programs. In that case, the instruction in the publication IBM routine sets the DCBIFLGS field to System/360 Operating System/360 indicate a permanent error before Operating System: Control Program Ser­ returning control to the processing vices. ) program. (Subsequent attempts by the READ or WRITE routine to cause schedul­ • It inserts the value into the DCBFDAD ing of channel programs for execution and IOBSEEK fields if track overflow or will result in their not being sche­ Update is being used, and also into the duled. On the next entry into the ICBSEEK field if chained scheduling is CHECK routine, that routine detects and used.. It sets the DCBOFLGS field to processes the condition.) show that the contents of the DCBTRBAL field are no longer valid, and returns control to the processing program. CONTROL MODULE IGC0002E (SVC 25 - TRACK BALANCE, TRACK OVERFLOW ERASE)

CONTROL MODULE IGG019BL (NOTE, POINT - Module IGC0002E consists of two routines MAGNETIC TAPE - CHAINED SCHEDULING) that erase either a part of one track or several tracks. The track balance routine determines the available space by erasing Module IGG019BL is selected and loaded the remainder of the track; the track by the OPEN executor if the DCB specifies: overflow erase routine erases tracks at the end of each extent on which there are no - POINT data fields for blocks of the data set to - Magnetic Tape which the extent belongs. The routine is - Chained scheduling. used when a block in a data set with track overflow record format· would span extents. The module consists of two routines: NOTE and POINT. This module is loaded at execution time into supervisor transient area main storage if either READ/WRITE module IGG019BA or end-of-block module IGG019C2 arrives at an NOTE Routine SVC 25 instruction. The NOTE routine in module IGG019BL presents the contents of the DCBBLKCT field of the DCB to the processing program and Track Balance Routine returns control to the processing program.

The track balance routine establishes a valid value for the DCBTRBAL field of a DCB POINT Routine opened for output to a direct-access device, when the field value has been The POINT routine in module IGG019BL invalidated by a preceding READ, POINT, or positions the tape at the black for which OPEN for MOD macro-instruction. NOTE was issUed. It operates as follows: The routine operates as follows: • It receives control when a POINT macro­ instruction is encountered in a • It receives control after it is loaded. processing program. • It ccnstructs, and issues an EXCP • A channel program is constructed to macro-instruction for, a channel pro­ read forward or backward one black. gram with the Erase command and a count exceeding the track capacity. The • The channel program is passed for exe­ erase operation begins following the cution the number of times required to block just read or on the block pointed position the tape at the desired block. at.

70 • It determines the actual track balance • It constructs and issues an EXCP macro­ by subtracting the residual count in instruction for a NOP channel program the channel status word (CSW) from the to obtain device end information from count used in the channel prograrr" and the backspace channel program. inserts the difference in the DCBTRBAL field of the DCB. • If the backspace channel program • It returns control to the WRITE rou­ executed normally, the module sets reg­ tine. ister 15 to zero and returns control to the processing program. Track Overflow Erase Routine • If the channel program executed with an error other than unit exception, the module sets the DCBIFLGS field to indi­ The track overflow erase routine erases cate a permanent error. (The CHECK the space on a direct-access storage device macro-instruction, following the next that lies between the last block to be READ or WRITE macro-instruction, causes written into the current extent and the end the CHECK routine to pass control to of that extent. If track overflow end-of­ the processing program's SYNAD block routine IGG019C2 finds that the next routine.) segment of a block falls on a track beyond the present extent. that end-of-block • If the backspace channel program exe­ routine uses the SVC 25 instruction to pass cuted with a unit exception, the module control, and the channel program, to this constructs and issues an EXCP macro­ routine. instruction for a channel program to forward space the tape one block. It The routine operates as follows: next constructs .and issues a NOP channel program to obtain device end • It receives control when it is loaded. information from the forward space channel program. When channel end for • It substitutes Erase commands for the the NOP channel program occurs, the Write commands in the channel program module returns control to tne process­ associated with the present lOB. ing program with register 15 set to an error code. • It issues an EXCP macro-instruction to cause execution of the channel program For direct-access devices, the module and a WAIT macro-instruction for its operates as follows: completion. • It receives control after it is loaded. • It returns control to the track over­ flow end-of-block routine, irrespective • It decrements the DCBFDAD field in the of any errors in the execution of the DCB to the preceding block address, channel program. across tracks, cylinders, or extents. • It sets the DCBOFLGS field to show that the DCBTRBAL field value is invalid. CONTROL MODULE IGC00061 (SVC 69 - BSP) • If a valid preceding DCBFDAD value has been established, the module returns Module IGC00061 backspaces the data set control to the processing program with one block, whether the data set is on a register 15 set to zero. magnetic tape or direct-access device. • If there is no valid preceding DCBFDAD The expansion of the macro-instruction value (because the processing program BSP includes an SVC 69 instruction which attempts to backspace beyond the first causes the module to be loaded and entered. block), the module returns control to The module essentially consists of two the processing program with register 15 parts, one for magnetic tape and one for set to an error code. direct-access devices. • If a permanent error is encountered For magnetic tape, the module operates when reading the count fields (to esta­ as follows: blish the preceding DCBFDAD field value), the DCBIFLGS field value is set • It receives control after it is loaded. to indicate a permanent error. (The CHECK routine, following the next READ • It constructs and issues an EXCP macro­ or WRITE macro-instruction, causes con­ instruction for a channel program to trol to pass to the processing backspace one block. program's SYNAD routine.>

Basic Sequential Access Method Routines 71 BASIC PARTITIONED ACCESS METHOD ROUTINES

A partitioned data set has a directory tines are not loaded at OPEN time; the STOW and members. The directory is read and routine is loaded at execution time, all written using BPAM routines~ the members the coding for FIND (C option) is a macro­ are read and written using BSAM routines. expansion, and the FIND (D option)/BLDL {Refer to the BSAM portion of this publica­ routine and the converting routines are in tion.} A processing program using BPAM resident main storage. Table 22 shows how routines for input from the directory is these routines gain control. presented with the address of a member in a channel program or in a table~ fcr a processing program using BPAM for output to a directory, the routines determine the address of the member and record that address in the directory. STOW MODOLE IGC0002A (SVC 21)

Module IGC0002A finds entries in BPAM directory entry blocks and keeps the BPAM ROUTINES directory left-justified after entries have been inserted or deleted. BPAM routines store and retrieve entries The expansion of the STOW macro­ in the directory and convert between rela­ instruction includes an SVC 21 instruction tive and absolute auxiliary storage that causes this module to be loaded and to addresses. Directory entries are entered gain control. The STOW macro-instruction and found by constructing channel programs is issued in one of two ways: that search the directory for appropriate entry blocks and by locating an equal, or Explicitly by a processing program higher, entry within the block. Address using BPAM for output. converting routines refer to the data extent block (DEB) to determine the address Implicitly by a processing program value complementary to the given value. using BSAM, QSAM, or BPAM for output, when issuing a CLOSE macro-instruction BPAM routines (see Table 22) differ from to a D.CB opened for a member of a BSAM and QSAM routines in that BPAM rou- partitioned data set.

Table 22. BPAM Routines Residence r------T------T------T------, I I I I Instruction I I BPAM Routines I Module NUKber I Residence I Passing I I I I I Control I ~------+------+------+------~ I STOW I IGC0002A I Supervisory Transient I SVC 21 I I I IArea I I ~------+------+------+------~--~ I FIND (C Option) I (Macro Expansion) IProcessing Program IFIND (C Option) I I I IArea I I ~------+------+------+------~ I FIND (D Option) I IECPFIND,IECPFNDl ISupervisory Resident ISVC 18 I I I IArea I I ~------+------+------+------~ I BLDL I IECPFIND,IECPFND1 I supervisory Resident I SVC 18 or I I I I Area I BAL IECPBLDL I ~------~------+------+------+------~ I Convert TTR I IECPFIND,IECPFNDl ISupervisory Resident IBAL IECPCNVT I I I IArea I I ~---~------+------+------+------~ I Convert MBBCCHHR I IECPFIND,IECPFNDl Isupervisory Resident IBAL IECPRLTV I

IL- ______~I ______~IArea ______~I ______JI

72 The module operates as follows: • For entries that are higher than the member name, the module checks to • It receives control when it is loaded. determine whether the ADD option is specified.

• If an ADD (Not ALIAS) or a REPLACE (Not • If the ADD option is specified, the ALIAS) option is specified, the module rr,odule moves the new entry from the writes an end-of-data set mark work area to the output buffer before (zero-length data block) at the end of moving the high entry and those follow­ the member. The module then stores, ing it. The module then shifts to the for use at the next entry into the STOW right all entries following the added module, the relative address of the entry by constructing the channel pro­ next block to be written, in the grams necessary alternately to write DCBRELAD field of the DCB. (The OPEN and read entry blocks. The module routine determines the first relative writes the full block, moves the address for the first entry to this remaining entries to the output buffer, module.) reads another entry block, and then completes and writes the output buffer.

• For any option, the module searches the • On completion of all channel programs directory for an entry block with a key necessary for the specified option, the equal to or higher than the member routine returns control to either the name, and reads that entry block into processing program, or the CLOSE rou­ the input buffer. tine.

• The module compares the entries in the entry block to the member name in the instruction operand. Entries whose FIND (C OPTION) MACRO-EXPANSION value is lower than that of the member nalfe are moved to the output buffer. This coding causes translation of the relative address into a full device address • For entries that equal the member name, (FDAD) and its insertion into the next lOB. the module checks to determine whether the REPLACE, the CHANGE, or the DELETE The macro-expansion produces object code option is specified. that places the relative address in the DCBRELAD field in the DCB and issues a BALR instruction to pass control to the POINT • If the REPLACE option is specified, the routine. module moves the new entry from the work area to the output buffer, skips the present entry, and moves the remaining entries to the output buffer. It issues an EXCP macro-instruction to RESIDENT MODULE IECPFIND write the updated entry block into the directory. Unless BLDLTAB is specified for the RESIDNT option of the SUPRVSOR macro­ • If the CHANGE option is specified, the instruction in the system generation module moves the present entry less the (SYSGEN) program, this module is link­ present name to the new entry work edited at SYSGEN time with other modules to area. To enter the new entry in its make up the resident nucleus. (If BLDLTAB proper entry block, the routine contin­ is specified, module IECPFND1 is used.) ues as though the ADD option were specified. The routines composing the module gain control through an SVC 18 instruction in a • If the DELETE option is specified, the processing program or a BALR instruction in module skips the present entry and a control program. A FIND (D Option) or moves the remaining entries to the BLDL macro-instruction expansion generates output buffer. The module now shifts an SVC 18 instruction which causes control the halance of the entries in the to pass to CSECT IGC018, the entry point directory to the left by constructing for the FIND (D Option) and BLDL routines. the necessary channel programs. It Contrel programs may use a BALR instruction reads a block, shifts entries into the and the address found in the communications remaining space of the preceding block, vector table (CVT) for entry points writes the completed entry block., and IECPBLDL, IECPCNVT, and IECPRLTV to pass starts the next block. control to the respective routines.

Basic Partitioned Access Method Routines 73 FIND (D Option) Routine - Entry Point and The routine operates as follows: CSECT Name: IGC018 (SVC 18) • For each extent, the module reduces the The FIND (D Option) routine finds the aIf,ount TT by the number of tracks in relative address of the member named in the the extent. When the balance is nega­ macro-instruction. It then causes the tive, the proper extent has been relative address to be converted into the reached. full device address (FDAD) and to be loaded into the DCBFDAD and IOBSEEK fields. The routine operates as follows: • It determines the full device address for the specified relative value. • It searches the directory for an entry block with a key equal to., or higher than, the given member name.

• It reads that entry block into main Convert Full-to-Relative Address Routine - storage and searches the entry block Entry Point: IECPRLTV for the matching entry.•

• It enters the relative address stated Converting routine IECPRLTV accepts, in the entry into the DCBRELAD field in from the location shown by register 2, a the DCB and issues a BAL instruction to full device address (of the form MBBCCHHR) pass control to the POINT routine. for direct-access devices and presents the Control returns to the processing pro­ corresponding relative address (of the form gram. TTR) in register o.

The module totals the number of tracks per extent for the (M - 1) extents. For BLDL Routine - Entry Points: extent M, it adds the number of tracks IECPBLDL, IGC018 (SVC 18) entered into the extent.

The BLDL routine completes a BLDL table with the directory entry for each of the members named in the BLDL table. The routine operates as follows: RESIDENT MODULE IECPFNDl

• It searches the directory for an entry block with a key equal to, or higher If BLDLTAB is specified for the RESIDNT than, the given member name. parameter of the SUPRVSOR macro-instruction when the system is generated, this module • It reads 'that block into main storage is link-edited at SYSGEN time with other and searches the entry block for the modules to make up the resident nucleus. matching entry. (If BLDLTAB is not specified, module IECPFIND is used.) At initial program • It moves the entry into the processing loading (IPL) time, the nucleus initializa­ program's BLDL table, obtains the next tion program (NIP) constructs a resident name to be matched, and returns to the BLDL table from SYS1.LINKLIB directory beginning of the routine. entries.. That table is the one referred to by the FIND and BLDL routines in this • When the BLDL table has been completed, module. the routine returns control to the processing program. The routines composing the module gain control through an SVC 18 instruction in a processing program or a BALR instruction in Convert Relative-to-Full Address Routine - a control program. A FIND (D Option) or Entry Point: IECPCNVT BLDL macro-instruction expansion generates an 8VC 18 instruction which causes control to pass to CSECT IGC018, the entry point Converting routine IECPCNVT accepts, in for the FIND (D Option) and BLDL routines. register 0., a relative address (of the form Control programs may use a BALR instruction TTR) for direct-access devices and presents and the address found in the communications the corresponding full device address (of vector table (CVT) for entry points the form MBBCCHHR) at the location shown by IECPBLDL., IECPCNVT, and IECPRLTV to pass register 2. control to the respective routines.

74 FIND CD Option} Routine - Entry Point and reads that block into main storage and CSECT Name: IGC018 (SVC lS) searches the entry block for the n,atch­ ing entry.

The FIND (D Option) routine finds the • If the name is in the table, or after relative address of the member named in the finding the matching entry in an entry macro-instruction. It then causes the block read in, it moves the entry into relative address to be converted into the the processing program'sBLDL table, full device address (FDAD) and to be loaded obtains the next name to be matched, into the DCBFDAD and lOB SEEK fields. The and returns to the beginning of the routine operates as follows: routine.

• If SYS1.LINKLIB is the referenced • When the BLDL table has been completed, , it scans the resident BLDL the routine returns control to the table for an entry that matches the processing program. given member name.

• If SYS1.LINKLIB is not the referenced library, or if the name is not in the table, it searches the directory for an Convert Relative-to-Full Address Routine - entry block with a key equal to, or Entry Point: IECPCNVT higher than, the given member na~e. It reads that entry block into main stor­ age and searches the entry block for converting routine IECPCNVT accepts, in the matching entry. register 0, relative addresses (of the form TTR) for direct-access devices and presents • If the name is in the table, or after the corresponding full device addresses (of finding the 'matching entry in an entry the form MBBCCHHR) at the location shown by block read. in, it enters the relative register 2. address stated in the entry into the DCBRELAD field in the DCB. The routine operates as follows: • It issues a BAL instruction to pass • For each extent, the routine reduces control to the POINT routine. the amount TT by the number of tracks in the extent. When the balance is • It returns control to the processing negative, the proper extent has been program. reached. • It determines the full device address BLDL Routine - Entry Points:IECPBLDL, for the specified relative value. IGC018 (SVC 18)

The BLDL routine completes a BLDL table convert Full-to-Relative Address Routine - with the directory entry for each of the Entry Point: IECPRLTV members named in the BLDL table. The routine operates as follows: converting routine IECPRLTV accepts, • If SYS1.LINKLIB is the referenced from the location shown by register 2, a library; it scans the resident BLDL full device address (of the form MBBCCHHR) table for an entry that matches the for direct-access devices and presents the given member name. corresponding relative address (of the form TTR) in register o. • If SYS1.LINKLIB is not· the referenced library, or if the name is not in the The routine totals the number of tracks table, it searches the directory for an per extent f or the (M - 1) extents. For entry block with a key equal to, or extent M, it adds the number of tracks . higher than, the given member nan,e. It entered into the extent •

Basic Partitioned Access Method Routines 75 SEQUENTIAL ACCESS METHOD EXECUTORS

Sequential access method executors are blocks (ICB). It selects and load the routines that receive control froIT, pass access method routines to be used with the control to, or return control to I/O sup­ data control block (DCB) being opened. port routines. (For a description of I/O support routines refer to the publication The CLOSE executor is entered from the IBM System/360 Operating system: CLOSE routine of I/O support, and returns Input/Output Support, Program Logic Manual, control to it. The executor handles any Form Y28-6609.) Table 23 shows the pending channel programs and releases the sequence of control between executors and main storage used by the lOBs (and ICBs) other routines. Executors perform process­ and channel programs. ing unique to an access method when a data control block is being opened or closed, or The SYNAD/EOV executor is entered when an end-of-volume condition is being proc­ synchronizing or CHECK routine finds that a essed. These executors (used for QSAM, per~anent I/O error or end-of-volume (EOV) BSAM, and BPAM) are of five types: condition was encountered during the execu­ tion of a channel program. The executor • OPEN executor passes control to the end-of-volume routine • CLOSE executor of I/O support, or executes the error • SYNAD/EOV executor options specified by the processing pro­ • EOV/new volume executor gram. The executor provides a work area in • FEOV executor. main storage for the end-of-volume routine. Executors differ from other access meth­ The FEOV (force-end-of volume) executor od routines in that they are executed from is entered when an FEOV macro-instruction the supervisory transient area. It is the is encountered in a processing program. OPEN executor that loads the access method The executor handles any pending channel routines into the processing program area programs, provides a work area in main for later use during processing program storage for the end-of-volume routine, and execution. passes control to theend-of-volume routine of I/O support. The OPEN executor is entered from the OPEN routine of I/O support, and returns The EOV/new, volume executor receives control to that routine. (See Figure 10.) control fronl the end-of-volume routine of It constructs the data extent block (DEB), I/O support. The executor causes the I/O the input/output blocks (lOB), the channel supervisor to reschedule any channel pro­ programs, and, if chained channel-program grams not executed because of the EOV scheduling is used, interruption control conditions.

Table 23. Sequential Access Method Executors - Control Sequence ,r------T------T------T---~------T------, , , I I I , I I Receives Control , I Passes Control I , Executor I Number , From I Via I To I , I I I I I ~------+------+------+------+------1 I OPEN , See Tables 24, I See Figure 10 IXCTL I See Figure 10 I , I 25,26 I ,(WTG Table) I I ~------+------+~------+------+------1 I CLOSE 'IGG0201A I CLOSE Routine IXCTL I CLOSE Routine I I I IGG0201B t I (WTG Table) I I ~------+------+------+------+------~ I SYNAD/EOV ,IGC0005E I Synchronizing,. I SVC 55 I EOV Routine I I I. I CHECK Routines I I I ~------+------+------+------+------1 I FEOV I IGC0003A I Processing IFEOV Macro-I EOV Routine I I , I Program I Instruction I I , I I I (SVC 3D I I ~------+------+------+------+------~ I EOV/new volume I IGG0551A I EOV Routine IXCTL I See Executor I

,L ______~, ______~I ______~I ______i I ______Description JI

76 I' OPEN Routine " / OPEN Routine '\ ~rite Output Labe./ "-Merge DCB/JFC~ Module Module ...t.. IGG0191A Construct DEB t Stage 1 IGG0191B IGG01911 IGG0191C Device Initiation Build Buffer Pools Dummy Data Set Stage 2 Stage 2 Executor Selection Executor Sel ect ion • •

IGGOI91J IGG0191R Normal Scheduling Chained Scheduling f---+ I-- - r-- Inout, Outin Inout, Outin

Direct-Access Storage

IGG0191D IGG0191K r--- Normal Scheduling f---+ Chained Scheduling IGG0191E Direct-Access Storage Direct-Access Storage -- Exchange Bufferi ng

IGG0191G ~ Magnetic Tape, - Normal Scheduling IGG0191Q Direct-Access Storage Chained Scheduling IGG0191L Unit Record, ----.: Input Stage 2 Magnetic Tape, f---+ Unit Record,. Create-BDAM f-----..; Paper Tape --- (WRITE-LOAD) f----. Magnetic Tape IGG0191F Inout, Outin - Magneti c Tape Exchange Bufferi ng IGG0191M Exchange Buffering IGG0191H ~ Magnetic Tape, Create":BDAM --0.1 Unit Record Track Overflow Direct-Access Storage - (WRITE-LOAD) Output Track Overflow <1 a IGG0191P Update L..-., Update and Track Overflow

IGG01912 IGG01910 IGG01913 IGG01914 Update Track Overflow (None of the other) Exchange Bufferi ng Paper Tape Chained Scheduling Stage 3 • • IGG01911 I QSAM I _t..

L OPEN-. Routine" "- Final Module ) Figure 10. Flow of Control - SAM OPEN Executor

Sequential Access Method Executors 77 OPEN EXECUTORS • It computes the amount of main storage required for the data extent block (DEB), obtains the space, and enters The OPEN executors are grouped into the addresses of the extents. If no three. stages. Those in the first stage primary extent has been requested for receive control from the OPEN routine of an output data set, as shown by the I/O support. These executors pass control value in the field DS1NOEPV in the data to one of the stage 2 executors, or return set control block (DSCB), the executor control to the OPEN routine. The stage 2 sets the DCBCINDl field to show a executors in turn, pass control to the volume-full condition. stage 3 executors, or return control to the OPEN routine. Stage 3 executors return • It specifies in the WTG table that control to the OPEN routine. Before relin­ executor IGG0191B is the next executor quishing control, each executor specifies required for this DCB. It then search­ the next executor to be called for the data es the WTG table to pass control to set being opened, and also examines the another executor. For executor where-to-go (WTG) table to determine wheth­ IGG0191A, this is always executor er other data sets being opened at the same IGG0191B. time need its services. (For a description of the WTG table refer to the publication IBM System/360 Operating System: Table 24. OPEN Executor Selector Input/Output Support, Program Logic Stage 1 OPEN Executors Manual. ) r------T------, I I I Figure 10 shows the executors that com­ I Access Conditions I Selection I pose the three stages., and their relation­ I I I ship. ~------+-----T-----T-----1 I Actual data set I X I X I I .------+-----+-----+-----1 I Buffer Pool Required I I X I I STAGE 1 OPEN EXECUTORS .------+-----+-----+-----1 I Dumny data set I I I X I ~------+-----+-----+-----1 Stage 1 OPEN executors construct data I I I I I extent blocks (DEB) and buffer pools. I Executors I I I I There are separate executors for actual I I I I I data sets and for dummy data sets. The .------+-----+---~-+-----1 executor for actual data sets consists of I IGGOl91A I X I X I I three modules and passes control to a stage I and IGG0191B I I I I 2 executor (via an XCTL macro-instruction); ~------+-----+-----+-----1 the executor for dummy data sets consists I IGGOl91C I I I X I of one module and returns control to the .------+-----+-----+-----1 OPEN routine. Either executor receives IL ______and IGG01911 L I _____L I _____X LI _____ JI control from the OPEN routine by being identified in the WTG table and being loaded into the supervisory transient area. On conclusion of all stage 1 executors' processing, the last enters in the WTG Stage 1 OPEN Executor IGG0191B table the identification of the stage 2 executor that is required. Table 24 lists the access conditions that cause different Executor IGG0191B is always loaded after stage 1 executors to be selected, loaded., executor IGG0191A has completed processing and to receive control after loading. all entries in the WTG table.

The executor operates as follows: stage 1 OPEN Executor IGG0191A • It receives control after it is loaded.

Executor IGG0191A receives control from • If the device type is direct-access the OPEN routine, unless the DD statement storage, it determines the first Seek is DUMMY. (If the DD statement is DUMMY, address and enters it in the DCBFDAD executor IGG0191C receives control from the field. OPEN routine.) • If the DCB is opened for MOD, it copies The executor operates as follows: the contents of the DS1TRBAL field of the DSCB into the DCBTRBALfield of the • It receives control after it is loaded. DCB.

78 • If the DCB is opened for input and the dummy data set. For a dummy input data data set control block (DSCB) shows set, the module passes control to the that the data set contains no data, it user's EODAD routine; for a dummy output sets the DCBCINDl field to show a data set, the module returns control to the volume-full condition. For example, processing prograrr, irrmediately, without for an error log pata set without scheduling any I/O operation. entries the DSCB field DS1LSTAR (which contains the value TTR) has an entry of TTR=O. Stage 1 OPEN Executor IGG01911 • If this or the preceding executor sets a vOlume-full indication in the DCB, the executor sets the IOBFLAGl field Executor IGG01911 is loaded after execu­ (and the ICBFLAGl field, if chained tor IGG0191B if the OPEN executor must scheduling is used) to show an end-of­ build buffer pools. volume condition. The executor operates as follows:

• If the device is a printer with the • It receives control after it is loaded. universal character set (UCS) feature, the executor constructs a channel • If the values in both the DCBBUFL and program to prevent (block) or to allow DCBBLKSI fields are zero, the executor (unblock) data checks for the printer, passes control to the ABEND routine. and issues an EXCP macro-instruction for it. (The lOB, DEB, and DCB located • If the value in either the DCBBUFL or in the work area of the OPEN routine DCBBLKSI field is not zero, the execu­ are used to schedule and execute the tor uses that value to establish the channel program.) size of the buffer. The value in the field DCBBUFNO determines the number of buffers constructed. • If a buffer pool is to be built, as shown by entries in the DCBBUFNO or • It specifies in the WTG table the stage DCBBUFCB fields, the executor specifies 2 executor required for this DCB. It in the WTG table that executor IGG01911 then searches the WTG table to pass is the next executor required for this control to another executor. DCB. It then searches the WTG table to pass control to another executor.

• If no buffer pool is to be built, the STAGE 2 OPEN EXECUTORS executor specifies in the WTG table the stage 2 executor required for this DCB. It then searches the WTG table to pass A stage 2 OPEN executor establishes control to another executor. device oriented information for the proc­ essing described by a DCB, and completes device oriented control blocks or fields. One of the stage 2 executors receives control for each DCB being opened; the WTG Stage 1 OPEN Executor IGG0191C (and Dummy table identifies the executor required for Data Set Module IGG019AV) each DCB. On conclusion of an executor's processing it enters in the WTG table the identification of the stage 3 executor Executor IGG0191C operates as follows: required. Table 25 lists the access condi­ tions that cause the different stage 2 It receives control from the OPEN rou­ executors to be loaded and to receive tine if the DD statement is DUMMY, and control. loads module IGG019AV. Dumrry data sets require only this executor; if no other The device oriented processing performed data sets are being opened, control returns by a stage 2 executor primarily consists of to the OPEN routine~ the construction of input/output blocks

Sequential Access Method Executors 79 Table 25. OPEN Executor Selector - Stage 2 OPEN Executors r------T------, I I I I Access Conditions I Selection I I I I ~------+---T---T---T---T---T---T---T---T---T---T---T---T---T---T---~ I BSAM or I X~I I I I X~I X I X~I X I X~I X I X I X~I X~I X~I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ I QSAM I X~I X I X I X I X~I I X~I I X~I I I X~I X~I X~I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ 1 Input or I X21 X 1 I X21 I I I I X21 I I I I 1 I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ I output I X2 I I X I X2 I I I I I X21 1 I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+~--+---+---+---~ I Inout, Outin I I I I I I X I I X I I I I I I I X I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ I Update I I I I I I I I I I I I X I X I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ I Unit Record I I I I X I X41 I I I I I I I I X51 I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ I Magnetic Tape I I X31 X31 I X41 X I I I I I I I I X51 I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ I Paper Tape I I I I I X41 I I I I I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+~--+---+---~ I Direct-Access Storage I X I X31 X31 I I I I X I X I I I I I I I ~------+---+---+---+---+--~+---+---+---+---+---+---+---+---+---+---~ I WRITE-LOAD

80 Stage 2 OPEN Executor IGG0191D is substitute, simple buffering is sub­ stituted for exchange buffering. Therefore, it identifies (in the WTG Executor IGG0191D receives control after table) executor IGG0191D (if the device executor IGG0191B or IGG01911 if the OPEN type is direct-access storage) or exe­ parameter list specifies: cutor IGG0191G (if the device-type is unit record) as the executor required - Input or Output next for this DeB. It then searches the WTG table to pass control to anoth­ and the DeB specifies: er executor. - Direct-access storage device • It identifies the end-of-block routine to be used in the processing specified - BSAM, or QSAM and simple buffering by the DeB, and obtains space for and constructs lOBs and channel programs and links them. (but neither Update, nor track overflow, nor chained channel-program scheduling is • If the device is direct-access storage, specified). It may also receive control it copies the starting Seek address after executors IGG0191E, IGG0191F, or from the DeB into the lOB. IGG019lK. • It specifies in the WTG table that executor IGG01914 is the next executor The executor constructs lOBs and channel required fer this DeB. It then search­ programs and places the address of the es the WTG table to pass control to first lOB into the DeB. another executor.

The executor specifies in the WTG table that executor IGG01910 is the next executor required for this DeB. It then searches Stage 2 OPEN Executor IGG0191F the WTG table to pass control to another executor. Executor IGG0191F receives control after executor IGG0191I if the OPEN parameter list specifies: stage 2 OPEN Executor IGG0191E - Output and the DeB specifies: Executor IGG0191E receives control after executor IGG0191B or IGG01911 if the OPEN - Exchange buffering parameter list specifies: - Magnetic tape, or direct-access storage - Input (but not track overflow). The executor is and the DeB specifies: loaded, and gains control, when its iden­ tification in the WTG table is found by - Exchange buffering another executor. - Magnetic tape, or direct-access storage The exeoutor operates as follows: • It receives control after it is loaded. (but not track overflow). The executor is loaded, and gains control, when its iden­ • If the operating mode is move, or the tification in the WTG table is found by record format is variable-length another executor. blocked, or the record-format is variable-length and the operating mode is substitute, simple buffering is sub­ The executor operates as follows: stituted for exchange buffering. Therefore, it identifies (in the WTG table) executor IGG0191D (if the device • It receives control after it is loaded. type is direct-access storage) or IGG0191G (if the device type is unit • If the operating mode is move, or the record or magnetic tape) as the execu­ record format is variable-length tor required next for this DeB. It blocked, or the record format is then searches the WTG table to pass variable-length and the operating mode control to another executor.

sequential Access Method Executors 81 • It identifies the end-of-block routine (but not Update). The executor is loaded to be used in the processing specified and gains control, when another executor by the DCB, and obtains space for and finds its identification in the WTG table. constructs lOBS and channel programs (If both track overflow and Update are and links them. specified, executor IGG0191P receives con­ trol. ) • It specifies in the WTG table that executor IGG01914 is the next executor The executor operates as follows: required for this DCB. It then search­ es the WTG table to pass control to • It receives control after it. is loaded. another executor. • It identifies the end-of-block routine and the direct-access NOTE/POINT rou­ tine to be used in the processing specified by this DCB. Stage 2 OPEN Executor IGG0191G • It obtains space for and constructs lOBs and channel programs for the maxi­ Executor IGG0191G receives control after mum number of segments possible. It executor IGG0191B or IGG01911 if: links the channel programs to the lOBs and the lOBs to one another. - The DCB specifies BSAM and either unit record, magnetic tape, or paper tape • It specifies in the WTG table that executor IGG01913 is the next executor - The DCB specifies QSAM, simple buffer­ required for this DCB. It then search­ ing, and either unit record, magnetic es the WTG table to pass control to tape, or paper tape another executor. - The DeB spec1.fies QSAM, exchange buf­ fering, and unit record

- The OPEN parameter is Inout or Outin Stage 2 OPEN Executor IGG0191J and the DCB specifies magnetic tape Executor IGG0191J receives control after (but not if update, track overflow, or executor IGG0191B or IGG01911 if the OPEN chained channel-program scheduling is parameter list specifies: specified). It may also receive control after executors IGG0191E, IGG0191F, and - Inout or Outin IGG0191Q. and the DeB specifies:

The executor constructs lOBs and channel - Direct-access storage. programs and places the address of the first lOB into the DeB. The executor constructs lOBs and channel programs (including a portion for write­ check, if it has been specified), and puts The executor specifies in the WTG table the address of the first lOB into the DeB. the next executor required for this DCB. If the DCB specifies exchange buffering, the next executor is IGG01914. If the DCB The executor specifies in the WTG table specifies paper tape, the next executor is that executor IGG01910 is the next executor IGG01912. For the remaining access condi­ required for this DCB. It then searches tions that cause this executor to be used, the WTG table to pass control to another the next executor is IGG01910. The execu­ executor. tor then searches the WTG table to pass control to another executor.

Stage 2 OPEN Executor IGG0191K Stage 2 OPEN Executor IGG0191H Executor IGG0191K receives control after executor IGG0191B or IGG01911 if the DCB Stage 2 OPEN executor IGG0191H receives specifies: control after executor IGG0191B or IGG0191I, if the DCB specifies: - Chained channel-program scheduling

- Track overflow - Direct-access storage.

82 It is loaded and receives control when Stage 2 OPEN Executor IGG0191M another executor finds its identification in the WTG table. Stage 2 OPEN executor IGG0191M con­ structs channel programs to write track The executor operates as follows: overflow blocks using BSAM for a data set to be later processed by BDAM. Executor • It receives control after it is loaded. IGG0191L identifies it in the WTG table as its successor executor if the DCB speci­ • If the NOTE/POINT macro-instruction is fies: used, the executor identifies direct access NOTE/POINT module IGG019BK to be - Create-BDAM (WRITE-LOAD) lOaded for use with this DCB. - Track overflow.

• It identifies the end-of-block routine to be loaded and used for the It is loaded and gains control when another processing described by this DCB. executor finds its identification in the WTG table.

• It obtains space for, and constructs, one lOB, the required number of ICBs The executor operates as follows: (that is, one ICB per channel program or buffer), and their associated chan­ • It receives control after it is loaded. nel programs, and then links them.

• If the extents are smaller than the • It specifies in the WTG table that blocks, it passes control to the ABEND executor IGG01913 is the next executor routine. required for this DCB. It then search­ es the WTG table to pass contrcl to another executor. • It constructs channel programs to write the number of segments required by the size of the block.

Stage 2 OPEN Executor IGG0191t • It specifies in the WTG table that OPEN executor processing is completed for this DCB. It then searches the WTG Executor IGG0191L receives control after table to pass control to another execu­ . executor IGG0191B or IGG01911 if the DCB tor. If the WTG table has no other specifies: entries, the executor returns control to the OPEN routine. - Create-BDAM (WRITE-LOAD). The executor constructs lOBs and enters the address of the first lOB into the DCB. If Stage 2 OPEN Executor IGG0191P track overflow is not specified, the execu­ tor also builds channel programs. (If track overflow is specified, channel pro­ Stage 2 OPEN executor IGG0191P receives grams are built by executor IGG0191M.) control after executors IGG0191B or This executor also loads the Create-BDAM IGG0191I if the OPEN parameter list spec i- WRITE and CHECK routines, and inserts their fies: addresses into the DCB. - Update Unlike other stage 2 executors that (whether or not track overflow is also cause control to pass to a stage 3 execu­ specified). It is loaded and receives tor, this one indicates in the WTG table control when another executor finds its that OPEN executor processing for this DCB identification in the WTG table. is completed, unless track overflow is specified.

Sequential Access Method Executors 83 • If the NOTE/POINT macro-instruction is • It obtains space for, and constructs, specified, it identifies module one lOB, the required number of ICBs IGG019BC as the NOTE/POINT routine to (one per buffer or channel program), be loaded for use with this DCB. and channel programs appropriate to the device, and links them. • It obtains space for, and constructs, lOBs and channel programs to empty and refill each buffer. For QSAM, the • It specifies in the WTG table that executor links the channel programs so executor IGG01913 is the next executor that a buffer may be either refilled required for this DCB. It then search­ only (by executing only the second half es the WTG table to pass control to of the channel program) or may be another executor. emptied and refilled (by executing the channel program from the beginning).

• It specifies in the WTG table that Stage 2 OPEN Executor IGG0191R executor IGG01912 is the next executor required for this DCB. It then search­ es the WTG table to pass control to OPEN executor IGG0191R receives control another executor. after executors IGG0191B or IGG0191I if the OPEN parameter list specifies: - Inout, or Outin stage 2 OPEN Executor IGG0191Q and 'the DCB specifies: - Chained channel-program scheduling. Executor IGG0191Q gains control after executors IGG0191B or IGG01911 if the DCB specifies: The executor is loaded and receives control when another executor finds its identifi­ - Chained channel-program scheduling cation in the WTG table. - Unit record, magnetic tape. The executor operates as follows: It is loaded and receives control when another executor finds its identification • It receives control after it is loaded. in the WTG table.

• If the device is direct-access storage, The executor operates as follows: it identifies NOTE/POINT module IGG019BK to be loaded for use with the • It receives control after it is loaded. DCB.

• If the DCB specifies the CNTRL macro­ instruction this executor identifies • If the device is maqnetic tape, it executor IGG0191G in the WTG table as identifies NOTE/POINT module IGG019BL the next executor to receive control to be loaded for use with the DCB. for this DCB. It then searches the WTG table to pass control to another executor. • It identifies the end-of-block routine to be loaded for use with the DCB. • If the NOTE/POINT macro-instruction is specified and the device is magnetic tape, it identifies module IGG019BL to • It obtains space for, and constructs, be loaded for use with the DCB. cne lOB, the required numcer of ICBs (one per buffer or channel program), • If the NOTE/POINT macro-instruction is and channel programs for direct-access specified, and the device is unit storage or magnetic tape, and links record, it identifies dummy data set them. module IGG019AV to be loaded and used in place of NOTE/POINT. • It specifies in the WTG table that executor IGG01913 is the next executor • It identifies the end-of-block routine required for this DCB. It then search­ to be loaded and used for the process­ es the WTG table to pass control to ing described by this DCB. another executor.

84 STAGE 3 OPEN EXECUTORS • It enters the address of the routines into the DCB, and the address of appendages into the DEB appendage A stage 3 executor identifies and loads table. the modules needed to perform the process­ ing described by the DCB.. If QSAM is used, • It enters the identification of ~ach and an input data set is to be processed, a routine loaded, into the DEBSUBID field second stage 3 executor also primes the of the DEB. buffers. Table 26 lists the access condi­ tions that cause the different stage 3 • If QSAM is used, the executor specifies executors to be loaded and to gain control. in the WTG table that executor IGG01911 is the next executor required for this DCB. It then searches the WTG table to Table 26. OPEN Executor Selector - Stage 3 pass control to another executor. OPEN Executors r------T------, • If BSAM is used, the executor specifies I I I in the WTG table that OPEN executor I Access Conditions I Selection I processing is completed for this DCB. I I I It then searches the WTG table to pass ~------+--T--T--T--T--T--T--1 control to another executor. If the IPaper Tape IX I I I I I I I WTG table has no other entries, the ~------+--+--+--+--+--+--+--~ executor returns control to the OPEN I Upda te I I X I I I I I I routine. ~------+--+--+--+--+--+--+--1 IChained Scheduling I I IX I I I I I ~------+--+--+--+--+--+--+--~ IExchange Buffering I I I IX I I I I Stage 3 OPEN Executor IGG01911 ~------+--+--+--+--+--+--+--~ ITrack Overflow I I I I IX I I I ~------+--+--+--+--+--+--+--~ Executor IGG01911 is entered from execu­ INone of the preced- I I I I I IX I I tors IGG01910, IGG01912, IGG01913 and I ing I I I I I I I I IGG01914 if the DeB specifies: ~------+-~+--+--+--+--+--+--~ I QSAM I I I I I I IX I - GET, or PUT. ~------+--i--i--i--i--i--i--~ I I I This executor operates as follows: I Executors I I I I I • It completes any remaining DCB fields. ~------+--T--T--T--T--T--T--~ I IGG01910 I I I I I IX I I • It completes the lOBs. ~------+--+--+--+--+--+--+--~ I IGG01911 I I I I I I I X I • For input it issues a BALR instruction ~------+--+--+--+--+--+--+--~ to pass control to the end-of-block I IGGOl912 I X I X I I I I I I routine identified by a stage 2 execu­ ~------~------+--+--+--+--+--+--+--~ tor and loaded by one of the other I IGG01913 I I IX I IX I I I stage 3 executors. The end-of-block ~------+--+--+--+--+--+--+--1 routine issues an EXCP macro­ LI ______IGG01914 iI __i I __i I __ iIX __ iI __ iI __ iI __ JI instruction to prime the buffers. • It searches the WTG table to pass control to another executor. If the WTG table has no other entries, the Stage 3 OPEN Executor IGG01910 executor returns control to the OPEN routine.

Executor IGG01910 receives control after executor IGG0191D or IGG0191J. It also Stage 3 OPEN Executor IGG01912 receives control after executor IGG0191G unless the DCB specifies paper tape. Executor IGG01912 is entered from executor IGG0191P, and also frOID executor This executor operates as follows: IGG0191G if the OPEN parameter is: • It identifies and loads the device­ - Update independent routines. or if the DCB specifies: • It loads the device-dependent routines identified by a mask set in stage 2. - Paper Tape.

Sequential Access Method Executors 85 The executor operates as follows: • A READ or WRITE routine • A CHECK routine • It identifies and loads the device­ • A routine to serve the NOTE/POINT independent routines. macro-instruction if it is speci­ fied • It loads the device-dependent routines. and specifies in the WTG table that OPEN executor processing is completed for this DeB. • It enters the addresses of the routines into the DeB, and the address of the • It identifies and loads all the paper tape appendage into the appendage appendages required and places their vector table. addresses into the appendage vector table. • If QSAM is used, the executor specifies • It loads the end-of-block routine iden­ in the WTG table that executor IGG01911 tified by a stage 2 executor and places is the next executor required for this its address into the DeB. DCB. It then searches the WTG table to pass control to another executor. • It searches the WTG table to pass control to another executor. If the WTG table has no other entries, the • If BSAM is used, the executor specifies executor returns control to the OPEN in the WTG table that OPEN executor routine. processing is completed for this DeB. It then searches the WTG table to pass control to another executor. If the WTG table has no other entries, the executor returns control to the OPEN routine. Stage 3 OPEN Executor IGG01914

Executor IGG01914 receives control after executor IGG0191E, IGG0191F, and IGG0191G Stage 3 OPEN Executor IGG01913 if the DCB specifies: - Exchange buffering. Executor IGG01913 receives control after executor IGG0191H, IGG0191K, IGG0191Q, and It is loaded and receives control when IGG0191R, if the DeB specifies: another executor finds its identification in the WTG table.

- Chained channel-program scheduling, or The executor operates as follows: track overflow. • It receives control after it is loaded. It is loaded and receives control when another executor finds its identification • If the access conditions specified are: in the WTG table. output and locate, or Input and move, or The executor operates as follows: Input, locate, and variable-length • It receives control after it is loaded. it specifies in the WTG table that executor IGG01910 is required for this • If QSAM is specified, it identifies, DeB. loads, and places the address into the DeB of: It then searches the WTG table to pass control to another executor. • A GET or a PUT routine • A synchronizing routine • It identifies, loads, and puts the address into the neB of: and specifies in the WTG table that executor IIG01911 is to receive control • A GET or a PUT routine next for this DeB. • A synchronizing rout~ne • If BSAM is specified, it identifies, and specifies executor IGG01911 in the loads, and places the address into the WTG table as the executor to receive DeB of: control next for this DCB.

86 • It identifies and loads all the appen­ • If both the OPEN parameter is output dages r~quired and places their and the DCB specifies puT, the executor addresses into the appendage vector issues a TRUNC and a PUT macro­ table. instruction to cause scheduling of the last buffer. On return of control, the • It loads the end-of-block routine iden­ executor awaits execution of the last tified by a stage 2 executor and places channel program. its address into the DCB.

• It searches the WTG table to pass • If all channel programs were executed control to another executor. without encountering either an end-of­ volume condition or a permanent error, the executor continues processing_

CLOSE EXECUTORS • If any of the preceding channel programs encountered either a permanent error Or an end-of~volume condition, There are two CLOSE executors. The the eXecutor specifies in the WTG table first one (IGG0201A) always receives con­ that executor IGG0201B is required for trol .if one of the sequential access meth­ this DCB. Depending on the remaining ods is used. The second one (IGG0201B) entries in the WTG table, it then receives control after executor IGG0201A if either processes another DCB, or passes QSAM was used with an output data set and a control to executor IGG0201B. channel program encountered an errOr condi­ tion while executor IGG0201A had CPU con­ trol. Control returns to the CLOSE routine • If either Output or PUT are not speci­ of I/O support when CLOSE executor process­ fied, the executor issues a PURGE ing is completed.. Table 27 shows the macro-instruction for any pending chan­ conditions that cause the two executors to nel programs. Note that when process­ gain control. ing under BSAM the CHECK routine assures execution of all channel pro­ grams. Table 27. CLOSE Executor Selector Ir------T------, I I • If output and either a DCBDSORG field I Access Conditions I selecti~n I value of PO, or WRITE or PUT with a DD I I I statement of the fOXlll (MEMBERNAME) are r------~------+-----T-----i specified, the executor issues a STOW ICLOSE macro-instruction I X I X I macro~instruction. On completion of ~------+-----+-----i the STOW routine, the executor tests IPermanent error orend-of- I I I for I/O errors and for logica,l errors, Ivolume condition when using I I X I such as insuf,ficient space in the IQSAM for output I I I directory. For either type of error, ~------+-----+-----i the executor issues an ABEND macro­ I I I I instru.ction with a code of hexadecimal I Executors I I I OB14. I I I I ~------+-----+-----i • If QSAMand simple buffering are speci­ I IGG0201A I X I x I fied, the executor returns the buffers ~------'-.,..------'-+-----+-----~ associated with the DCB to the buffer I IGG0201B I I X I control block pointed to by the address L______, ______,_---L-----J..-----J in the field DCBBUFCB. • The executor computes the amount of space occupied by the channel p:rograms, lOBs (and ICBs, if chained scheduling CLOSE EXECUTOR IGG0201A is used), and returns that space to the supervisor via a FREEMAIN macro­ instruction. Executor IGG0201A receiVeS control from the CLOSE routine of I/O support if the • The executor specifies in the WTG table DCBDSORG field specifies a value of PS or that CLOSE executor processipg is PO. completed for this DCB. Depending on the remaining entries in the WTG table, The executor operates as follows: it then either prOCesses another DCB, passes control to executor IGG0201B, or • It receives control after it is loaded. returns control to the CLOSE routines.

Sequential Access Method Executors 87 CLOSE EXECUTOR IGG0201B (ERROR PROCESSING) • The executor specifies in the WTG table that CLOSE executor processing is completed for this DCB. Depending on Executor IGG0201B receives control after the remaining entries in the WTG table, executor IGG0201A if the latter finds that the executor either proeesses another a channel program for an output data set DCB or returns control to the CLOSE using QSAM encountered a permanent error or routine. an end-of-volume condition. It is loaded and receives control when its identifi­ cation is found in the WTG table. SYNAD/EOV EXECUTOR IGC0005E (SVC 55) The executor operates as follows: Executor IGC0005E performs error- • It receives control after it is loaded. condition processing. If a synchronizing and error routine (in QSAt-J), or a CHECK • It determines whether a channel program routine (in BSAM), finds that the execution encountered a permanent error or an of a channel program encountered either a end-of-volume condition. perroanent error or an end-of-volume (EOV) condition, the routine issues an SVC 55 • If a channel program encountered a instruction. (The Update Synchronizing and permanent error, the executor performs Error Processing routine passes control to its rema1n1ng processing. Any buffers this executor only for an end-of-volume not written out are not processed. condition; the Paper Tape Synchronizing and Error Processing routine never passes • If a channel program encountered an control to this executor.) An SVC 55 end-of-volume condition, the executor instruction causes this executor to be finds the lOB associated with that loaded and to receive control. channel program and places its address into the DCBIOBA field. It then passes Control passes to and from this executor control to the Output synchronizing along three paths, depending upon whether routine for normal processing of the control was received due to an EOV condi­ end-of-volume condition. When control tion, due to a permanent error condition returns, the executor performs its and there is a SYNAD routine present, or remaining processing, unless one of the due to a permanent error condition and channel programs encountered a perman­ there is no SYNAD routine present. The ent error or another end-of-volume con­ flow of control under these three condi­ dition.. In either of those cases, it tions in QSAM is shown in Figure 11, for resumes processing as when it first BSAM, it is shown in Figure 12. received control. • If Output and either a DCBDSORG field For an EOV condition, the executor oper­ value of PO, or WRITE or PUT with a DD ates as follows: statement of the form (MEMBERNAME) are specified, the executor issues a STOW • It obtains a work area. macro-instruction. On completion of the STOW routine, the executor tests • It passes control to the end-of-volume for I/O errors and for logical errors, routine of I/O support. If that rou­ such as insufficient space in the tine finds a new volume, it eventually directory. For either type of error, passes control to EOV/new volume execu­ the executor issues an ABEND macro­ tor. After processing, the executor instruction with a code of hexadecimal returns control to the synchronizing OB14. and error processing or to the CHECK routine. • If QSAM and simple buffering are speci­ fied, the executor returns the buffers If there is no SYNAD routine present, associated with the DeB to the buffer the executor op~rates as follows for a control block pointed to by the address permanent error condition: in the field DCBBUFCB. • For QSAM, the executor implements the error options specified in the field • The executor computes the amount of DCBEROPT in the DCB. It returns con­ space occupied by the channel programs, trol to the synchronizing routine for lOBs (and ICBS, if chained scheduling the SKIP or ACCEPT option. is used), and returns that space to the supervisor via a FREEMAIN macro­ • For BSAM, the executor passes control instruction. to the ABEND routine.

88 5VC 55 51 Nl El 5ynchronizing 5YNAD/EOV Routine Executor --~ 55 (iGCOOO5E) 1T 56 I I 56(a) 54 53 52 N2 E2 53

User's 5YNAD EOV Routine of ABEND Routine ~ Routine 1/0 5upport I

E4 E3

EOV/New Volume Executor (iGG0551A)

Le gend:

5 5YNAD Routine Present } Permanent Error Condition N No 5YNAD Routine Present E End-oF-Volumne Condition (a) Alternate Path For TERMINATE Option ~Described in This Publication

Figure 11. Flow of Control To and FrOID the SYNAD/EOV Executor (IGC0005E) in QSAM

5VC 55 51 Nl El 5YNAD/EOV ~ CHECK Executor r---1 Routine r 55 (I GC0005E) 1T 56 I I 54 53 52 E2 N2

User's sYNAD EOV Routine of ABEND Routine ~ Routine I 1/0 Support I I

E4 E3

EOV/New Volume Executor (lGG0551A)

Legend: 5 5YNAD Routine Present N No SYNAD Routine Present I Permanent Error Condition E End-oF-Volume Condition ~ Described in This Publication

Figure 12. Flow of Control To and FrOID the SYNAD/EOV Executor (IGC0005E) in BSAM

sequential Access Method Executors 89 If there is a SYNAD routine present, the For an input data set, processed under executcr operates as follows for a perman­ QSAM or BSAM, the executor operates as ent error condition: follows: • For QSAM, the executor returns control • It receives control when the processing to the synchroni~ing routine. (The program uses an FEOV macro-instruction. synchronizing routine then passes con­ trol to the user's SYNAD routine. • It obtains a work area by means of a After error processing, the user's GETMAIN macro-instruction. SYNAD routine may return control to the synchronizing routine. The synchroniz­ • It prevents the execution of any pend­ ing routine issues a second SVC 55 ing channel programs by means of the instruction to pass control to this PURGE macro-instruction. executor.> • It passes control, and the work area, • For QSAM, the executor then implements to the end-of-volume routine of I/O the error option and returns control to support by means of an XCTL macro­ the synchronizing routine (for the SKIP instruction. or ACCEPT option).

• For BSAM, the executor returns control For an output data set processed under to the CHECK routine. (The CHECK rou­ BSAM, the executor operates as follows: tine passes control to the user's SYNAD routine. A return of control from the • It receives control when the processing SYNAD routine to the CEECK routine in program uses an FEOV macro-instruction. BSAM is interpreted as an ACCEPT error option. The CHECK routine issues a second SVC 55 instruction to pass con­ • It obtains a work area by means of a trol to this executor again.) GETMAIN macro-instruction.

• For BSAM, the executor then implements the ACCEPT error option and returns • It passes control, and the work area, control to the processing prograrr. to the end-of-volume routine of I/O support by means of an XCTL macro- The executor implements error options in instruction. the following manner:

• For the TERMINATE error option, the For an output data set processed under executor passes control to the ABEND QSAM, the operation of the executor, and routine. the resultant flow of control, depends on the operating rr,ode and how certain channel • For the ACCEPT error option, the execu­ programs execute. The operation and flow tor issues EXCP macro-instructions to of ccntrol for each possible combination of reschedule all channel programs except mode and channel program execution is the one executed with an error. If the described in detail in Appendix E. device is a printer all channel pro­ gra~s are rescheduled. In general, assuming normal execution of • For the SKIP error option, the executor all channel programs, the executor operates issues EXCP macro-instructions to res­ as follows: chedule all channel programs, including the one executed with an error. • It receives control when the processing program uses an FEOV macro-instruction.

• It obtains a work area by means of a GETMAIN macro-instruction. FEOV EXECUTOR IGC0003A (SVC 31) • It passes control to the PUT routine to cause scheduling of the present buffer Executor IGC0003A causes reading or for output. writing to be discontinued for the balance of the present volume and permits the • It awaits execution of all pending processing program to start reading or channel programs. writing a new volume. The FEOV (force-end-of-volume) . macro-expansion • It passes control, .and the work area, includes an SVC 31 instruction that causes to the end-of-volume routine of I/O this executor to be loaded and to gain support by means of an XCTL macro­ control. instruction.

90 EOV/NEW VOLUME EXECUTOR IGG0551A • It issues BALR instructions to pass pending channel programs to the end-of­ block routine to have them scheduled Executor IGG0551A schedules, for for execution. (If Create-BDAM execution with the new volume, any channel WRITE-LOAD is specified, control pass prograflls not executed with the old voluflle. es to the Create-BDAM WRITE routine.> The end-of-volume routine of I/O support issues an XCTL macro-instruction to pass control to this executor after the routine • It issues a FREEMAIN macro-instruction has caused the mounting of the next volume for the work area obtained for the of the input data set; for an output data end-of-volume routine. set, the routine passes control to this executor after the routine has fIlounted a new volume, or acquired additional space on • It returns control to the routine that the current volume. passed control to the end-of-voluflle routine via the SVc 55 instruction. The executor operates as follows: For a normal end-of-volume condition found by a synchronizing or CHECK rou­ • It receives control when the next, new, tine, control returns to the synchron­ or more volume is available. ~z~ng or CHECK routine. For a forced end-of-volume condition established by • It resets all indications of the end­ an FEOV macro-instruction in the proc­ of-volume condition in the DCB. essing program, control returns to the processing program. For an end-of­ • If the device type is direct-access, volume condition arising during the the executor inserts the new full FEOV executor, control returns to the device address (FDAD) into the DCB and FEOV executor. the lOB.

Sequential Access Method Executors 91 BUFFER POOL MANAGEMENT

Buffer pool management routines form • It chains the first buffer to the main storage space into buffers, and they buffer pool control block and deter­ return buffers that are no longer needed. mines the start of the next buffer by There are five buffer pool management adding the rounded buffer length value routines: te the address of the first buffer. The module chains the next buffer to • GETPOOL This routine obtains main the preceding buffer, and continues storage and forms a buffer pool. until all the buffers have been chained. • BUILD - This routine forms a buffer pool in main storage supplied by the • It returns control to the processing processing program. program.

• GETBUF - This routine provides buffers Figure 13 illustrates the buffer pool from the buffer chain. control block (BUFCB) that describes the buffer peol. Figure 14 illustrates the • FREEBUF - This routine returns buffers buffer pool structures formed by the to the buffer pool. GETPCCL Irodule.

• FREEPOOL - This routine returns main storage previously used for a buffer pool. BUFAD BUFl Address of Length of BUFCB First Avoilable Buffer Each Buffer Byte 0 4 6 8 GETPOOL MODULE IECQBFG1 Figure 13. Buffer Pool Control Block Module IECQBFGl obtains main storage space and forms it into buffers. It is loaded at execution time by a LINK macro­ instruction. Double-Word Full-Word (Not-Double-Word) Buffer Alignment Specified Buffer Alignment Specified The module operates as follows: BUF B BUFCB • It rounds the buffer length to the next higher double-word multiple if the specified length is not such a multi- pIe. • It determines buffer alignment from the DCEBUFAL field value in the DCB. --2 Words-

• It computes the number of bytes Figure 14. GETPOOL Buffer Pool Structures required and issues a GETMAIN macro- instruction. • It constructs a buffer pool control block in the first eight bytes of storage obtained. BUILD MODULE IECBBFB1

• If double-word (not-full-word) align­ ment is specified in the DCBBUFAL field Module IECBBFBl forms main storage space in the DCB, the module starts the first supplied by the processing program into buffer at the byte immediately buffers. It is loaded at execution time by following the BUFCB. a LINK macro-instruction.

• If full-word (not-double-word) align­ The module operates as follows: ment is specified in the DCBBUFAL field, the module skips one word after • It rounds the buffer length to the next the buffer pool control block before higher full-word multiple ·if the speci­ starting the first buffer. fied length is not such a multiple.

92 • It constructs a buffer pool control Table 28. BUILD Buffer Structuring Table block in the first eight bytes of the ffiain storage space provided by the Parity of N umber of Alignment of First Byte of Words in Buffer Length Buffer processing program. Space Passed in after Rounding Up Pool BUI LD Macro-Instruction Length Parameter of Structure • It starts the first buffer at the byte BUILD Macro-Instruction imffiediately following the buffer pool Even A Double - Word control block. Odd B Full - Word Even C • It chains the first buffer to the (Not - Double - Word) buffer pool control block and deter­ Odd D mines the start of the next buffer by adding the rounded buffer length value to the address of the first buffer. The module chains the next buffer to the preceding buffer, and continues until all the buffers are chained.

• It returns control to the processing program.

Table 28 lists for each possible combi­ -0- nation of space alignment and buffer length parity the illustration that shows the structure of the resulting buffer chain or pool. Figure 13 illustrates the buffer pool control block (BUFCB), Figure 15 D illustrates the various buffer alignrrents BUFCB- BUFCB- that the BUILD module forms. BUFCB

, ---' GETBUF MACRO-EXPANSION

The purpose of this coding is to provide -0- the next buffer from the buffer pool. The macro-expansion produces in-line code that _____-0- ...J, presents the address of the next buffer to the processing program and updates the buffer pool control block to point at the -2words --- following buffer. Figure 15. BUILD Buffer Pool Structures

FREEPOOL MACRO-EXPANSION FREEBUF MACRO-EXPANSION The purpose of this coding is to return The purpose of this coding is to return the space previously allotted to the buffer a buffer to the buffer chain. The macro­ chain to available main storage. The expansion produces in-line code that stores macro-expansion produces in-line code that the address presently in the buffer pool computes the total number of bytes to be control block in the first word of the returned, issues a FREEMAIN macro­ buffer being returned, and then stores the instruction, and sets the DCBBUFCB field in address of that buffer in the buffer pool the DCB to show that no buffer pool is control block. associated with that DCB.

Buffer Pool Management 93

APPENDIX A: DECISION TABLES

These decision tables show the routines available and the access conditions that cause a routine to be used. They duplicate the decisicn tables in the text in tatle number, form, and content. A table that occupies a whole page rray be out of sequence.

Table 2. Module Selector - Simple Buffering GET Modules r------T------, I' I I Access Conditions I Selections I I I I ~------+---T---T---T---T---T---T---T---T---T---T---T---T---T---~ IINPUT, GET, Simple Buffering I X I X , X I X I X I X I X I X I X I I I I 'X, ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ IRDBACK, GET, Simple Buffering' , I I , I I I , I X I X I X I X I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ ,Locate operating mode I X I X I X I I , I I I I X I X I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ IMove operating mode I I I I X I X I X I X I X I X I , 'X, X I X , ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ IFixed-length record format I X, , I X, , I X I I I X, 'X, , I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ ,Undefined-length record format, 'X, , 'X, , 'X I , I X, 'X I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ 'Variable-length record format, I I X I I I X I , 'X, I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ ICard reader, I , , , , I I I I , I I I , I lonly a single buffer, CNTRL I I I I I I I X I X I X I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ ICharacter conversion for i I I I I I , , I I , , , I I Ipaper tape I , I I , , , I I I I , , I X I ~------+---~---+---+---~---+---+---~---+---+---~---+---~---+---~ , I 'I 'I I I I " , GET Modules , I' " " , 'I I I I I I I 'I I I I ~------"------+---T---+---+---T---+---+---T---+---+---T---+---T---+---~ I IGG019AA , X , X I I I , I I , , , I , , I ~------~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ I IGG019AB I I I X I I I I I , I I , , , I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---i , IGG019AC I' , 'X I X I , , I I , I I I , ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ I IGG019AD , I , I I 'X I I , , i , , , I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ , IGG019AG I I , I , I I X , X I I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGG019AH , I , , I I , , I X I , , , I I ~------+---+---+---+---+---+-~-+---+---+---+---+---+---+---+---i , IGG019AM , , I I I , , I I 'X, X, I I , ~------~---+---+---+---+---+---t---+---+---t---+---+---+---+---+---~ I IGG019AN 'I , I I I I I I , I 'X I X, I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---~ I IGG019AT1. 'I I I I , , I I I , I I 'X I ~------~---~---~---~---~---~---~---~---~---~---~---~---~---~---~ I1.This module also. includes the Paper Tape Character Conversion Synchronizing and , lIError ______Processing routine. JI

Appendix A: Decision Tables 95 Table 3. Module Selector - Exchange Table 5. Module Selector - Simple Buffer- Buffering GET Modules ing PUT Modules r------T------, r------T------, I I I I I I I Access Conditions I Selections I I Access Conditions ISelections I I I I I I I ~------+--T--T--T--T--T--T--~ ~------+-T-T-T-T-T-~ I Input, GET, ExchangelX IX IX IX IX IX IX I IOutput, PUT/PUTX, Simple IXIXIXIXIXIXI ~------+--+--+--+--+--+--+--~ I buffering I I I I I I I I Locate IX IX IX IX I I I I ~------·------+-+-+-+-+-+-i ~------+--+--+--+--+--+--+--~ ILocate operating mode IXIXIXI I I I I Substitute I I I I IX IX IX I ~------+-+-+-+-+-+-i ~------+--+--+--+--+--+--+--~ IMove operating mode I I I IXIXIXI I Fixed-length IX IX I I IX I IX I ~------+-+-+-+-+-+-i ~------+--+--+--+--+--+--+--~ IFixed-length record format IXI I IXI I I I Variable-length I I IX I I I I I ~------+-+-+-+-+-+-i ~------+--+--+--+--+--+--+--~ IUndefined-length record I I I I I I I I Undefined-length I I I IX I IX I I I format I IXI I IXI I ~------+--+--+--+--+--+--+--~ ~------+-+-+-+-+-+-i I Unblocked I IX IX IX IX IX' I I IVariable-length record format I I IXI I IXI ~------+--+--+--+--+--+--+--~ ~------+-~-+-+-~-+-i I Blocked I X I I I I I I X I I I I I I I ~------+--+--~--~--+--~--+--~ I PUT Modules I I I I I I I I I I I I I I I I I I GET Modules I I I I I ~------+-T-+-+-T-+-i I I I I I I I IGG019AI IXIXI I I I I ~------+--+--T--T--+--T--+--~ ~------+-+-+-+-+-+-i I IGG019EA IX I I I I I I I I IGG019AJ I I IXI I I I ~------+--+--+--+--+--+--+--~ ~------+-+-+-+-+-+-i I IGG019EB I I X I X I X I I I I I IGG019AK I I I IXIXI I ~------+--+--+--+--+--+--+--~ ~------+-+-+-+-+-+-i

I IGG019EC I I I I IX IX I I LI ______IGG019AL i_~_i_~_~_~_JI I I I I IXI ~------+--+--+--+--+--+--+--~ I IGG019ED I I I I I I IX I L______~ __ ~ __ ~ __ ~ __ ~ __ ~ __ ~ __ J Table 6. Module Selector - Exchange Buf- fering PUT Modules r------T------, I I I I Access Conditions I Selections I Table 4. Module Selector - Update Mode GET I I I Module ~------+-T-T~T-T-T-T-i r------T------, I Output, PUT/PUTX Exchange IXIXIXIXIXIXIXI I I I ~------+-+-+-+-+-+-+-i I Access Conditions I Selections I IMove mode IXIXIXI I IXI I I I I ~------+-+-+-+-+-+-+-~ ~------+--T-T-T-T-i ISubstitute mode I I I IXIXI IXI IUpdate, GET IX IXIXIXIXI ~------+-+-+-+-+-+-+-i r------+--+-+-+-+-~ IUnblocked record format IXIXIXIXIXI I I IFixed-length record format IX IXI I I I ~------+-+-+-+-+-+-+-i ~------+--+-+-+-+-i IBlocked record format I I I I I IXIXI IVariable-length record format I I I X I X I I ~------+-+-+-+-+-+-+-i ~------+--+-+-+-+-~ IFixed-length record format IXI I IXI IXIXI IUndefined-length record format I I I I IXI ~------+-+-+-+-+-+-+-i ~------+--+-+-+-+-i IVariable-length record I IXI I I I I I I Blocked record f orrra t I X I I X I I I I format I I I I I I I I ~------+--+-+-+-+-~ ~------+-+-+-+-+-+-+-i IUnblocked record format I IXI IXIXI IUndefined-length record I I IXI IXI I I ~------+--i-~-i-~-i I format I I I I I I I I I I I ~------+-i-~-~-~-+-~-i I GET Module I I I I I I I I I I PUT Modules I I I ~------+--T-T-T-T-i I I I I I IGG019AE1. IX IXIXIXIXI ~------+-T-T-T-T-+-T-i ~------i--i-~-~-~-i I IGG019EE IXIXIXIXIXI I I I1.This module also carries the Update model ~------+-+-+-+-+-+-+-i I PUTX routine I I IGG019EF I I I I I IXIXI L ______J L______~_i_i_i_~_~_~_J

96 Table 7. Module Selector - Ordinary End­ Table 9. Module Selector Chained of-Block Modules Channel-Program Scheduling End­ r------T------, of-Block Modules I I I r------T------, I Access Conditions I Selections I I I I I I I I Access Conditions I Selections I ~------+-T-T-T-T-T-T-T-T-T-~ I I I INorroal channel- IXIXIXIXIXIXIXIXIXIXI ~------t-T-T-T-T-T-T-T-i Iprogram scheduling I I I I I I I I I I I IChained channel-prograro IXIXIXIXIXIXIXIXI ~------+-+-+-+-+-+-+-+-+-+-~ I scheduling I I I I I I I I I I Input, or I I I I XI X I X I I I I I ~---~------t-t-t-t-t-t-t-t-i ~------+-+-+-+-+-+-+-+-+-+-~ I Input IXIXI IXI I I I I I Update I I I XI I I I I I I I ~------t-t-t-+-t-t-t-t-i ~------+-+-+-+-+-+-+-t-t-t-~ I Output I I IXI IXIXIXIXI I Output, or I I I I I I IXI I I I ~------+-t-t-t-t-t-t-t-i ~------t-t-t-+-t-t-+-t-+-t-~ I Card reader I XI I I I I I I I I Inout,Outin I I I IXI IXIXI I I I ~------t-t-+-t-t-t-t-t-i r------t-t-t-t-t-t-t-+-t-t-~ IPrinter or card punch I I I I I IXIXIXI Icard reader or IXI I I I I I I I I I ~------t-t-+-t-+-t-t-t-~ Ipaper tape reader I I I I I I I I I I I I Magnetic tape I I XI XI I I I I I ~------t-t-t-t-+-t-t-t-+-+-~ ~------+-t-t-t-t-t-t-+-i IPrinter or card I I I I I I I IXIXIXI IDirect-access storage I I I IXIXI I I I Ipunch I I I I I , I I , I , ~------t-t-t-t-+-t-t-t-i ~------t-+-+-t-t-t-t-t-t-t-~ INO contrcl character I I I I I IXI I I IMagnetic tape I IXI I I I I I I I I ~------+-+-t-t-+-t-+-t-i ~------t-t-t-t-t-t-t-t-+-+-~ IMachine control character I I I I I I IXI I I Direct-access I I I I X I I XI XI I I I ~------+-t-+-t-t-t-+-t-~ I storage I I I I I I I I , I I IASA control character I I I I I I I IXI ~------t-t-t-+-t-t-t-t-t-+-~ ~------t-~-~-~-t-t-~-t-~ ITrack overflow I I I I IXI I I I I I I I I I I I ~------+-+-t-+-+-+-t-+-+-t-~ I End-of-Block Modules I I I I I IRecord forroat is I I I IXI I I I I I I I I I I I I ,not fixed-length I I I , I I I I I I I ~------t-T-T-T-t-t-T-t-~ I standard I I I I I I I I I I I I IGG019CV I I I I I X I I I I r------t-t-t-t-t-t-t-t-+-t-i ~------t-t-t-t-+-t-+-t-~ IRecord format is I I I I I IXI I I I I I IGG019CW IXIXIXIXI I I I I I fixed-length I I I I I I I I I I I ~------+-+-+-+-t-+-t-+-i I standard I I I I I I I I I I I I IGG019CX I I I I I IXIXI I ~------+-+-t-t-t-t-t-t-t-t-i ~------+-t-+-t-t-t-+-t-~

INo control I I I I I I , IXI I I LI ______IGG019CY ~_~_~_~_~_~_~_~_JI I I I I I I IXI I character I I I I I I I , I I I ~------t-t-t-+-t-t-t-t-t-t-~ I Machine control I I I I I , I I IXI , I character , I I , I I I I I I I ~------t-+-t-t-t-t-t-+-t-t-i IASA control I I I I I I I I I IXI I character I I I I I I I I I I I Table 10. Module Selector - Track Overflow ~------+-+-t-t-t-t-t-t-t-t-i End-of-Block Module IPRTOV-NO user exit I I I I I I I IXIXIXI r------T------, ~------t-~-~-~-~-t-~-t-~-t-i I I I I I I I I I I Access Conditions I Selections I I End-of-Block I I I I I I I I I Modules I I I I I ~------+------~ I I I I I I I Output, Inout, Outin I X I ~------t-T-T-T-T-t~T-t-T-t-i ~------+------~ I IGG019CC IXIXIXIXIXI I I I I I I Track Overf low I X I ~------t-t-t-t-t-t-t-t-t-t-~ ~------+------~ I IGG019CD I I I I I IXIXI I I I I I I ~------t-t-t-t-t-t-t-+-t-t-i I End-cf-Block Module I I I IGG019CE I I I I I I I IXIXI I , I I ~------t-t-+-t-t-t-t-t-+-t-~ ~------+------~

I IGG019C2 ~I X I LI ______IGG019CF ~_~_~_~_~_~_~_~_~_~_JI I I I I I I I I IXI L ______J

Appendix A: Decision Tables 97 Table 11. Module Selector - Synchronizing Table 14. Module Selector Control and Error Processing Modules Modules r------~------T------, r------T------, I I I I I I I Access Conditions ISelections I I Access Conditions ISelections I I I I I I I ~------+--T--T--T--~ ~------+-----T-----i IGET IX IX I IX I I CNTRL . I X , X , ~------+--+--+--+--~ ~------+-----+---~-i IPUT I , IX I I , Printer , X, , r------~------+--+--+--+--~ ~------+-----+-----i ,Input, Readback I IX I I I I Card Reader, " X , ~------+--+--+--+--~ , a single buffer , , , I output , I IX I I ~------+-----+-----i ~------+--+--+--+--~ I , I , I Update IX I I I I , Modules '" ~------+--+--+--+--i , , , , IPaper tape I , I IX' ~------~------+-----+-----i Icharacter conversion 'I I I I I IGG019CA , X I I ~------+--+--+--+--~ ~------+-----+-----i I I I I I I ,L ___~ ______IGG019CB .1." _____ .1. _____X J, I Modules , , I I I , I , I I I ~------+--+--+--+--i I IGG019AF IX I I , I ~------+--+--+--+--i Table 15. Control Routines That Are Macro- I IGG019AQ I IX I I I Expansions ~------+--+--+--+--i r------T------, I IGG019AR I I IX I I I " ~------+--+--+--+--i I I Number of , I IGG019AT1 I I I IX I , Macro-Instruction ,Macro- , ~------.------.1.--.1.--.1.--.1.--~ I , Expansions' 11This module includes both the paper tape I I I' I synchronizing and error processing I ~------+------i I routine and the paper tape GET routine. I I PRTOV - User exit ,1, , Both routines are described in the GETI ~------+------i ,L ______routines section of this publication. JI LI ______PRTOV - No user exit .1.I ______1 J,

Table 12. Module Selector - Track Overflow Asynchronous Error processing Module r------T------, I I I I Access Conditions I Selections I , I I ~------+-----T------i IGET , X I I ~------+-----+------i I READ , I X I ~------+-----+------i. IInput, Inout, outin I X I X I r------+-----+------i ITrack Overflow , X I X I ~------+-----+------i I , I I I Module I I I I I I I ~------+-----+------i IL ______IGG019Cl .1. I _____X .1.I ______X JI

98 Table 13. Module Selector - Appendages

Access Conditions Selections

Input, I nout, Outi n X X X

Readback X

Update X X X

Sysin X

GET X

READ X

Record format is fixed-length X

Record format is fixed-length blocked X

Record format is variable-length X

Record format is not fixed-length standard X

Direct-access storage X X

Printer X

Paper tape X

Chained scheduling X X

Track overflow X

Appendages

IGG019AW AW

IGG019BM 8M

IGG019CG CG

IGG019CH CH

IGG019CI CI

IGG019CJ CJ

IGG019CK CK

IGG019CL CL

IGG019CS CS

IGG019CU CU

IGG019CZ CZ

IGG019C3 C3

Exits

End-of-Extent AW BM CH CZ

510 CG CL

Channel End CI CJ CK CS CU

PCI CU

Abnormal End CU C3

Appendix A: Decision Tables 99 Table 11. Module Selector - READ and WRITE Table 18. Routine Selector CHECK Modules Routines r------T------, r------T------, I I I I I I IAccess Conditions I Selections I IAccess Conditions I Selections I I I I I I I ~------+--T--T--T--T--T--T--T--~ ~------+---T---T---T---T---~ I Input, or I X I I X I X I I I I I I Input or I X I I X I I I ~------+--+--+--+--+--+--+--+--~ ~------+---+---+---+---+---~ loutput, or I IX I I I IX IX IX I I Out put or I I X I I I I ~------+--+--+--+--+--+--+--+--~ ~------+---+---+---+---+---~ IInput, Outin IX IX I I I I I I I IInout, Outin I X I X I I I I ~------+--+--+--+--+--+--+--+--~ ~------+---+---+---+---+---~ I Update I I I I IX I I I I I upda te I I I I X I I ~------+--+--+--+--+--+--+--+--~ ~------+---+---+---+---+---~ I READ IX I IX IX IX I I I I I READ I X I I X I I I ~------+--+--+--+--+--+--+--+--~ ~------+---+---+---+---+---~ IWRITE I IX I I I I I I I I WRITE I I X I I I I ~------+--+--+--+--+--+--+--+--~ ~------+---+---+---+---+---~ IWRITE (LOAD) I I I I I IX IX IX I IWRITE (LeAD) I I I I I I I (Create-BDAM) I I I I I I I I I , (Create-BDAM) I I I I I X I ~------+--+--+--+--+--+--+--+--~ ~------+---+---+---+---+---~ I Paper tape 'I I X I X I I , I I I Paper tape I I I X I I I ,character I I I I I I , I , Icharacter conversion I I I I I I I conversion I' I I I , , I , ~------+---i---+---i---i---~ ~------+--+--+--+--+--+--+--+--~ I I I I I Fixed-length I' IX I I IX' 'X, I CHECK Modules I I I Irecord format I I I I I I , , I I I I I ~------+--+--+--+--+--+--+--+--~ ~------+---T---+---T---T---~ ,Undefined-length I I I IX I I IX, I I IGG019BB I X I X I I I I Irecord format or I I I I , I I I I ~------+---+---+---+---+---~ ~------+--+--+--+--+--+--+--+--~ I IGG019BG I I I X I I I I Variable-length I I I I I I IX' I ~------+---+---+---+---+---~ Irecord format I I I I I I I , I I IGG019BI I I I I X I I ~------+--+--+--+--+--+--+--+--~ ~------+---+---+---+---+---~ ITrack Overflow I I I I I I I IX I IL ______IGG019DC i I ___ iI ___ i, ___ iI ___ iI ___X JI ~------+--i--+--i--+--i--i--i--~ , READ, WRITE I I I , I Modules I I I I ~------+--T--+--T--+--T--T--T--~ I IGG019BA IX IX I I I I I , I ~------+--+--+--+--+--+--+--+--~ I IGG019BF I I IX IX I I I I I ~------+--+--+--+--+--+--+--+--~ I IGG019BH I I I , I X I I I I ~------+--+--+--+--+--+--+--+--~ I IGG019DA I I I I , IX I I I ~------+--+--+--+--+--+--+--+--~ I IGGO 19DB I I I I I , 'X I , ~------+--+--+--+--+--+--+--+--~ I IGG019DD I' I , , , I IX I L ______i __ i __ i __ i __ i __ i __ i __ i __ J

100 Table 19. Module Selector Control Table 20. Control Modules Loaded at Execu- Modules Selected and Loaded by tion Time the OPEN Executor r---T------T------T------, r------y------, I I Macro- I I I I I I ISVCIInstruc-1 Function IModule No.1 I Access Conditions I Selection I INo·1 tion I I I I I I ~---+------+------+------~ ~------+-T-T-T-T-T-T-~ 125 I (none) I Establish I IGC0002E I I NOTE/POINT IXIXI IXIXI I I I I I valid track I I r------+-+-+-+-+-+-+-~ I I I balance I I I Update, Track Overflow, orl I I IXI I I I I I I Erase balance I I r------+-+-+-+-+-+-+-~ I I I of extent for I I I Chained Scheduling I I I IXIXI I I I I I track overflow I I ~------+-+-+-+-+-+-+-~ ~---+------+------+------~ I CNTRL I I I XI I I X I X I 169 I BSP I Device I IGC0006I I ~------+-+-+-+-+-+-+-~ I I I Independent I I I Direct-Access Storage IXI I IXI I I I I I I Backspace (tape, I I

~------+-+-+-+-+-+-+-~ LI ___ ~I ______~ I ______direct-access) ~I ______JI I Magnetic Tape I IXIXI IXI I I ~------+-+-+-+-t-+-+-~ I Printer I I I I I IXI I ~------+-+-+-+-+-+-+-~ I Card Reader I I I I I I IXI ~------+-~-~-~-~-~-~-~ I I I Table 21. ccntrol Routines That Are I Centrol Modules I I Macro-Expansions1 2 I I I r------T------, ~------+-T-T-T-T-T-T-~ I I I I IGG019BC IXI I I I I I I I I Number of I ~------+-+-+-+-+-+-+-~ I Macro-Instruction I Macro I I IGG019BD I IXI I I I I I I I Expansions I ~------+-+-+-+-+-+-+-~ I I I I IGG019BE I I I X I I I I I ~------+------1 ~------+-+-+-+-+-+-+-~ I PRTOV - User exit I 1 I I IGG019BK I I I I X I I I I ~------+------~ ~------+-+-+-+-+-+-+-~ I PRTOV - No user exit I 1 I I IGG019BL I I I I IXI I I ~------~------~ ~------+-+-+-+-+-+-+-~ 11These routines are also used in QSAM~ I I IGG019CA1 I I I I I IX II I see that section for a description of I ~------+-+-+-+-+-+-+-~ I the routines. I I IGG019CB1 I I I I I I IXI 12This table duplicates Table 15~ it is I ~------~-~-~-~-~-~-~-~ I repeated here to identify all control I 11These routines are also used in QSAM~ I LI ______routines available in BSAM. JI I see that section for description of I LI ______these routines. JI

Appendix A: Decision Tables 101 Table 22. BPAM Routines Residence r------T------T------~----T------,, , , , Instruction , , BPAM Routines , Module Nunber , Residence , Passing , , I , ,Control, ~------t------t------t------~------i , STOW ,IGC0002A Isupervisory Transient,SVC 21 , I , IArea I , ~------+------+------t------i , FIND (C Option) I (Macro Expansion) IProcessing Program IFIND (C Option) , , I ,Area , I ~------t------t------t------i I FIND (D Option) I IECPFIND,IECPFNDl ISupervisory Resident ISVC 18 , , I IArea I I ~------+------t------+------i , BLDL , I~CPFIND,IECPFND1 'Supervisory Resident ISVC 18 or I I , , Area I BAL IECPBLDL , ~------+------~------+------+------i , Convert TTR ,IECPFIND,IECPFND1 ,Supervisory Resident IBAL IECPCNVT I I I IArea , I ~------+------+------t------i I Convert MBBCCHHR I IECPFIND,IECPFND1 ISupervisory Resident IBAL IECPRLTV ,

,L ______~, ______~'Area ______~I ______JI

Table 23. Sequential Access Method Executors - Control Sequence r------T------T------T------T------, I I I " , I , I Receives Control , , Passes Control I , Executor , Number I From ,Via I To , I , I I I , ~------+------+------+------t------i I OPEN , See Tables 24, I See Figure 10 ,XCTL I See Figure 10 I I I 25, 26, , (WTG Table) I I ~------t------t------+------+------i I CLOSE I IGG0201A ,CLOSE Routine ,XCTL I CLOSE Routine I I I IGG0201B I I (WTG Table) I I ~------t------+------+------+------i I SYNAD/EOV ,IGC0005E I Synchronizing. 'SVC 55 'EOV Routine , I I I CHECK Routines I I , ~------+------+------+------+------i I FEOV ,IGC0003A, Processing 'FEOV Macro-, EOV Routine , , I ,Prograro I Instruction' I I I , I (SVC 31) , I ~------t------t------+------+------i , EOV/new volume ,IGG0551A I EOV Routine ,XCTL 'See Executor I

,L ______~, ______~I ______'I~ ______~ ______Description JI

102 Table 24. OPEN Executor Selector - stage 1 Table 26. OPEN Executor Selector - stage 3 OPEN Executors OPEN Executors OPEN Executors r------T------, r------T------, I I I , , , I Access Conditions I Selection I , Access Conditions , Selection , I I I , I I ~------+-----T-----T-----~ ~------+--T--T--T--T--T--T--i I Actual data set I X I X I I ,Paper Tape 'X, , , , , , , ~------+-----+-----+-----i ~------+--+--+--+--+~-+--+--~ I Buffer Pool Required I I X I I ,Update , 'X, I , , , , ~------~------+-----+-----+-----~ ~------+--+--+--+--+--+--+--~ I Dummy data set I I I X I ,Chained Scheduling , , 'X, , , , , ~------+-----+-----+-----i ~------+--+--+--+--+--+--+--~ I , , , , 'Exchange Buffering , , , 'X I , , , , Executors , , , , ~------+--+--+--+--+--+--+--~ I , I , , 'Track Overflow 'I" 'X, , , ~------+-----+-----+-----~ ~------+--+--+--+--+--+--+--~ I IGG0191A I X , X, , ,None of the pre~ed-' , , , , 'x, , I and IGG0191B , , , , , ing , , , , , , I , ~------+-----+-----+-----~ ~------+--+--+--+--+--+--+--~ , IGG0191C , I 'X, 'QSA~ , , , , , , 'x, ~------~------+-----+-----+-----~ ~------~---+--~--~--~--~--~--~--~ , and IGG01911 , 'X, , , , ~ ~ ~ , l ______J , Executors,, , ~------+--T--T--T--T--T--T--~ , IGG01910 '" ., , 'X, , ~------+--+--+--+--+-.;..+--+~-~ , IGG01911 'I"'" x , t------+--+--+--+--+--+--+--~ , IGG01912 'X 'X, , , I I , ~------+--+--+--+--+--+--+--~ , IGGOl913 "'X I IX' , I . t------+--+--+--+--+--+--+--i

Il ______IGG01914 ~'I' __ ~ __ ~ __ ~I __X ~I __ ~, __ ~I __ JI

Appendix A: Decision Tables 103 Table 25. OPEN Executor Selector - Stage 2 OPEN Executors r------T------, I I I I Access Conditions I Selection I I I I ~------+.---T---T---T---T---T---T---T---T--.---T---T---T---T---T---i I BSAM or I X11 I I I X11 X I X11 X I X11 X I X I X11 X11 X11 I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I QSAM I X1 1 X I X I X I X11 I X11 I X11 I I X11 X~I X11 I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I Input or I X21 X I I X21 I I I I X21 I I I I I I ~------+_--+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I output I X21 I X I X21 I I I I X21 I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I Inout, outin I I I I I I X I I X I I I I I I I X I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I Update I I I I I I I I I I I I X I XI I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I Unit Record I I I I X I X-I I I' I I I I I I X51 I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I Magnetic Tape I I X31 X31 I X-I X I I I I I I I I X51 I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I paper Tape I I I I I X-I I I I I I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I Direct-Access ~torage I X I X3 1 X3 1 I I I I X I X I I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I WRITE-LOAD (Create-BDAM) I I I I I I I I I I X I X I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I Exchange Buffering I I X I X I X I I I I I I I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I Track Overf low I I I I I I I X I I I I X I I X I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I Chained scheduling I I I I I I I I I X I I I I I X I X I ~------+---+---+---+---~---~---+---+---+---+---+---+---~---+---+---i I I I I I I I I I I I I I I I Executors I I I I I I I I I I I I I I I I I I I I I I I I I I I ~------+---+---+---+---T---T---+---+---+---+---+---+---T---+---+---i I IGG0191D I D I I I I I I I I I· I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGGOl91E I I E I I I I I I I I I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGG0191F I I I F I I I I I I I I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGGOl91G I I I I GIG I G I I I I I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGG0191H I I I I I I I H I I I I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGG0191J I I I I I I I I J I I I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGGOl91K I I I I I I I I I K I I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGGOl91L I I I I I I I I I I L I I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGG0191M I I I I I I I I I I I M I I I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGGOl91P I I I I I I I I I I I I PIP I I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGG0191Q I I I I I I I I I I I I I I Q I I ~------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---i I IGGOl91R I I I I I I I I I I I I I I I R I ~------~---~---~---~---~---~---~---~---~---~---~---~---~---~---~---i I 1This executor is selected for either QSAM or BSAM. I I 2This executor is selected for either Input or Output. I I 3This executor is selected for either Magnetic Tape or Direct-Access Storage. I I -This executor is selected for either Unit Record, Magnetic Tape, or Paper Tape. I lI ______5This executor is ~ ______selected for either Unit Record or Magnetic Tape. J I

104 Table 21. CLOSE Executor· Selector r------T------, I I I I Access Conditions I Selection I I I I ~------+-----T-----i I CLOSE macro-instruction I X I X I t------+-----+-----i I Perroanent error or I I I I end-of-volume condition I I X I I when using QSAM for output I I I t------+-----+-----i I I I I I Executors I I I I I I I ~------+-----+-----i I IGG0201A I X I X I t------+-----+-----i

LI ______and IGG0201B ~I _____ ~I _____X JI

Appendix A: Decision Tables 105 APPENDIX B: QSAM CONTROL BLOCKS

DCB 10BA lOB ~o .- RECAD I - NEXT lOB ECB EOBAD r-- Figure 16 shows the control Qlocks used I t::::::::=- I CPAD in QSAM. Through the data control block I (DCB), the QSAM routines associate the data I o 0 CP 0 Qeing processed with the processing pro~ I gram. Fields in the DCB point to the start I BUFFER POOL I 0 of a Quffer, the end of a Quffer, and an lOB I input/output block (lOB). These fields are p- ----.1: NEXT lOB I updated as successive chapnel programs are I ECB 21 1 I executed. Each lOB points at the next lOB I - CPAD I ~ and at a channel prograXfI

CP 0 L.-..j J-

Legend. Address Values: o Enterecl by the OPEN exe~utor. 1 Updated by the synqhron;,;ing routine. 2 UpdQted by the GET or PUT routine. --- Successive Address Values

Figure 16. QSAM Control Blocks

106 APPENDIX C: BSAM CONTROL BLOCKS

Figure 17 shows the control blocks used DEeB in BSAM and their stages of completion. 2 10BAD stage 0 shows the state of the control lOB 1 blocks Defore any READ or WRITE macro­ DeBAD EeB BUFFER instruction. Stage 1 shows the effect of DC BAD 0 BUFAD ...L,.....r ~ the READ or WRITE macro-instruction, that EeAD ~ is, the values supplied by the processing r--- NEXT lOB program in the data event control block o 0 oQ ePAD (DECB). Finally, stage ~ shows the effect ep 2 of the READ or WRITE routine'S tying together these control blocks.

DEeB Before any READ or WRITE macro­ 2 instruction, the data control block (PCB) 1+---108 ------IDBAD 1 DeBAO ------. points to the first input/output clock - -~ EeB BUFFER (lOB). This lOB points back to the DCE, to I DC BAD 2 r" 1 0 _..1 BUFAD ( the next lOB, and to the channel program I EeBAD -r..t (CP). The.READ or WRITE macro-instruction I r-- NEXT lOB I identifies the DCB and the buffer to be I ePAD I 2 I 2 I read into or written out. Finally, the oa ep I READ or WRITE routine connects the DECB I ______----..1 with the current lOB, inserts the address I of the ECB (which is located in the DECB) I I into the lOB, and points the channel DEeB program to the buffer. Successive macro­ I I, 2 instructions cause updating of the lOB +---108------10BAD 1 address in the DCB and insert address I .- -....-----.. DeBAO r------. t- ECB BUFFER values in the next DECB. lOB. and channel pC BAD 2 '0 0 r-" program. I EeBAD _J BUFAD r-!T-l I I NEXT lOB I , I CPAD I 2 I 0 I I I CP 2______---...1 I I I I I DeB I I l.----- IDBA I

Legend: Addre$s Vqlues o Ent.red by the OPEN Executor. 1 Provided by the processing progrom. 2 Completed by the READ or WRITE routine. - -- Successive Address Volues.

Figure 17. BSAM control Blocks

Appendix C: BSAM Control Blocks 107 APPENDIX D: PAPER TAPE CODE CONVERSION - DESCRIPTICN OF TABLE r,-iODULES

GET routine IGG019AT (paper tape) and CODE CONVERSION MODULE IGG019CP WRITE routine IGG019BF (paper tape) use the tables in the following modules to convert characters read from paper tape to EBCDIC This module is loaded by the OPEN execu­ characters. tor if the DCB specifies paper tape, type and code conversion for Friden paper tape code.

CODE CONVERSION MODULE IGG019CM The module consists of three tables:

• A validity checking and special func­ This module is loaded by the OPEN tions table. executor if the DCB specifies paper tape, and code conversion for teletype transmis­ sion code. • A lower case character translation table. The module consists of three tatles: • An upper case character translation • A validity checking and special func­ table. tions table.

• A lower case character translation table.

• An upper case character translation CODE CONVERSION MODULE IGG019CQ table.

This module is loaded by the OPEN execu­ tor if the DCB specifies paper tape, and code conversion fer IBM PTTC/8 code. CODE CONVERSION MODULE IGG019CN The module consists of three tables:

This module is loaded by the OPEN execu­ • A validity and special functions table. tor if the DCB specifies paper tape, and code conversion for ASCII paper tape code. • A lower case character translation table. The module consists of two tables: • An upper case character translation • A validity checking and special func­ table. tions table.

• A character translation table. CODE CONVERSION MODULE IGG019CR

CODE CONVERSION MODULE IGG01QCO This module is loaded by the OPEN execu­ tor if the DCB specifies paper tape, and code conversion for NCR paper tape code. This module is loaded by the OPEN execu­ tor if the DCB specifies paper tape, and The module consists of three tables: code conversion for Burroughs paper tape code. • A validity checking and special func­ tions table. The module consists of two tables: • A lower case character translation • A validity checking and special func­ table. tions table. • An upper case character translation • A character translation table. table.

108 APPENDIX E: FEOV EXECUTOR IGC0003A (SVC 31) - OPERATION FOR OUTPUT UNDER QSAM

The operation of the FEOV executor for The operation of the FEOV executor, and an output data set processed under the the resultant flow of control between it queued sequential access method (QSAM) and other control program routines, differs depends on the operating mode and the for each of eight conditions. The condi­ execution of certain channel programs. tions are described below. Figure 18 illustrates the flow of control between the executor and other routines. Table 29 In the move operating mode, the execu­ specifies the path of control for the eight tion of all channel programs is tested by conditions. the FEOV executor. It awaits the execution of the channel program for the present buffer, and causes processing of any error conditions. Condition 1: An output data set is proc­ essed under QSAM in the move mode, and all channel programs execute normally. In the locate operating mode, the execu­ tion of the channel program for the next buffer in the chain is tested by the output The executor operates as foilows: synchronizing routine. This test occurs immediately after the end-of-block routine has caused .the channel program for the • It issues a TRUNC macro-instruction to present buffer to be scheduled for execu­ pass control to the PUT routine. (The tion. The execution of the channel pro­ PUT routine passes control to the end­ grams for all the following buffers, of-block routine, which causes the including the one just scheduled, is tested channel program for the present buffer by the FEOV executor after the last channel to be scheduled for execution. Control program has executed. returns to the PUT routine, which returns control to this executor.) When a QSAM routine tests the execution of a channel program, one of three condi­ • It awaits execution of the channel tions may be established, with the stated program for the present buffer. results:

• The channel program executed normally: • It tests the execution of the channel Normal processing continues. program and finds that it executed normally. • The channel program is not yet execut­ ed: The testing routine awaits comple­ tion of the channel program. • It passes control to the end-of-volume routine of I/O support. (That routine • The channel program executed with an passes control to the EOV/new volume error condition: The testing routine executor, which returns control to the passes control to the SYNAD/EOV execu­ processing program.) tor (IGC0005E), by.means of an SVC 55 instruction in synchronizing routine IGG019AR. The executor distinguishes Condition 2: An output data set is proc­ between permanent error conditions and essed under QSAM in the move mode, and a end-of-volume conditions. (For a des­ permanent error condition is encountered in cription of the error processing opera­ the execution of a channel program. tions initiated by the SYNAD/EOV execu­ tor, refer to the section: sequential Access Method Executors, in this publi­ The executor operates as follows: cation. ) • It issues a TRUNC macro-instruction to pass control to the PUT routine. (The The FEOV executor substitutes its own PUT routine passes control to the end­ SYNAD routine (contained within module of-block routine, which causes the IGC0003A) for the processing program's. channel program for the present buffer That SYNAD routine releases the work area to be scheduled for execution. Control normally obtained by the executor and returns to the PUT routine, which issues an ABEND macro-instruction. returns control to this executor.>

Appendix E: Operation of FEOV Executor for Output under QSAM 109 • It awaits execution of the channel channel program for the present buffer program, and finds that it encountered to be scheduled for execution. control an error condition in its execution. returns to the PUT routine; which It passes control to the synchronizing returns control to the FEOV executor.> routine. (That routine finds the same error condition and passes control to • It awaits execution of the channel the SYNAD/EOV executo~ (IGC0005E) by program, and finds that it encountered means of an SVC 55 instruction. The an error condition in its execution. SYNAD/EOV executor finds that the error condition is a permanent error condi­ • It passes control to the synchronizing tion and returns control to the syn­ routine. (The routine finds the same chronizing routine, which returns con­ error condition and passes control to trol to the FEOV executor.> the SYNAD/EOV executor (IGC0005E) by means of an SVC 55 instruction. The • It issues an ABEND macro-instruction. SYNAD/EOV executor finds that the error condition is an end-of-volume condition and passes control to the EOV routine Condition 3: An output data set is proc­ of I/O support. That routine passes essed under QSAM in the move mode, and an ccntrol to the EOV/new volume executor, end-of-volume condition is encountered in which retuz.ns control to the synchron- the execution of a channel program. 1z1ng routine. The synchronizing rou­ tine now returns control to the FEOV .executor. ) The executor operates as follows: • It passes control to the end-of-volume • It issues a TRUNC macro-instruction to routine of I/O support. (That routine pass control to the PUT routine. (The passes control to the EOV/new volUme PUT routine passes control to the end­ executor again, which now returns con­ of-block routine, which causes the trol to the processing program.>

SVC 31 ;--- FEOV Executor 16 (1 GC0003A)

ABEND 12 7 10 1 6 I Routine I

PUT Routine I, 4 5 2 3

Synchronizing I Routine

SVC55 819 SYNAD/EOV Executorl"__ ~----' ~nd-of-Block p (1GCOOO5E) I Routine 'I III EOV Routine of t~ __-,I I I/O Support r 13 15 EOV/ New Volume Executor (1GG0551A) Note, Refer to Table 29 for the Sequence of Control

14~ legend, 1 ,2 ..... Pafh Number Processing Program ~ Described in This Publication

Figure 18. Flow of Control Between the E'EOV Executor and Other Control Program Routines

110 Table 29. Path and Sequence of Control of obtain the next buffer. The synchran­ the FEOV Executor and Other Con­ izing routine finds that the channel trol Program Routines pregram executed with an error candi­ tion and passes cantral to. the SYNAD/EOVexecutar (IGC0005E), by means Condition Sequence of Control af an SVC 55 instruction. The (0) (b) SYNAD/EOV executar finds that the error 1 1,2,3,6,12,13,14 canditian is a permanent errar candi­ 2 1,2,3,6,7,8,9 10,16 tian, and returns control to the syn­ chranizing routine. The synchronizing 3 1,2,3,6,7, S, 11,13,15,10,12,13,14 routine now returns contral to. the FEOV 4 1,2,34,5,6,12,13,14 executor.) 5 1,2,3,4,8,9,10,16 6 1,2,34,5,6,7,8,9,10,16 • It issues an ABEND macro-instruction. 7 1,2,3,4,8,11,13,15,.10,12,13,14 8 1,2,3,4,5,6,7,8,11,13,15,10,12,13,14 condition 6: An output data set is prac­ essed under QSAM in the lacate made, and Legend: the execution of the channel program for (a) ~ Refer to Appendix E for" description of the conditions. any buffer ot'her than the buffer specified (b) ~ Refer to Figure 18 for an identification of the routine passing control and the routihe receiving cOhtrol. in condition 5 encounters a permanent errar. Condition 4; An output data set is proc­ essed under QSAM in the locate mode, and The executor aperates as fallews: all channel programs execute normally. • It issues a TRUNC and a PUT macra­ The executor operates as follewsl insttuction to. pass contral to. the PUT routine. (The PUT routine passes • It issues a TRUNC and a PUT macro­ control to the end-of-black rautine, instruction to pass control to the PUT which causes the channel pragram far routine. (The PUT reutine passes the present buffer to. be scheduled far cOntrel to the end-of-block routine, executian. The PUT routine then passes Which causes the channel progratt for contral to. the synchronizing rautine, the present buffer to be scheduled for which returns' contralto. the PUT rou­ execution. The PUT routine then passes tine. The PUT routine returns contra I control to the synchronizing routine to. to the executot.) obtain the next bUffer. That routine finds that the channel pregram for the • It awaits execution af the channel next buffer executed normally, and program for the last buffer and finds returns control to the PUT routine. that the channel pragram executed with The PUT routine returns control to the an ettor condition. FEOV executer.) • It passes canttol to the synchranizing • It awaits execution of the last channel toutine. {The routine finds the same program, and finds that the channel error canditian and passes contral to. pregram executed normally. the SYNAD/EOV executat (IGC0005E), by weans af an SVC 55 macro~instructian. • It passes control to the EOV routine of The SYNAD/EOV executer finds that the I/O support. (That reutine passes cen­ error candition is a permanent errar trol to the EOV/new velume executor, conditian and returns contral to the which returns control to the processing synchtonizing rautine, which returns program. ) cantral to the FEOV executor.} Condition 5: An output data set is proc­ • It issues an ABEND macra-instruction. essed under QSAM in the locate mode, and the execution of the channel pregram for Candition 7: An aut put data set is proc­ the next buffer in the chain encountered a essed under QSAM in the lacate made, and permanent error. the executian of the channel program far the next buffer in the chain encauntered an The FEOV executor eperates as fellows: end-of-volume conditian. • It issues a TRONC and a PUT macro­ The executar aperates as follaws: instruction to pass control to the PUT routine. (The PUT reutine passes • It issUes a TRUNC and a PUT macro­ contra I to. the end~af~block routine, instructian to. pass cantral to. the PUT which causes the channel pragram fer rautine. (The PUT rautine passes the ptesent buffer to. be scheduled far control to the end-af~black routine, executian. The POT rautine then passes which causes the channel pragram far cantral to the synchronizing reutine to. the ptesent buffer to be schedUled for

Appendix E: Operatian af FEOV Executar for Output under QSAM 111 execution. The PUT routine then passes synchronizing routine which returns control to the synchronizing routine to control to the PUT routine. The PUT obtain the next buffer. The synchron­ routine returns control to the FEOV ~z1ng routine finds that the channel executor.> program executed with an error condi­ tion, and passes control to the • It awaits execution of the channel SYNAD/EOV executor (IGC0005E), by means program for the present buffer, and of an SVC 55 instruction. The then finds that the channel program SYNAD/EOV executor finds that the error executed with an error condition. condition is an EOV oondition, and passes control to the EOV routine of • It passes control to the synchronizing I/O support. That routine passes con­ routine. (The routine finds the same trol to the EOV/new volume executor, error condition and passes control to which passes control to the synchroniz­ the SYNAD/EOV executor (IGC0005E) by ing routine. The synchronizing routine means of an SVC 55 instruction. The returns control to the PUT routine, SYNAD/EOV executor finds that the error which now returns control to the FEOV condition is an EOV condition and pass­ executor.> es control to the EOV routine of I/O support. That routine passes control • It passes control and the work area to to the EOV/new volume executor, which the EOV routine of I/O support. (That passes control to the synchronizing routine passes control to the EOV/new routine, which returns control to the volume executor again, which now FEOV executor. > returns control to the processing pro­ graw.> • It passes control, and the work area, to the EOV routine of I/O support. Condition 8: An output data set is proc­ (That routine passes control to the essed under QSAM in the locate mode, and EOV/new volume executor again, which the channel program for any buffer other now returns control to the processing than the one specified in condition 7 program. > ~ncounters an end-of-volume condition. Note: An EOV condition is found during the The executor operates as follows: implementation of an FEOV macro-instruction in conditions 3, 7, and 8. The subsequent • It passes control to the PUT routine. processing results in three volumes: Two (The PUT routine passes control to the volumes containing all the blocks scheduled end-of-block routine, which causes the for output by the FEOV macro-instruction channel program for the present buffer and prior PUT macro-instructions, and a to be scheduled for execution. The PUT third volume available for writing new routine then passes control to the blocks.

112 ABEND routine receives control relation to processing program 7,58 19,45,66,69,79,83,87/ 88,90,109,110,111 relation to QSAM routines 7-9 Address conversion routines shared with QSAM full-to-relative address (IECPRLTV) appendages 47-55 74,75 end-of-block routines 33-42 relative-to-full address (IECPCNVT) track overflow asynchronous error 74,75 processing routine 43,46,47 Appenaages Buffer alignment 92 abnormal end 55 Buffer flushing CLOSE executor 87 channel end 51-53 see also: Buffer priming OPEN executor end-of-extent 48-50 Buffer is empty (GET routines) introduction to 47,,48 exchange buffering 19 PCI 53-55 simple buffering 12 SIO 51 Update mode 22 Asynchronous error processing routine, Buffer pool management 92,93 track overflow Buffer priming OPEN executor 85 description of 46.,47 Buffer ready for emptying (PUT routines) introduction to 43 exchange buffering 19 IRB constructed 46 simple buffering 12 IRB scheduled 55 Update mode see: Buffer is empty (GET routines), Update mode Backspace Buffering techniques BSP routine (IGC00061 - SVC 69) 71 GET routines 12 CNTRL routine (IGG019BE) 68 PUT routines 25 Basic direct-access method (BDAM) BUILD routine (IECBBFB1) 92 see: Create-BDAM Basic partitioned access method routines see: BPAM routines Calculating whether a block fits within the Basic sequential access method routines allocated extents see: BSAM routines if track overflow is not specified BLDL routine (IECPBLDL, IGC018 - SVC 18) 35,38,62 BLDLTAB option not used 73,74 if track overflow is specified 42,63 BLDLTAB option used 74,75 Card reader GET routines 16 BLDLTAB option not used 73,74 Chained channel-program scheduling BLDLTAB option used 74.,75 appendages Block fits into the allocated extents abnormal end, channel end, PCI see: Calculating whether a block fits 53-55 within the allocated extents end-of-extent 50 Blocked records end-of-block routines 36-41 GET routines lOB prefix 36 exchange buffering 19 joining simple buffering 12 description of end-of~block Update mode 22 routines 38-41 PUT routines end-of-block routine finds joining exchange buffering 30 unsuccessful 37,39 simple buffering 26 introduction to 37 Update mode NOTE/POINT routines see: Update mode GET routines parting BPAM routines channel end appendage finds chaining description of 72-75 terminated 54,55 effect of BLDLTAB option 73,74 description of PCI appendage 54,55 introduction to 72 introduction to 53 relation to BSAM routines 7,72 stage 2 OPEN executors 82,84 relation to processing program 7,72 stage 3 OPEN executor 86 residence of 72 Chained scheduling BSAM control blocks see: chained channel-program scheduling relation of 107 Character conversion BSAM routines see: paper tape character conversion flow of control 58,59 CHECK routines introduction to 58,59 description of 64-66 relation to BPAM routines 7,72 introduction to 63

Index 113 CLOSE executor Inout or Outin mode not used 33 description of 87,88 Inout or Outin mode used 33,31,41 introduction to 87 introduction to 33 CNTRL rOlitines ordinary 33-36 card reade:r: 56 track overflow 41-42 magnetic tape 68 End-of-extent printer 57 appendages control blocks, relation of chained scheduling 50 BSAM 107 normal scheduling 48-50 QSAM 106 end-of-block routines Control character end-of-block routines chained scheduling 36-40 chained scheduling 40,41 normal scheduling 33-36 normal scheduling 35,36 End-of-volume Control routines see: EOV BSAM EODAD routine macro-expansions (shared with QSAM) control passes to 65,79 57 EOV executor modules loaded at execution time see: EoV/new volUme executor, SYNAD/EOV 70,71 executor modules loaded at OPEN time EOV routine of I/O support 56,57,66-70 control passed to QSAM CHECK routine 91 roacro-expansions (Shared with BSAM) create-BDAM WRITE routine· 62,91 57 EOV/new volume executor 88 modules loaded at OPEN time (shared FEOV executor 90 with BSAM) 56,57 synchronizing routines 88 Converting routines control recei~ed from see: address con~ersion routines, paper CHECK routines 63-65,88 tape character conversion routines Create-BDAM CHECK routine 65 Create-BDAM (WRITE-LOAD) FEOV executor 90 . CHECK routine 65 SYNAD/EOV exebutor 88 stage 2 OPEN executo:r:S 83 synchronizing routines Q2-46,88 WRITE (no track overflow) routines 62 EOV/new volume executor 91 WRITE (track o~erflow) routine 63 Error option implementation Input, output, Readhack modes Data check for printer with UCS feature 79 43,64,65,8!i,90 DCBCINDi field set 35~38,42,78,79 p~per tape 19 DD statement is DUMMY 79 track overflow option 46 Decision tables 95-105 Update roode 46 DS1LSTAR field 79 Exchange buffering DS1NOEPV field 78 GET routines Dummy data set routine (IGG019AV) 18 d~scription of 20-22 introduction to 19,20 Effector routine PUT routines see: Exit effector routine description of 30-33 Empty buffer introduction to 29,30 GET routines stage 2 OPEN executors 81 exchange buffering 19 stage 3 OPEN executor 86 simple buffering 12 Executors Upda te Rlode 22 CLOSE 81,88 PUT routines EOV/new ~olume 91 exchange bUffering 30 FEOV 90 simple buffering 26 introduction to 76 Update mode OPEN see: Update mode GET routines RAM option not used 7 End-of-block condition exists RAM option used 7 GET routines stage 1 78,79 exchange buffering 19 stage 2 79-84 simple buffering 12 stage 3 85-87 Update mode 22 relation to I/O sUpport 7,76 PUT routines SYNAD/EOV 88,90 exchange buffering 30 Exit effector routine 55 sirople buffering 26 Update mode see: Update mode GET routines FEOV executor (IGC0003A - SVC 31) 90 End-oi-block routines FEOV SYNAD routine 109 chained channel-program scheduling FIND 36-41 C option (macro-expansion) 73

114 D option (IGC018 - SVC 18) IGG019BB 64 BLDLTAB option not used 14 IGG019BC 67 BLDLTAB option used 15 IGG019BD 68 Flow of Control IGG019BE 68 BSAM routines 58 IGG019BF 60 executors 16,11;89,111 IGG019BG 65 QSAM routines 10,11 IGG019BH 61 Forward space IGG019BI 65 CNTRL routine (IGG019BE) 68 IGG019BK 69 FREEBUF macro-expansion 93 IGG019BL 10 FREEPOOL macro-expansion 93 IGG019BM 50 Full buffer IGG019CA 56 GET routines IGG019CB 51 exchange buffering 19 IGG019CC 34 simple bUffering 12 IGG019CD 35 Update mode 22 IGG019CE 35 PUT routines IGG019CF 36 see: buffer ready for emptying IGG019CG 51 IGG019CH 50 GET routines IGG019CI 52 buffering techniques 12 IGG019CJ 52 card reader 16 IGG019CK 53 exchange bUffering 19-22 IGG019CL 51 introduction to 11,12 IGG019CM 108 paper tape character conversion 18 IGG019CN 108 Readback 11 IGG019CO 108 simple buffering 12-18 IGG019CP 108 Update mode 24 IGG019CQ 108 GETBUF macro-expansion 93 IGG019CR 108 GETPOOL routine (IECQBFG1) 92 IGG019CS 53 IGG019CU 54 IECBBFB1 92 IGG019CV 38 IECPBLDI IGG019CW 39 BLDLTAB option not used 73,74 IGG019CX 40 BLDLTAB option used 14,15 IGG019CY 40 IECPCNVT 14,15 IGG019CZ 50 IECPFIND 13 IGG019Cl 46 IECPFNDl 14 IGG019C2 42 IECPRLTV 74,75 IGG019C3 55 IECQBFG1 92 IGG019DA 62 IGC0002A 72 IGG019DB 62 IGC0002E 70 IGG019DC 65 IGC0003A 90 IGG019DD 63 IGC0005E 88 IGG019EA 20 IGC00061 11 IGG019EB 20 IGc018 IGG019EC 21 BLDLTAB option not used 73,74 IGG019ED 21 BLDITAB option used 74,75 IGG019EE 30 IGG019AA 13 IGG019EF 31 IGG019AB 14 IGG019iA 78 IGG019AC 15 IGG0191B 78 IGG019AD 15 IGG0191C 19 IGG019AE 24 IGG0191D 81 IGG019AF 44 IGG0191E 81 IGG019AG 16 IGGOl91F 81 IGG019AH 16 IGGOl91G 82 IGG019AI 21 IGG0191H 82 IGG019AJ 27 IGG01911 79 IGG019AK 28 IGG0191J 82 IGG019AL 29 IGG0191K 82 IGG019AM 11 IGG0191L 83 IGG019AN 11 IGG019iM 83 IGG019AQ 45 IGG0191P 83 IGG019AR 46 IGG0191Q 84 IGG019AT 18 IGGOl91R 84 IGG019AV 79 IGG01910 85 IGG019AW 48 IGGOl911 85 IGGOi9BA 60 IGG01912 85

Index 115 IGG01913 86 stage 3 OPEN executor (IGG01912) 85 IGG01914 86 synchronizing and error processing IGG0201A 87 routine (IGG019AT) 19 IGG0201B 88 Paper tape code conversion modules 108 IGG0551A 91 PCI Inout, Out in wades use in the parting process of chained alternate end-of-block routines channel-program scheduling 53 33,35,37,42 POINT routines stage 2 OPEN executors 82 see: NOTE/POINT routines Input data set without data (IGG019AV) 79 Priming input buffers Input data set without entries (IGG0191B) introduction to 79 exchange buffering 19 Interruption request block (IRB) simple buffering 13 see: Asynchronous error processing Update mode 24 routine, track overflow stage 3 OPEN executor 85 I/O interruption 9 Printer with UCS features 79 lOB prefix for chained scheduling 36 Processing program relation to SAM routines 7 LOAD-BDAM (WRITE-LOAD) Program controlled interruption see: Create-BDAM see: PCI PRTOV Macro-expansions appendage 51 FIND (C option) 73 end-of-block routines 35 FREEBUF 93 macro-expansions 57 FREEPOOL 93 PUT routines GETBUF 93 buffering techniques 25 PRTOV 57 exchange buffering 29-33 Module selector tables introduction to 25 see: Decision tables simple buffering 25-29 Update mode 33 New buffer PUTX routines see: .Full buffer, GET routines; Ewpty description of buffer, PUT routines see: PUT routines New volume executor see: EOV/new volume executor QSAM control blocks Next buffer segment (PUT routines) relation of 106 exchange buffering 30 QSAM routines simple buffering 26 flow of control 10,11 Update mode introduction to 10 see: Next record (GET routines), relation to BSAM routines 7-9 Update mode relation to processing program 7 Next record (GET routines) shared with BSAM exchange buffering 19 appendages 47-55 simple buffering 12 end-of-block routines 33-42 Update mode 22 track overflow asynchronous error NOTE/POINT routines processing routine 46 chained scheduling 69,70 Queued sequential access method normal scheduling 67,68 see: QSAM routines track overflow 69 Update mode 69 RAM option specified in system generation (SYSGEN) process and used in initial OPEN executor program loading (IPL) process 7 introduction to 78 READ routines RAM option not used 7 description of 60-63 RAM option used 7 introduction to 59 stage 1 78,79 Readback wode GET routines 17 stage 2 79-84 RELSE routines stage 3 85-87 description of Outin mode see: GET routines see: Inout mode introduction to exchange buffering 19 Paper tape siwple buffering 13 appendage (IGG019CS) 53 Update mode 24 Paper tape character conversion routines Resident access method option CHECK routine (IGG019BG) 65 see: RAM option GET routine (IGG019AT) 18 READ routine (IGG019BF) 60,61 Scheduling stage 2 OPEN executor (IGG0191G) 82 see: chained channel-program scheduling

116 see also: end-of-block routines erase routine 71 Search-previous auxiliary storage error processing addressing 23 see: asynchronous error processing Seek addresses in QSAM Update mode 23 routine Sequential access methpds 7 introduction to 41 Sequential access methods executors stage 2 OPEN executors see: executors Create-BDAM not used 82 Sequential access methods facilities 7 Create-BDAM used 83 sequential access methods (SAM) routines stage 3 OPEN executor (Create-BDAM not effect of BLDLTAB 73,74 used) 86 effect of RAM 7 TRUNC routines introduction to 7 description of Simple buffering see: PUT routines GET routines introduction to description of 13-18 exchange buffering 30 introduction to 12,13 simple buffering 26 PUT routines description of 27-29 UCS introduction to 25-27 see: printer with UCS feature Update mode routines Unblocked records description of 24,25,33 GET routines introduction to 22-24 exchange buffering 19 stage 2 OPEN executors 79-85 simple buffering 12 stage 3 OPEN executors 85,86 Update mode 22 Space magnetic tape PUT routines BSP routine (SVC 69-IGC0006I) 71 exchange buffering 30 CNTRL routine (IGG019BE) 68 simple buffering 26 STOW routine (SVC 21-IGC0002A) 72 Update mode SVC 18 (IGC018) see: Update mode GET routines BLDLTAB option not used universal Character Set FIND (D option), BLDL routines 74 see: printer with UCS feature BLDLTAB option used Update mode FIND (D option), BLDL routines 75 appendages SVC 21 (IGC0002A) - STOW routine 72 end-of-extent SVC 25 (IGC0002E) - track balance routine, BSAM 50 track overflow erase routine 70 QSAM 48 SVC 31 (IGC0003A) - FEOV executor 90 SIO 51 SVC 55 (IGC0005E) - SYNAD/EOV executor 88 CHECK routine 65 SVC 69

Index 117 Y28-6604-1

I< "­ a I

C1 "C ""I I-

InternaHonal8usiness Machines Corpora Han Data Processing Division 112 EIJst Post Road, White Plains, N.Y.lOBOl [USA Only) IBM World Trade Corporation 821 United NaHons Plaza, NawYork, NawYork 10017 (Intarnational) READER'S COMMENTS

Titl~: IBM System/360 Operating System Form: Y28-6604-l Sequential Access Methods Program Logic Manual

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 ______------__------fold- Please check the items that describe your position: _ Customer personnel _. _Operator _Sales Representative _. laM 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:

fold

FOLD ON TWO LINES,STAPLE AND MAIL No Postage NeceSSary if Mailed in U.S.A. Y28-6604-1" staple

fold

Ir------, FIRST CLASS I I PERMIT NO. 81 I I I IL ______POUGHKEEPSIE, N.Y. JI

Ir------, BUSINESS REPLY MAIL I IL- ______NO POSTAGE STAMP NECESSARY IF MAILED IN U.S.A. J I 111111 111111 POSTAGE WILL BE PAID BY 111111 IBM CORPORATION P.O. BOX 390 111111 POUGHKEEPSIE, N. Y. 12602 111111 ATTN: PROGRAMMING SYSTEMS PUBLICATIONS I11I11 Ii....'" ::s DEPARTMENT D58 rt" CD 111111 p" .... ------::s fold c: f ·Ol ·:t:' · >< I\J co I 0\ 0\ 0 += .....I

International Business Machines Corporation Data Processing Divieion 112 East Post Road, White Plains, N.y.tOBOt [USA Only] IBM World Trade Corporation 82t United Nations Plaza, New York, New York tOOt7 [International] sta