The MFUPP preprocessor is invoked using the PREPROCESS Compiler directive.
The following directives can be used with the MFUPP preprocessor:
- CONFIRM, C
- Specifies whether directives are to be shown on the screen, if accepted.
- Permissible values: CONFIRM | NOCONFIRM, C | NOC
- Default: NOCONFIRM
- EXEC-REPORT-FILE, ERF
- Creates a catalog file of the the EXEC statements that can be mocked. This file is generated with an
mfupp-et extension, and can be used with the test runner command to create a sample mock source file; see
generate-exec-mock-snippet in
Test Runner Syntax Options for more information.
- By default, an entry is created for each EXEC statement. If you have identical EXEC statements within the source file, they
will be cataloged multiple times, and when you use the catalog file to generate the snippets (using the generate-exec-mock-snippet
directive), you may receive a
COBCH0304 Procedure
proc-name name not unique error message. If you receive such an error, generate the catalog file with the EXEC-REPORT-FILE directive instead, which
includes a sequence number for all catalog entries, and uses this number when creating the snippets, ensuring each snippet
is unique.[1]
- Permissible values: EXEC-REPORT-FILE, ERF |
EXEC-REPORT-FILE"NOINCLUDE-SEQ-ID", ERF"NOINCLUDE-SEQ-ID", EXEC-REPORT-FILE"NOISI", ERF"NOISI"
- Default: EXEC-REPORT-FILE"NOINCLUDE-SEQ-ID"
- IGNORE-PRG-PREFIX, IPP
- Changes program-ids that the preprocessor will ignore (that is, will not pass execution to the controller entry point when
the program is called).
- Permissible values: IGNORE-PRG-PREFIX"file-prefix" | NOIGNORE-PRG-PREFIX, IPP"file-prefix" | NOIPP
- Default: IGNORE-PRG-PREFIX"MFUT,MFUM,Test"
- INSERT-LS, IL
- Inserts a local-storage section if the source under test is not enabled for recursion. (This avoids a
COBRT166 Recursive COBOL CALL is illegal error, as the preprocessor requires source to be compiled for recursion).
- Permissible values: INSERT-LS, IL | NOINSERT-LS NOIL
- Default: INSERT-LS
- LK-PREFIX, LKP
- Changes the "linkage section" copybook filename insertion prefix; see
Inserting Test Code into Source Code. NOLK-PREFIX and NOLKP reset the prefix back to its default.
- Permissible values: LK-PREFIX"file-prefix" | NOLK-PREFIX, LKP "file-prefix" | NOLKP
- Default: LK-PREFIX"MFULK_"
- MOCK, M
- Turns on or off the instrumentation of the program under test.
- Permissible values: MOCK["SQL|PROGRAM"] | NOMOCK
- Default: NOMOCK
- PD-PREFIX, PDP
- Changes the "procedure division" copybook filename insertion prefix; see
Inserting Test Code into Source Code. NOPD-PREFIX and NOPDP reset the prefix back to its default.
- Permissible values: PD-PREFIX"file-prefix" | NOPD-PREFIX, PDP"file-prefix"| NOPDP
- Default: PDS-PREFIX"MFUPD_"
- PDS-PREFIX, PDSP
- Changes the "procedure division (start)" copybook filename insertion prefix; see
Inserting Test Code into Source Code. NOPDS-PREFIX and NOPDSP reset the prefix back to its default.
- Permissible values: PDS-PREFIX"file-prefix" | NOPDS-PREFIX, PDPS"file-prefix"| NOPDPS
- Default: PDS-PREFIX"MFUPDS_"
- SQL
- Changes behavior of how EXEC SQL statements are processed during a test run. You can remove the EXEC SQL statements from a
test run, to allow easier access to the business logic under test.
Restriction: The unit testing framework does not currently process EXEC SQL statements, even when SQL"IGNORE" is not set.
- Permissible values: SQL"IGNORE"
- Default: not set.
- VERBOSE, V
- Specifies whether verbose messages are to be shown on the screen.
- Permissbile values: VERBOSE | NOVERBOSE
- Default: NOVERBOSE
- WS-PREFIX, WSP
- Changes the "working-storage section" copybook filename insertion prefix; see
Inserting Test Code into Source Code.NOWS-PREFIX and NOWSP reset the prefix back to its default.
- Permissible values: WS-PREFIX"file-prefix" | NOWS-PREFIX, WSP"file-prefix" | NOWSP
- Default: WS-PREFIX"MFUWS_"
Example
cobol myprog.cbl preprocess"mfupp" MOCK PD-PREFIX"MFUPRO_" endp;
Tip: You can store the directives to be used with the preprocessor in a directives file, named
mfupp.dir. In this file, specify only the directives shown above, and only one per line. When using the file, ensure it is in your
working directory, and then specify the preprocessor without any directives; for example:
cobol myprog.cbl preprocess"mfupp" endp;