z/OS DFSMS Using Data Sets
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Achieving Device Independence

z/OS DFSMS Using Data Sets
SC23-6855-00

Device independence is the characteristic of programs that work on any type of device, DASD or tape, for example. Achieving device independence is possible only for a sequential data set because input or output can be on DASD, a magnetic tape drive, a card reader or card punch, a printer, a spooled data set, a TSO/E terminal, or a dummy data set. Other data set organizations (partitioned, direct, and VSAM) are device-dependent because they require the use of DASD.

A dummy data set is a DD statement on which the first parameter is DUMMY or you coded the DDNAME= parameter but there is no DD statement by that name. You can use BSAM or QSAM with a dummy data set. A WRITE or PUT macro has no effect. A GET macro or the CHECK macro for the first READ macro causes your EODAD routine to be called.

Device independence can be useful for the following tasks:
  • Accepting data from several recording devices, such as a disk volume, magnetic tape, or unit-record equipment. This situation could arise when several types of data acquisition devices are feeding a centralized installation.
  • Bypassing restrictions imposed by the unavailability of I/O devices (for example, when devices on order have not been installed).
  • Assembling, testing, and debugging on one system or device type and processing on a different one. For example, an IBM 3380 Direct Access Storage drive can be used as a substitute for a magnetic tape unit.
  • Testing TSO commands such as REXX execs in the TSO/E background.
To make your program device independent, take the following actions:
  • Omit all device-dependent macros and parameters from your program. For maximum efficiency it is best to omit the BLKSIZE parameter with a BSAM, BPAM or QSAM DCB. See System-Determined Block Size.
  • Supply the parameters on your data definition (DD) statement, data class, or during the OPEN exit routine. That is, do not specify any required device-dependent parameters until the program is ready for execution. Your program can learn many of the device characteristics by issuing the DEVTYPE macro.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014