Sign in

docs RPG Reference

Handling of Directives by the RPG Preprocessor

Handling of Directives by the RPG Preprocessor

The handling of compiler directives by the RPG preprocessor depends on the options specified on the PPGENOPT parameter on the compile command. There are several actions the preprocessor can take on a particular directive:

  • The directive may be kept in the generated source file (indicated by “keep” in the table below)
  • The directive may be removed from the generated source file (indicated by “remove” in the table below)
  • The directive may be kept in the generated source file, but as a comment (indicated by “comment” in the table below)

In general, with option *RMVCOMMENT, only the directives neccessary for successful compilation are output to the generated source file. With option NORMVCOMMENT, the directives not necessary for successful compilation of the generated source file are converted into comments.

The following table summarizes how each directive is handled by the preprocessor for the various PPGENOPT parameter values:

Directive*RMVCOMMENT*NORMVCOMMENT
*EXPINCLUDE*NOEXPINCLUDE*EXPINCLUDE*NOEXPINCLUDE
/COPYremoveremovecommentcomment
/DEFINEremovekeepcommentkeep
/EJECTremoveremovekeepkeep
/ELSEremoveremovecommentcomment
/ELSEIFremoveremovecommentcomment
/END-EXECkeepkeepkeepkeep
/END-FREEkeepkeepkeepkeep
/ENDIFremoveremovecommentcomment
/EOFremoveremovecommentcomment
/EXECkeepkeepkeepkeep
/FREEkeepkeepkeepkeep
/IFremoveremovecommentcomment
/INCLUDEremovekeepcommentkeep
/RESTOREkeepkeepkeepkeep
/SETkeepkeepkeepkeep
/SPACEremoveremovekeepkeep
/TITLEremoveremovekeepkeep
/UNDEFINEremovekeepcommentkeep