Previous Topic: Using the CommandFacility as a SubprogramNext Topic: Compiler Interface Parameter List


Command Facility Subprogram Overview

Any program can call the command facility compiler (IDMSOCF) as a subroutine to extract information from or update information in the dictionary. The program or dialog passes to IDMSOCF an input file that contains the command facility statements to be used to obtain the desired information. The command facility compiler places the extracted data in an output file, which can be examined and processed by the program or dialog.

The command facility compiler uses these files:

Each of these files consists of 80-byte records. Normally, the compiler controls these files, directing the input and print files to the terminal and discarding the punch file. However, when a program or dialog calls IDMSOCF as a subroutine, the calling program specifies that these three files can be directed to a work-area file, a scratch area, a queue, another program, or a null file. Advantages and disadvantages associated with each of these storage mechanisms are as shown in the following table.

Storage type

Advantages/disadvantages

Work-area file

Offers the fastest access but is limited in size; this mechanism is the best choice for small files.

Scratch area

Can accommodate a large volume of data; however, scratch areas are volatile and may require the calling program to perform I/Os.

Queue

Can accommodate a large volume of data; however, the calling program must perform I/Os and initiate run units to access queues.

User program exit

Offers the most advantages. The user has maximum control over the file's records, selecting certain records for special processing.

Null file

Suppresses the output from IDMSOCF. If the program tries to read the null file, an end-of-file condition is returned immediately.

Combining Storage Types

It may be advantageous to combine two mechanisms. For example, direct the file to a user program exit that directs a work area's overflow to a scratch area. The work area is described under Work-Area File.

Input File Statements

The input file can contain any valid command facility statements. All standard compiler security applies to issuing these statements.

First Statement—CONNECT

To ensure proper access to the compiler, it is recommended that the first command in the input file be CONNECT.

The dictionary named in the CONNECT command must identify the dictionary to be accessed.

Last Statement—END

If an END command is not passed to the compiler at each IDMSOCF invocation, a suspended session is leftover. Thus, causing allocated storage to remain attached to the LTE until the user signs off or the LTE is recycled. It is therefore recommended that the last command in the input file be END to prevent LTE storage build-up.

How the Compiler Is Called

To call the command facility compiler, the user program issues a LINK request, naming the module IDMSOCF and passing seven parameters: a compiler input/output (CIO) block, one compiler input/output file (CIOF) block for each of the three command facility files (input, print, and punch), followed by a user parameter for each of the three files (input, print, and punch).