Previous Topic: Wider range of substitution variablesNext Topic: Exit program call functionality


Separation of pre- and post-compilation commands

Pre-compilation commands and post-compilation commands can be separated through the use of one or more Z* (compilation override) directives.

Note: Due to backwards-compatibility, directives can be in standalone form or in block form. Details of these forms and their different functionality can be located within the 'Integration with CA 2E using the EXCUSRSRC section.

Any Y* or P* directives which appear before the first Z* directive will be processed before the source member is compiled. Any Y* or P* directives which appear after the first Z* directive will be processed after the source member is compiled. If multiple Z* directives appear in the source member separated by other compile preprocessor directives, the first Z* directive will determine the separation of pre-compilation and post-compilation commands (but all subsequent Z* directives will be processed as part of the compilation command).

If both pre-compilation commands and post-compilation commands are required but no compilation overrides are required, a blank Z* directive (a directive containing only a Z* or a /*Z:) or a Z* directive containing only the compilation command itself can be used to separate pre-compilation commands and post-compilation commands, e.g.:

Y* SNDMSG MSG('About to compile &N...') TOUSR(*REQUESTER)

Z*
Y* SNDMSG MSG('Compilation completed!') TOUSR(*REQUESTER)

or

Y* SNDMSG MSG('About to compile &N ...') TOUSR(*REQUESTER)
 Z* CRTBNDRPG
Y* SNDMSG MSG('Compilation completed!') TOUSR(*REQUESTER)

In this case, the compile preprocessor will recognize that the command in the second Y* directive should be executed after the compilation command has been executed.

Both pre-compilation and post-compilation commands can contain the full range of substitution variables.