Use the EXIT option to provide user-supplied modules in place of various compiler functions.
For compiler input, use the INEXIT suboption to provide a module in place of SYSIN (primary compiler input), and use the LIBEXIT suboption to provide a module in place of SYSLIB (copy library input). For compiler output, use the PRTEXIT suboption to provide a module in place of SYSPRINT (the compiler listing file).
To provide a module that will be called for each SYSADATA (auxiliary compilation information) record immediately after the record has been written out to the file, use the ADEXIT suboption.
To customize compiler messages (change their severity or suppress them, including converting FIPS (FLAGSTD) messages to diagnostic messages to which you assign a severity), use the MSGEXIT suboption. The module that you provide to customize the messages will be called each time the compiler issues a diagnostic message or a FIPS message.
When creating your exit module, ensure that the module is linked as a shared library module before you run it with the COBOL compiler. Exit modules are invoked with the system linkage convention of the platform.
EXIT option syntax .-NOEXIT-----------------------------------. >>-+------------------------------------------+---------------->< | .------------------------------. | | V | | '-EXIT(---+--------------------------+-+-)-' +-INEXIT(-+-------+-mod1)--+ | '-str1,-' | +-NOINEXIT-----------------+ +-LIBEXIT(-+-------+-mod2)-+ | '-str2,-' | +-NOLIBEXIT----------------+ +-PRTEXIT(-+-------+-mod3)-+ | '-str3,-' | +-NOPRTEXIT----------------+ +-ADEXIT(-+-------+-mod4)--+ | '-str4,-' | +-NOADEXIT-----------------+ +-MSGEXIT(-+-------+-mod5)-+ | '-str5,-' | '-NOMSGEXIT----------------'
Default is: NOEXIT
Abbreviations are: NOEX|EX(INX|NOINX, LIBX|NOLIBX, PRTX|NOPRTX, ADX|NOADX, MSGX|NOMSGX)
Option specification: You cannot specify the EXIT option in a PROCESS (or CBL) statement. You can specify it only in one of the following ways:
You can specify the suboptions in any order, and can separate them by either commas or spaces. If you specify both the positive and negative form of a suboption, the form specified last takes effect. If you specify the same suboption more than once, the last one specified takes effect.
If you specify the EXIT option without providing at least one suboption (that is, you specify EXIT()), NOEXIT will be in effect.
The names mod1, mod2, mod3, mod4, and mod5 can refer to the same module.
The suboptions str1, str2, str3, str4, and str5 are character strings that are passed to the load module. These strings are optional. They can be up to 64 characters in length, and you must enclose them in single quotation marks. You can use any character in the strings, but any included single quotation marks must be doubled. Lowercase characters are folded to uppercase.
Character string formats: If one of str1, str2, str3, str4, or str5 is specified, that string is passed to the appropriate user-exit module in the following format, where LL is a halfword (on a halfword boundary) that contains the length of the string.
| LL | string |