Get the most out of ILE RPG Header specifications

Header specifications (also known as Control Specifications) seemed to almost disappear back around the turn of the century. However, these nifty statements are back in force especially for the ILE programmer.

H option(*srcstmt:*nodebugio) these probably belong in every program. *srcstmt allows finding the source statement line numbers, as opposed to arbitrary object line numbers, when compiling and debugging. *nodebugio prevents debug from stopping on O/I (jumping to F specs) during source debug.

H optimize(*none)
...*none adds debugging display and modify field values but slower run-time

H decedit(*jobrun)
...how do you want the decimal to appear (.,)
H truncnbr(*no)
...*YES means ignore numeric overflow

H fixnbr(*inputpacked:*zoned)
... tells the compiler to fix data decimal errors (as opposed to fixing the data that caused the error)

H DftActGrp(*no)
*YES acts like a 'normal' (OPM) RPG program while *NO allows ILE features to be used, binding to a service program for example
H ActGrp(*caller)
H bnddir('BIND1':'BIND2')

H datfmt(*MDY/)
...requires 8A fields
H datfmt(*USA/)
...requires 10A fields
H Debug DateEdit(*YMD)

H Option(*XREF, *NOGEN, *SHOWCPY, *EXT) ...specify compiler options as in this example, a cross-referenced listing is created including any externally described files and fields and including copy source but the object is not created (or generated).

H Indent('-') or H Indent(' ') for example
...compile listing shows indentation based on character value specified, only up to two characters though. Spaces are allowed for indentation.

H copyright('Copyright 2009, Ken LeMaster')
adds copyright information available when displaying programs

If  you are frequently changing options whilst compiling RPGLE don't! Put the option in the H spec once and you are set. You may want to put commonly used H specs into a copybook and just include a "/copy" at the top of your program;
H/copy mylib/qrpglesrc,myHspecs

It seems a lot of programmers want to put 'Set Option Optimize *none' on the header but currently this can either be specified on the Compile or by entering a couple of lines of SQLRPGLE:

C/exec sql
C+ Set Option Commit = *None
C/end-exec

There are many other control specifications available. You can find them by prompting your PDM option 14 (or 15 for modules) and prompting CRTBNDRPG and taking the F10 for additional information. Another reference is the: IBM redbooks ILE RPG Reference
Hope this Helps!