Previous Topic: Source DirectivesNext Topic: Coding Source Directives


Types of Source Directive

Pre-compile/Post-compile directives can be of three types: Title directives (T), Pre-compile directives (Y), and Compiler directives (Z).

A Title directive specifies the text to be used as object text on the compiled object. The text on the source member will also be updated to match that on the object. If the source contains no title, the source member text, if present, will be used instead. If text is specified using the text parameter on the programmers menu (QPGMMENU), that text will be used in preference to the source member text of title text.

Note: Title directives, when specified within EXCUSRSRC functions, do not get generated into the source. This is a feature limitation.

Pre-compile/Post-compile directives specify command requests to be executed before, or after the actual compile is run, or both. The main application of this is to have file overrides in effect during a batch compile, so that an object can be compiled using an existing file: for instance, OVRDBF FILE(X) TOFILE(Z/Y). This might be desirable for say, an RPG III program which doubly defines a file, once as update, once as input. Instead of having to have either a dummy copy of the file with a different name, or to carry out the compile interactively, the required override can be stored in the source. Another possible application is to override a message file at compile time. Yet another could be to create a data area necessary for the compile in library QTEMP. If a Pre-compile/Post-compile directive is placed before the compiler directive, its command request will be executed before compilation; if placed after the compiler directive, its command request will be executed after compilation. The following substitution symbols may be used in post-compile directives:

Compiler directives specify extra parameters to be added to the actual create command string. For example: