DMSDLB is invoked when the CMS/DOS DLBL command is entered. DMSDLB associates a DTF (Define The File) table filename with a logical unit.
This function is performed by creating a control block called a DOSCE, which contains information defining a DOS file used during jcb
execution. DLBL is valid only for sequential or disk devices.
This information parallels the label information written on a real BOS SYSRES unit under DOS/VS. The DOSCB contains such information as
the name, type, and mode of the referenced dataset, its device type
code, its logical unit specification, and its dataset type (SAM or YSAM) A DOSCB is created for each file specified by the user during a
terminal session. The DOSCBs are chained to each other and are anchored
in NUCON at the field DOSFIRST. The chain remains intact for the entire
session, unless an abend occurs or the user specifically clears an entry
in the the DOSCB chain. A given DOSCB is accessed when an OPEN macro is
issued from an executing user program.
The overall logic flow for DMSDLB is as follows:
1. Scans the command line to ensure that any options entered are valid
(that is, anything to the right of the open parenthesis).
2. Processes the first operand (ddname or *). When ddname is
specified, loop through the DOSCB chain to find a matching ddname.
If none is found, DMSDLB calls DMSFRE to get storage to create a
new DOSCB for this file. The old copy of the DOSCB is then saved
so that, in case of errors during processing, it can be retrieved
intact. The new copy of the DOSCB contains updates and DOSCB replaces the old copy if there are no errors.
3. The mode specification is checked to ensure that it is a valid mode letter; if the file is a CMS file, the mode letter must specify a CMS disk. If DSN has been specified, the mode letter must be for a non-CMS disk.
4. Process each option on the command line appropriately.
5. If EXTENT or MULT is specified, a separate tlock of free storage is
obtained to contain information about the extent, for example, a
block is obtained to contain the DOS data set name. 5. Check for errors. If there are errors, any blocks created during
processing are purged and an error message is issued. If there are
no errors, restore the old block, which has heen modified to
reflect current processing, and return control to DHSITS. PROCESS CMS/DOS OPEN AND CLOSE FUNCTIONS The CMS/DOS OPEN routines are invoked in response to DOS OPEN macros.
They operate on DTF (define the file) tables and ACE (access method
control block) tables created when the DTFxx and ACB macros are issued
from an executing user program. These tables contain information such as
the LOG unit specification for the file, the DTF type of the file, the
device code for the file, and so forth. The informaticn in the tables
varies depending upon the type of DTF specified (that is, the table
generated by a unit record DTF macro is slightly different from the
table generated by a DTF disk macro). 2-140 IBM VM/370 System Logic and program Determination--Volume 2
Five routines are invoked to perform OPEN functions, DftSOPL, DeSOR1, DMSOR3, and DMSBOP. DMSCLS perforas the CLOSE function.
Depending on the type of OPEN .acro issued from a user program, one of
five CMS/DOS OPEN routines could be invoked. OPENR macros give control
to DMSOR1 and, depending on the DTF type specified, DMSOR2 or DMSOR3 .ay be invoked. These three routines (DMSOR1,DMSOR2, and DftSOR3) request
the relocation of a specified file. DMSOPL is invoked by the DOS/VS coapilers when they need access to a source statement library. These
routines are mainly interface routines to DMSBOP, which performs the
.ain function of opening the specified file. Each of the routines calls DMSBOP. DMSBOP is the eMS/DOS routine that simulates the DOS/VS OPEN function. The basic function of DMSBOP is the initialization of DTF
tables (that is, setting fields in specified DTFs for use by the DOS/VS LIOCS routines). When a DOS problem program is compiling, a list of DTFs and ACBs is
built. At execution time, this list is passed to DMSBOP. The logic
flow of DMSBOP is as follows:
1. Scans the list of DTF and ACB addresses, handling each iteaa in the
list in line. When the OPEN macro expands, register i points to
the name of the SSB transient to receive control ($$BOPEN) and
register 0 Foints to the list of DTF/ACB addresses to be opened.
2. When an ACB is encountered in the table, control is passed directly
to the VSAM OPEN routine, $$BOVSAM. The VSIM routine is
responsible for opening the file and returning control to DMSBOP. 3. When a DTF is encountered in the table, DMSBOP itself handles the OPEN: a. For reader/punch files (DTFCD), the OPEN bit in the DTF table
is turned on.
b. For printer files (DTFPR), if two IOAREAs are specified, the IOREG is loaded with the address of the appropriate IOIREI. Next, the PUB index byte associated with the logical unit
specified in the DTF is checked to ensure that a physical
device has been assigned and the PUB device code is then
analyzed. The OPEN bit in the DTF table is then turned on.
c. For console files (DTFCN), no OPEN logic is required.
d. For tape files (DTFMT), the PUB device type code must specify TAPE. If an IOREG is specified (for output tapes only), the
address of the appropriate rOAREI is placed in it. For input
files, there is separate processing for tapes with standard
label, nonstandard label, and no label. For output tapes, both
tape data files and work tape files are treated as no label
tapes. CMS Method of operation and Program Organization 2-141
Previous Page Next Page