Control Specifications

The control-specification statements, identified in free-form specifications by the CTL-OPT operation code, or in fixed-form specificiations by an H in position 6, provide information about generating and running programs. However, there are three different ways in which this information can be provided to the compiler and the compiler searches for this information in the following order:
  1. Control statements included in your source
  2. A data area named RPGLEHSPEC in *LIBL
  3. A data area named DFTLEHSPEC in QRPGLE

Once one of these sources is found, the values are assigned and keywords that are not specified are assigned their default values.

See the description of the individual entries for their default values.

Note: Compile-option keywords do not have default values. The keyword value is initialized with the value you specify for the CRTBNDRPG or CRTRPGMOD command.
Tip:

The control specification keywords apply at the module level. This means that if there is more than one procedure coded in a module, the values specified in the control specification apply to all procedures.

Control statements in a source file

If you specify the control statements in your source file, the following rules apply:
  • Control statements can be specified on multiple lines. A free-form control statement begins with CTL-OPT and ends with a semi-colon. A fixed-form control statement contains one or more fixed form specifications with H in column 6.
  • You can mix free-form and fixed-form control statements.
  • If you code more than one control statement, and a particular keyword cannot be repeated, such as the ALWNULL keyword, then that keyword can appear in at most one control statement.