Midware Ltd.

H-spec Option Keyword


Sign-up for e-mail notifications

Take our weekly poll

Dow Jones Intraday

Nasdaq Intraday



A nice feature of RPG IV is the ability to specify free-format keywords in H-specs rather than the positional codes of RPG III.  One of these keywords is OPTION, which accepts parameters enclosed in parenthesis, separated by colons.  These options now overrides to compile options.

In V4R1, only two parameters were available for the OPTION keyword - *{NO}SRCSTMT and *{NO}DEBUGIO.  As of V4R5, there are nine options available:

*{NO}XREF:  Determines whether or not to create a cross-reference listing when the module is compiled.

*{NO}GEN:  Determines whether or not to generate a compiled object.

*{NO}SECLVL:  Sets the level of message displayed on compile listing.

*{NO}SHOWCPY:  If *NOSHOWCPY is specified, /copy members are not expanded in the compile listing.  This may be useful if you have a large copy member that defines many procedure prototypes.

*{NO}EXPDDS:  If *NOEXPDDS is coded, externally defined data will not be expanded in the compile listing.

*{NO}EXT:  If *NOEXT is specified, externally defined procedures and fields are not included in the compile listing.

*{NO}SHOWSKP:  Specifying *SHOWSKP will display skipped statements in the compile listing.

The two most useable options however are still probably *{NO}SRCSTMT and *{NO}DEBUGIO.

*{NO}SRCSTMT:  If *NOSRCSTMT is coded or this statement is excluded (*NOSRCSTMT is the default), statements will be re-numbered when compiling the program.  If your program gets a run-time error, the statement indicated will be virtually useless unless you have a copy of compile.  *SRCSTMT will prevent the compiler from renumbering the program's statements.  Offhand I can't think of a reason why you wouldn't want to use *SRCSTMT as your default.

*{NO}DEBUGIO:  If you use the interactive source debugger to step through a program, you'll notice that the debugger will break many times on every I/O statement.  This is because a separate breakpoint is inserted for every field returned from the I/O buffer.  This is not a major problem, really more of an inconvenience.  Coding *NODEBUGIO will only break once for each I/O statement.

If you are running an O/S prior to V4R4, SEU will not recognize the OPTION keyword and will highlight the line as an error.  To get around this problem, exit the program and specify NO to return to editing the program.  When you go back into the program, the line will not be highlighted.

Home Feedback Contents Search

Send mail to midware@midwareservices.com with questions or comments about this web site.
Copyright 2000 Midware, Ltd.

Last Modified:  September 14, 2000