Disk File Interface Routine

DMTCOMFI, the disk file interface routine, simplifies file access on any disk accessed in the RSCS virtual machine. DMTCOMFI gives RSCS tasks and exit routines the following services:
  • Access to files by ddname or file name/file type
  • Conditional and unconditional support for imbed files
  • Diagnostic error messages.

The calling task must give DMTCOMFI a FILREQ parameter list. The FILREQ indicates if the file is identified by a predefined ddname or if DMTCOMFI must dynamically define a ddname to access the file (GCS only accesses files by their ddnames).

The FILREQ also contains flags that indicate if IMBED records are to be interpreted and if the IMBED support is conditional or unconditional. If an IMBED is unconditional and DMTCOMFI cannot successfully access a file specified on an IMBED record, it closes all the files associated with the FILREQ block. DMTCOMFI returns a nonzero return code to the calling task. If DMTCOMFI cannot successfully access a file for a conditional IMBED, it ignores the IMBED record.

The calling task may also give DMTCOMFI an initialized MSGBLOK. DMTCOMFI uses this MSGBLOK to issue messages if it finds errors while accessing a file. If it does not receive a MSGBLOK, DMTCOMFI issues return codes to the calling task but does not issue error messages.

When a task requests records from a file that is identified by file name and file type in the FILREQ or by an IMBED record, RSCS dynamically runs a GCS FILEDEF command to associate a ddname with the requested file. Unique ddnames are assigned to each request. As described in Dynamic ddname Allocation, DMTRES manages the pool of dynamic ddnames available to RSCS. This pool contains all ddnames between @F000@ through @F999@.

For each file it opens, DMTCOMFI reserves a file work area (FILWORKA). All FILWORKAs associated with a FILREQ are placed in a queue that is anchored at the CVT. The FILWORKA for the currently active file is anchored in the FILREQ. The DMTCOM routines add and delete FILWORKA entries from this stack as IMBED records are processed. The stack can contain a maximum of 10 FILWORKA entries. Each FILWORKA contains the task ID of its owning task. RSCS can then ensure that all work areas are freed when the task terminates.