Chapter Contents

Previous

Next
MVS Low-Level I/O Functions

Introduction

This chapter discusses functions that can be used for low level access to MVS sequential data sets. Three sets of functions are provided, two of which perform low-level I/O, and the third of which performs file allocation. There are two I/O interfaces: a full-function interface to BSAM and an interface similar to QSAM. The QSAM-like interface is record-oriented rather than block-oriented, and so is easier to use in many situations. Both of these interfaces access files by DDname, not by data set name. An additional function, osdynalloc , is provided to interface to the MVS dynamic allocation facility. This function can be used to allocate a data set to a DDname, or to obtain information about existing allocations. These functions are characterized as low level because they use the MVS access method and supervisor services directly.

This chapter covers these low-level I/O functions. Note that these functions are not portable. Though these functions are intended for use under MVS, they should function correctly under CMS, subject to the limitations of CMS BSAM simulation. MVS low-level I/O can be used in the minimal SPE environment as well as with the full run-time library.

MVS low-level I/O is supplied in source form, so it can be easily modified to support other access methods or unusual file types. See members L$UBSAM, L$UDCB, and L$UOSIO in SASC.SOURCE (MVS) or LSU MACLIB (CMS).

The direct BSAM interface functions are as follows:
osbclose closes a BSAM DCB, and optionally frees the DCB.
osbdcb allocates and initializes a BSAM DCB.
osbldl returns location information for PDS members.
osbopen opens a BSAM DCB.
osbopenj opens a BSAM DCB using a TYPE=J OPEN macro.
oscheck checks a read or write for errors.
osfind finds a PDS member.
osfindc positions to a PDS member using BLDL data.
osnote returns the current file position.
ospoint repositions a file.
osread reads a block from a file.
ostclose temporarily closes a BSAM DCB using a TYPE=T CLOSE macro.
osstow updates a PDS directory.
oswrite writes a block to a file.
The record-oriented interface functions are as follows:
osclose closes and frees a DCB opened by osopen .
osdcb allocates and initializes a DCB for record access.
osflush flushes pending I/O so the file can be repositioned.
osget reads a record from a file.
osopen opens a DCB for record access.
osopenj opens a DCB for record access using a TYPE=J OPEN macro.
osseek repositions a file.
osput writes a record to a file.
ostell returns the current file position.

The functions osfind , ostclose , and osstow from the BSAM interface can be used with files opened using the record interface. You can also initialize a DCB using osdcb and then process it entirely with the direct BSAM interface. The IBM publication MVS/DFP Using Data Sets (SC26-4749) contains additional information about BSAM.

There is only one dynamic allocation interface function, osdynalloc . This function offers a number of different subfunctions, including allocation, deallocation, concatenation, and retrieval of attributes of data sets. The IBM publication MVS/ESA Application Development Guide: Authorized Assembler Language Programs (GC28-1645) provides additional information about dynamic allocation.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.