Compiling and Executing CA IDMS Programs (COBOL)

A CA IDMS COBOL source program contains DML statements for the precompiler to process. The precompiler converts DML statements into COBOL CALL statements and copies information from the data dictionary into the application program. After successful compilation and link editing, the application program can be executed.
idmscu
A CA IDMS COBOL source program contains DML statements for the precompiler to process. The precompiler converts DML statements into COBOL CALL statements and copies information from the data dictionary into the application program. After successful compilation and link editing, the application program can be executed.
Compiling Programs
Three components prepare a COBOL DML program for execution: the precompiler, the COBOL compiler, and the linkage editor:
  1. The precompiler converts the DML statements to COBOL CALL statements and copies information from the data dictionary into the application program. For example, the precompiler can copy database record descriptions, file definitions, map records, map definitions, and other predefined modules such as the IDMS communications block into the program.
    The precompiler generates an output file that serves as input to the COBOL precompiler and as an optional source listing. The output file differs from the source input to the precompiler in the following ways:
    • Source code (such as the IDMS communications block and the IDMS-STATUS routine) has been added to the program.
    • DML statements have been replaced by COBOL CALL statements and have been changed to comment entries (asterisk in column 7).
    The precompiler also produces a listing of the following errors:
    • Incorrect DML entries
    • Statements that are inconsistent with the declared subschema view of the program
    • Any other error conditions that are detected during DMLC processing
    • Warning messages indicating source code conditions that could adversely affect the run units that are using the program
  2. The COBOL compiler compiles the source program after the precompiler has successfully processed it. The COBOL compiler output consists of an object program and a source listing that includes any generated diagnostics.
  3. The linkage editor link edits the object program into a specified load library. The linkage editor output consists of a load module (or phase) and a link map.
The job control language that is required to execute each step is listed in DML Precompile, COBOL Compile, and Link-Edit JCL.
The following figure shows the component steps to prepare a COBOL DML program for execution:
This figure shows the component steps to prepare a COBOL DML program for execution.
Executing Programs
At run time, CA IDMS requests are treated as application program subroutine calls. When the subroutine call is executed, control passes to the DBMS or to the DC system, which processes the requested function.
A CA IDMS program must be defined to the CA IDMS system in which it operates. The program can be defined at system generation or at run time by using a DCMT VARY DYNAMIC PROGRAM command.
The following COBOL features are
not
used in programs running in an online environment under CA IDMS:
  • ENVIRONMENT and DATA DIVISION entries that are typically associated with file management (for example, INPUT-OUTPUT SECTION, FILE SECTION).
  • The Report Writer and Segmentation features, and features that are invoked by the SORT, EXHIBIT, TRACE, DISPLAY, ACCEPT, STRING, UNSTRING, and INSPECT commands. The EXAMINE and TRANSFORM verbs are not valid verbs in COBOL-II because their logic has been incorporated into the INSPECT verb. Also, the EXTERNAL clause of the record statement is invalid for all COBOL versions.
    The INSPECT, STRING, and UNSTRING commands are restricted because they issue supervisor calls in some environments. This restriction applies mainly when running VS COBOL on a VSE or z/OS operating system. This restriction does not apply when using LE-compliant COBOL with the IBM runtime Language Environment. See VS COBOL II Support for considerations when using these commands with VS/COBOL II.
  • The READ, WRITE, OPEN, and CLOSE I/O statements.
  • The COBOL compiler DEBUG option.
  • The COUNT, FLOW, STATE, ENDJOB, TEST, RESIDENT, DYNAM, and SYMDMP commands (OS only). 
    The TEST compile option can be used for a program that was compiled by a Language Environment compliant compiler. However, the DEBUG runtime option must not be used in the online environment. A load module that is compiled with the TEST option can be run with the DEBUG runtime option in batch. Running the load module like this lets you test a load module in a batch environment and then run the module in an online environment without recompiling it.
  • The COUNT, FLOW, STATE, STXIT, and SYMDMP commands (z/VSE only).
  • Any feature that can lead to the issuance of a supervisor call (SVC). Supervisor calls can inhibit system performance and crash the DC system.
Usage of the DBCS COBOL compile-time option by a CA IDMS program can lead to IGYPS0156-E run-time errors. Programs using LRF are especially susceptible to this problem. This option is the default for LE/COBOL compilers, starting with z/OS. 3.2.0. Compile CA IDMS programs using the NODBCS option.
The COBOL compiler provides a TRUNC option. Use this option with care in any CA IDMS program that accesses database key values. Exercise particular care when arithmetic operations are performed on the database key, for example multiplying a page number by the database key radix. If an inappropriate TRUNC value is specified, unexpected results can occur because COBOL can truncate numeric values to fit the PICTURE clause. Avoid this problem by using the compiler option TRUNC(BIN). On some older COBOL compilers, the equivalent option is NOTRUNC.
For more information about the TRUNC option, see the documentation of your compiler vendor.