Type ASSEMBLE
Source Lines : 513
Fixes Applied : 6
Most Recent Version : Tuesday, December 12, 1978
Last Fix ID : [R15172DS]
Module
DMSSBS (DMSSBS - BASIC SEQUENTIAL ACCESS METHOD)
Function
THE CMS BSAM ROUTINE PROCESSES SEQUENTIAL READ AND WRITE MACROES.
Attributes
REENTRANT, NUCLEUS RESIDENT
Operation
THE CMS BSAM ROUTINE IS CALLED BY AN OS READ OR WRITE MACRO. IT CHECKS DCBFDAD TO SEE IF THE FIRST BYTE IS A P. IF SO, THE CONTENTS OF THE LAST TWO BYTES OF DCBFDAD ARE INCREMENTED BY ONE AND STORED IN FCBITEM. IF P IS SPECIFIED AND THE DEVICE IS A TAPE, DMSTIO IS USED TO BACKSPACE OR FORWARD SPACE TO THE SPECIFIED ITEM. NEXT THE FCB DUMMY OPTION IS CHECKED. IF IT IS SPECIFIED, HEX '4200000C' (EOF ERROR) OR HEX '7F000000' (NO ERROR) IS STORED IN THE ECB, DEPENDING ON WHETHER A READ OR WRITE WAS ISSUED, AND CONTROL IS RETURNED TO THE USER. IF THE FCB DUMMY OPTION IS NOT SPECIFIED, THE DSORG OPTION IS CHECKED. . IF THE DSORG OPTION IN THE DCB IS DA (DIRECT ACCESS), CONTROL IS GIVEN TO THE DMSSBD ROUTINE TO CONVERT THE RECORD IDENTIFICATION INTO AN ITEM NUMBER AND PROCESS ANY KEYS USED. IF DMSSBD COMPLETES SUCCESSFULLY, CONTROL IS RETURNED TO DMSSBS. OTHERWISE, CONTROL IS RETURNED TO THE USER WITH AN ERROR CODE. . IF THE DSORG OPTION IN THE DCB IS PO (PARTITIONED ORGANIZATION) AND A WRITE IS SPECIFIED AND THE FCBPDS ENTRY IS ZERO, CONTROL IS PASSED TO THE PDSSAVE ROUTINE IN DMSSVT TO SAVE THE DIRECTORY OF THE PDS (PARTITIONED DATA SET) AND POINT THE FCB FILE ITEM NUMBER TO A FREE MEMBER SLOT. IF PDSSAVE COMPLETES SUCCESSFULLY, CONTROL IS RETURNED TO DMSSBS. OTHERWISE, CONTROL IS RETURNED TO THE USER WITH AN ERROR CODE. . IF THE DSORG OPTION IN THE DCB IS PS (PHYSICAL SEQUENTIAL) AND THE MACRF OPTION IS WL (CREATE A BDAM DATA SET)*, AN EIGHT IS PUT IN REGISTER 15 AND A CHECK IS MADE TO SEE IF END OF EXTENT HAS BEEN REACHED. IF SO, CONTROL IS RETURNED TO THE USER. IF NOT, REGISTER 15 IS SET TO ZERO AND A CHECK IS MADE OF THE OPTION SPECIFIED IN THE WRITE MACRO'S DECB. IF SZ IS SPECIFIED AND THE KEYLENGTH IS ZERO, CONTROL IS RETURNED TO THE USER WITH A HEX '7F' IN THE ECB. IF SD OR SZ IS SPECIFIED AND THE KEYLENGTH IS NONZERO, DMSSBD IS CALLED TO WRITE 256 DUMMY KEYS AND UPON RETURN FROM DMSSBD CONTROL IS PASSED BACK TO THE USER WITH A HEX '7F' IN THE ECB. IF SD IS IS SPECIFIED AND THE KEYLENGTH IS ZERO, A KEY OF X'FF' IS PUT IN THE DATA AREA AND DMSSBS PROCESSES THE DATA AS A NORMAL WRITE. IF SF IS SPECIFIED, A HEX '7F' IS STORED IN THE ECB AND IF THE KEYLENGTH IS NOT ZERO DMSSBD IS CALLED TO PROCESS A KEY. IF THE DMSSBD ROUTINE AND/OR THE CHECK FOR VALID OPTIONS IS COMPLETED SUCCESSFULLY DMSSBS BEGINS FILLING IN THE IOB AND THE I/O PLIST. OTHERWISE CONTROL IS RETURNED TO THE USER WITH A HEX '42' IN THE ECB, DENOTING AN ERROR. . IF THE DSORG OPTION IN THE DCB IS PS OR PO AND A NONZERO KEYLENGTH IS SPECIFIED AND THE MACRF OPTION IS NOT WL, DMSSBD IS CALLED TO READ OR WRITE A KEY. IF DMSSBD COMPLETES SUCCESSFULLY, DMSSBS BEGINS FILLING IN THE I/O PLIST. IF NOT, CONTROL IS RETURNED TO THE USER WITH A HEX '42' IN THE ECB. . AFTER THE NECESSARY CHECKS AND CALLS FROM DMSSBD AND PDSSAVE ARE MADE, DMSSBS FILLS IN THE IOBIOFLG BIT, THE IOTYPE BYTE, THE DCBOFLGS BIT, THE BUFFER LENGTH, THE BUFFER ADDRESS, THE DECB I/O STARTED BIT, THE IOB POINTER IN THE DECB AND THE ECB POINTER IN THE IOB. CONTROL IS THEN PASSED TO THE DMSSEB ROUTINE TO DO THE I/O AND FILL IN THE ECB. AFTER CONTROL IS PASSED BACK TO DMSSBS FROM DMSSEB, CONTROL IS PASSED BACK TO THE USER. * IF THE WL (CREATE A BDAM DATA SET) OPTION IS SPECIFIED, THE NUMBER OF RECORDS IN THE DATA SET EXTENT MUST BE SPECIFIED USING THE FILEDEF COMMAND. THE DEFAULT SIZE IS 50 RECORDS.
Calls to Other Routines
DMSSBD, DMSSVT, DMSSEB, DMSTIO