MDECK

The MDECK compiler option specifies that a copy of the updated input source after library processing (that is, the result of COPY, BASIS, REPLACE, EXEC SQL INCLUDE, EXEC SQLIMS INCLUDEStart of change, and conditional compilation directive statementsEnd of change) is written to a file.

If Enterprise COBOL is running under z/OS® UNIX, the MDECK output is written in the current directory to a file that has the same name as the COBOL source file and a suffix of .dek. For Enterprise COBOL running under TSO or batch, the MDECK output is written to the data set defined by the SYSMDECK DD allocation, which must specify an MVS™ data set that has RECFM F or FB and an LRECL of 80 bytes.

Note: Start of changeWhen compiling under z/OS TSO or batch, the COBOL compiler requires the SYSMDECK data set allocation for all compilations, no matter if you specify the MDECK or NOMDECK option. The SYSMDECK DD allocation can be specified as either a temporary dataset or a permanent cataloged/uncatalogued data set.End of change

MDECK option syntax

Read syntax diagramSkip visual syntax diagramNOMDECKMDECK(COMPILENOCOMPILE)

Default is: NOMDECK

Abbreviations are: NOMD | MD | MD(C | NOC)

Option specification:

You cannot specify the MDECK option in a PROCESS (or CBL) statement. You can specify it only in one of the following ways:

  • Start of changeIn an OPTFILE (as long as the OPTFILE is not specified in a PROCESS or CBL statement)End of change
  • In the PARM parameter of JCL
  • As a cob2 command option
  • As an installation default
  • In the COBOPT environment variable

Suboptions:

  • When MDECK(COMPILE) is in effect, compilation continues normally after library processing and generation of the MDECK output file have completed, subject to the settings of the COMPILE | NOCOMPILE, DECK | NODECK, and OBJECT | NOOBJECT compiler options.
  • When MDECK(NOCOMPILE) is in effect, compilation is terminated after library processing has completed and the expanded source program file has been written. The compiler does no further syntax checking or code generation regardless of the settings of the COMPILE, DECK, and OBJECT compiler options.

If you specify MDECK with no suboption, MDECK(COMPILE) is implied.

Contents of the MDECK output file:

If you use the MDECK option with programs that contain EXEC CICS, EXEC SQL, or EXEC SQLIMS statements, these EXEC statements are included in the MDECK output as is. However, if you compile using the SQL or SQLIMS option, the corresponding EXEC SQL INCLUDE or EXEC SQLIMS INCLUDE statements are expanded in the MDECK output.

CBL, PROCESS, *CONTROL, and *CBL card images are passed to the MDECK output file in the proper locations.

For a batch compilation (multiple COBOL source programs in a single input file), a single MDECK output file that contains the complete expanded source is created.

Any SEQUENCE compiler-option processing is reflected in the MDECK file.

COPY statements are included in the MDECK file as comments.