RULES

The RULES option allows or disallows certain language capabilities and lets you choose semantics when alternatives are available. It can help you diagnose common programming errors.

Read syntax diagramSkip visual syntax diagram
             .-,------------------------------------------------------------.      
             V   .-IBM-.                                                    |      
>>-RULES--(----+-+-ANS-+--------------------------------------------------+-+--)-><
               | .-BYNAME---.                                             |        
               +-+-NOBYNAME-+---------------------------------------------+        
               | .-CONTROLLED---.                                         |        
               +-+-NOCONTROLLED-+-----------------------------------------+        
               | .-NODECSIZE-.                                            |        
               +-+-DECSIZE---+--------------------------------------------+        
               | .-ELSEIF---.                                             |        
               +-+-NOELSEIF-+---------------------------------------------+        
               | .-EVENDEC---.                                            |        
               +-+-NOEVENDEC-+--------------------------------------------+        
               | .-GLOBALDO---.                                           |        
               +-+-NOGLOBALDO-+-------------------------------------------+        
               | .-GOTO-------------------------------.                   |        
               +-+-NOGOTO--+------------------------+-+-------------------+        
               |           |    .-STRICT-------.    |                     |        
               |           '-(--+-LOOSE--------+--)-'                     |        
               |                '-LOOSEFORWARD-'                          |        
               | .-NOLAXBIF-.                                             |        
               +-+-LAXBIF---+---------------------------------------------+        
               | .-LAXCONV-------------------------.                      |        
               +-+-NOLAXCONV--+------------------+-+----------------------+        
               |              |    .-ALL----.    |                        |        
               |              '-(--+-SOURCE-+--)-'                        |        
               | .-NOLAXCTL-.                                             |        
               +-+-LAXCTL---+---------------------------------------------+        
               | .-NOLAXDCL-.                                             |        
               +-+-LAXDCL---+---------------------------------------------+        
               | .-NOLAXDEF-.                                             |        
               +-+-LAXDEF---+---------------------------------------------+        
               | .-LAXINTERFACE---.                                       |        
               +-+-NOLAXINTERFACE-+---------------------------------------+        
               | .-LAXENTRY-------------------------.                     |        
               +-+-NOLAXENTRY--+------------------+-+---------------------+        
               |               |    .-STRICT-.    |                       |        
               |               '-(--+-LOOSE--+--)-'                       |        
               | .-NOLAXIF-.                                              |        
               +-+-LAXIF---+----------------------------------------------+        
               | .-LAXINOUT---.                                           |        
               +-+-NOLAXINOUT-+-------------------------------------------+        
               | .-LAXLINK---.                                            |        
               +-+-NOLAXLINK-+--------------------------------------------+        
               | .-LAXMARGINS---------------------------.                 |        
               +-+-NOLAXMARGINS--+--------------------+-+-----------------+        
               |                 |    .-STRICT---.    |                   |        
               |                 '-(--+-XNUMERIC-+--)-'                   |        
               | .-LAXNESTED-------------------------.                    |        
               +-+-NOLAXNESTED--+------------------+-+--------------------+        
               |                |    .-ALL----.    |                      |        
               |                '-(--+-SOURCE-+--)-'                      |        
               | .-LAXPUNC---.                                            |        
               +-+-NOLAXPUNC-+--------------------------------------------+        
               | .-LAXQUAL----------------------------------------------. |        
               +-+-NOLAXQUAL--+------------------+--+-----------------+-+-+        
               |              |    .-LOOSE--.    |  |    .-ALL---.    |   |        
               |              '-(--+-STRICT-+--)-'  '-(--+-FORCE-+--)-'   |        
               | .-LAXRETURN---.                                          |        
               +-+-NOLAXRETURN-+------------------------------------------+        
               | .-NOLAXSCALE-.                                           |        
               +-+-LAXSCALE---+-------------------------------------------+        
               | .-LAXSEMI---.                                            |        
               +-+-NOLAXSEMI-+--------------------------------------------+        
               | .-LAXSTG---.                                             |        
               +-+-NOLAXSTG-+---------------------------------------------+        
               | .-LAXSTMT-------------------------.                      |        
               +-+-NOLAXSTMT--+------------------+-+----------------------+        
               |              |    .-ALL----.    |                        |        
               |              '-(--+-SOURCE-+--)-'                        |        
               | .-NOLAXSTRZ-.                                            |        
               '-+-LAXSTRZ---+--------------------------------------------'        

             .-,-------------------------------------------.      
             V   .-NOMULTICLOSE-.                          |      
|--RULES--(----+-+-MULTICLOSE---+------------------------+-+--)--|
               | .-MULTIENTRY-------------------------.  |        
               +-+-NOMULTIENTRY--+------------------+-+--+        
               |                 |    .-ALL----.    |    |        
               |                 '-(--+-SOURCE-+--)-'    |        
               | .-MULTIEXIT-------------------------.   |        
               +-+-NOMULTIEXIT--+------------------+-+---+        
               |                |    .-ALL----.    |     |        
               |                '-(--+-SOURCE-+--)-'     |        
               | .-MULTISEMI-------------------------.   |        
               +-+-NOMULTISEMI--+------------------+-+---+        
               |                |    .-ALL----.    |     |        
               |                '-(--+-SOURCE-+--)-'     |        
               | .-PADDING-------------------------.     |        
               +-+-NOPADDING--+------------------+-+-----+        
               |              |    .-ALL----.    |       |        
               |              '-(--+-SOURCE-+--)-'       |        
               | .-PROCENDONLY-------------------------. |        
               +-+-NOPROCENDONLY--+------------------+-+-+        
               |                  |    .-ALL----.    |   |        
               |                  '-(--+-SOURCE-+--)-'   |        
               | .-RECURSIVE---.                         |        
               +-+-NORECURSIVE-+-------------------------+        
               | .-SELFASSIGN---.                        |        
               +-+-NOSELFASSIGN-+------------------------+        
               | .-UNREF---------------------.           |        
               | |             .-ALL----.    |           |        
               +-+-NOUNREF--(--+-SOURCE-+--)-+-----------+        
               | .-UNREFBASED---------------------.      |        
               | |                  .-ALL----.    |      |        
               +-+-NOUNREFBASED--(--+-SOURCE-+--)-+------+        
               | .-UNREFCTL---------------------.        |        
               | |                .-ALL----.    |        |        
               +-+-NOUNREFCTL--(--+-SOURCE-+--)-+--------+        
               | .-UNREFDEFINED---------------------.    |        
               | |                    .-ALL----.    |    |        
               +-+-NOUNREFDEFINED--(--+-SOURCE-+--)-+----+        
               | .-UNREFENTRY---------------------.      |        
               | |                  .-ALL----.    |      |        
               +-+-NOUNREFENTRY--(--+-SOURCE-+--)-+------+        
               | .-UNREFDEFFILE---------------------.    |        
               | |                    .-ALL----.    |    |        
               +-+-NOUNREFDEFFILE--(--+-SOURCE-+--)-+----+        
               | .-UNREFSTATIC---------------------.     |        
               | |                   .-ALL----.    |     |        
               +-+-NOUNREFSTATIC--(--+-SOURCE-+--)-+-----+        
               | .-YY---.                                |        
               '-+-NOYY-+--------------------------------'        

IBM | ANS
Under the IBM suboption:
  • For operations requiring string data, data with the BINARY attribute is converted to BIT.
  • Conversions in arithmetic operations or comparisons occur as described in the PL/I Language Reference.
  • Conversions for the ADD, DIVIDE, MULTIPLY, and SUBTRACT built-in functions occur as described in the PL/I Language Reference except that operations specified as scaled fixed binary are evaluated as scaled fixed decimal.
  • Nonzero scale factors are permitted in FIXED BIN declarations.
  • If the result of any precision-handling built-in function (ADD, BINARY, and so on) has FIXED BIN attributes, the specified or implied scale factor can be nonzero.
  • Even if all arguments to the MAX or MIN built-in functions are UNSIGNED FIXED BIN, all the arguments are converted to SIGNED, the function is evaluated with these converted arguments, and the result is always SIGNED.
  • Even when you add, multiply, or divide two UNSIGNED FIXED BIN operands, all the operands are converted to SIGNED, the operation is evaluated with these converted arguments, and the result has the SIGNED attribute.
  • Even when you apply the MOD or REM built-in functions to two UNSIGNED FIXED BIN operands, all the arguments are converted to SIGNED, the function is evaluated with these converted arguments, and the result has the SIGNED attribute.
  • Declaring a variable with the OPTIONS attribute implies the ENTRY attribute.
Under the ANS suboption:
  • For operations requiring string data, data with the BINARY attribute is converted to CHARACTER.
  • Conversions in arithmetic operations or comparisons occur as described in the PL/I Language Reference.
  • Conversions for the ADD, DIVIDE, MULTIPLY, and SUBTRACT built-in functions occur as described in the PL/I Language Reference.
  • Nonzero scale factors are not permitted in FIXED BIN declares.
  • If the result of any precision-handling built-in function (ADD, BINARY, and so on) has FIXED BIN attributes, the specified or implied scale factor must be zero.
  • If all arguments to the MAX or MIN built-in functions are UNSIGNED FIXED BIN, the result is UNSIGNED.
  • When you add, multiply, or divide two UNSIGNED FIXED BIN operands, the result has the UNSIGNED attribute.
  • When you apply the MOD or REM built-in functions to two UNSIGNED FIXED BIN operands, the result has the UNSIGNED attribute.
  • Declaring a variable with the OPTIONS attribute does not imply the ENTRY attribute.

Also, under RULES(ANS), the following errors, which the old compilers ignored, produce E-level messages:

  • Specifying a string constant as the argument to the STRING built-in
  • Giving too many asterisks as subscripts in an array reference
  • Qualifying a CONTROLLED variable with a POINTER reference (as if the CONTROLLED variable were BASED)

The default is RULES(IBM).

BYNAME | NOBYNAME
Specifying NOBYNAME causes the compiler to flag all BYNAME assignments with an E-level message.

The default is RULES(BYNAME).

CONTROLLED | NOCONTROLLED
Specifying NOCONTROLLED causes the compiler to flag any use of the CONTROLLED attribute.

Specifying CONTROLLED causes the compiler not to flag the use of the CONTROLLED attribute.

The default is RULES(CONTROLLED).

DECSIZE | NODECSIZE
Specifying DECSIZE causes the compiler to flag any assignment of a FIXED DECIMAL expression to a FIXED DECIMAL variable when the SIZE condition is disabled if the SIZE condition could be raised by the assignment.

Specifying RULES(DECSIZE) might cause the compiler to produce many messages because when SIZE is disabled, any statement of the form X = X + 1 will be flagged if X is FIXED DECIMAL.

The default is RULES(NODECSIZE).

ELSEIF | NOELSEIF
Specifying NOELSEIF causes the compiler to flag any ELSE statement that is immediately followed by an IF statement and suggest that it be rewritten as a SELECT statement.

This option can be useful in enforcing that SELECT statements be used rather than a series of nested IF-THEN-ELSE statements.

The RULES(NOELSEIF) compiler option now also flags ELSE statements immediately followed by an IF statement that is enclosed in a simple DO-END.

The default is RULES(ELSEIF).

EVENDEC | NOEVENDEC
Specifying NOEVENDEC causes the compiler to flag any FIXED DECIMAL declaration that specifies an even precision.

The default is RULES(EVENDEC).

GLOBALDO | NOGLOBALDO
Specifying NOGLOBALDO instructs the compiler to flag all DO loops with control variables that are declared in a parent block.

The default is RULES(GLOBALDO).

GOTO | NOGOTO
Specifying NOGOTO(STRICT) causes the compiler to flag any GOTO statement to a label constant unless the GOTO is exiting an ON-unit.

Specifying NOGOTO(LOOSE) causes the compiler to flag any GOTO statement to a label constant unless the GOTO is exiting an ON-unit or unless the target label constant is in the same block as the GOTO statement.

Start of changeSpecifying NOGOTO(LOOSEFORWARD) causes the compiler to flag any GOTO statement to a label constant unless the GOTO is exiting an ON-unit or unless the target label constant is in the same block as the GOTO statement and comes after the GOTO statement.End of change

The default is RULES(GOTO). When you specify RULES(NOGOTO), the default is STRICT.

LAXBIF | NOLAXBIF
Specifying LAXBIF causes the compiler to build a contextual declaration for built-in functions, such as NULL, even when used without an empty parameter list.

The default is RULES(NOLAXBIF).

Start of changeLAXCONV | NOLAXCONVEnd of change
Start of changeSpecifying RULES(LAXCONV) causes the compiler not to flag arithmetic expressions where an operand does not have arithmetic type.

Specifying RULES(NOLAXCONV) causes the compiler to flag arithmetic expressions where an operand does not have arithmetic type.

ALL
Under ALL, all violations of RULES(NOLAXCONV) are flagged. ALL is the default.
SOURCE
Under SOURCE, only those violations that occur in the primary source file are flagged.

The default is RULES(LAXCONV). When you specify RULES(NOLAXCONV), the default is ALL.

End of change
LAXCTL | NOLAXCTL
Specifying LAXCTL allows a CONTROLLED variable to be declared with a constant extent and yet to be allocated with a differing extent. NOLAXCTL requires that if a CONTROLLED variable is to be allocated with a varying extent, that extent must be specified as an asterisk or as a non-constant expression.
The following code is illegal under NOLAXCTL:
    dcl a bit(8) ctl;
    alloc a;
    alloc a bit(16);
But this code would still be valid under NOLAXCTL:
    dcl b bit(n) ctl;
    dcl n fixed bin(31) init(8);
    alloc b;
    alloc b bit(16);

The default is RULES(NOLAXCTL).

LAXDCL | NOLAXDCL
Specifying LAXDCL allows implicit declarations. NOLAXDCL disallows all implicit and contextual declarations except for BUILTINs and for files SYSIN and SYSPRINT.

The default is RULES(NOLAXDCL).

LAXDEF | NOLAXDEF
Specifying LAXDEF allows so-called illegal defining to be accepted without any compiler messages (rather than the E-level messages that the compiler would usually produce).

The default is RULES(NOLAXDEF).

LAXENTRY | NOLAXENTRY
Specifying LAXENTRY allows unprototyped entry declarations. Specifying NOLAXENTRY causes the compiler to flag all unprototyped entry declarations, that is, all ENTRY declares that do not specify a parameter list.
Note: If an ENTRY should have no parameters, it should be declared as ENTRY() rather than simply as ENTRY.
STRICT
Specifying RULES(NOLAXENTRY(STRICT)) causes the compiler to flag unprototyped entry declarations that have the OPTIONS(ASM) attribute.
LOOSE
Specifying RULES(NOLAXENTRY(LOOSE)) causes the compiler not to flag unprototyped entry declarations that have the OPTIONS(ASM) attribute.

The default is RULES(LAXENTRY). When you specify RULES(NOLAXENTRY), the default is STRICT.

LAXIF | NOLAXIF
Specifying RULES(NOLAXIF) causes the compiler to flag any IF, WHILE, UNTIL, and WHEN clauses that do not have the attributes BIT(1) NONVARYING. It also causes the compiler to flag the assignments of the form x=y=z, but it does not flag assignments of the x=(y=z) form.
The following code will all be flagged under NOLAXIF:
dcl i fixed bin;
dcl b bit(8);
   .
   .
   .
if i then …
if b then …

The default is RULES(NOLAXIF).

LAXINOUT | NOLAXINOUT
Specifying NOLAXINOUT causes the compiler to assume that all ASSIGNABLE BYADDR parameters are input (and possibly output) parameters and hence to issue a warning if the compiler thinks such a parameter has not been initialized.

The default is RULES(LAXINOUT).

Start of changeLAXINTERFACE | NOLAXINTERFACEEnd of change
Start of changeSpecifying NOLAXINTERFACE causes the compiler to flag code that does not contain a valid explicit declaration for each of its external PROCEDUREs.
  • Under NOLAXINTERFACE, the compiler will not flag any MAIN routines.
  • Under NOLAXINTERFACE, the compiler will flag any PROCEDURE that does not have an explicit declaration at the PACKAGE level (and hence any code not in a PACKAGE).
  • Under NOLAXINTERFACE, the compiler will also flag any PROCEDUREs for which the implicit and explicit declarations do not match.

The default is RULES(LAXINTERFACE).

End of change
LAXLINK | NOLAXLINK
Specifying NOLAXLINK causes the compiler to flag any assign or compare of two ENTRY variables or constants if any of the following do not match:
  • The parameter description lists

    For instance, if A1 is declared as ENTRY(CHAR(8)) and A2 as ENTRY(POINTER) VARIABLE, under RULES(NOLAXLINK) the compiler will flag an attempt to assign A1 to A2.

  • The RETURNS attribute

    For instance, if A3 is declared as ENTRY RETURNS(FIXED BIN(31)) and A4 as an ENTRY VARIABLE without the RETURNS attribute, under RULES(NOLAXLINK) the compiler will flag an attempt to assign A3 to A4.

  • The LINKAGE and other OPTIONS suboptions

    For instance, if A5 is declared as ENTRY OPTIONS(ASM) and A6 as an ENTRY VARIABLE without the OPTIONS attribute, under RULES(NOLAXLINK) the compiler will flag an attempt to assign A5 to A6. This is because the OPTIONS(ASM) in the declare of A5 implies that A5 has LINKAGE(SYSTEM)), and in contrast, because A6 has no OPTIONS attribute, it will have LINKAGE(OPTLINK) by default).

The default is RULES(LAXLINK).

LAXMARGINS | NOLAXMARGINS
Specifying NOLAXMARGINS causes the compiler to flag, depending on the setting of the STRICT and XNUMERIC suboption, lines containing nonblank characters after the right margin. This can be useful in detecting code, such as a closing comment, that has accidentally been pushed out into the right margin.

If the NOLAXMARGINS and STMT options are used together with one of the preprocessors, any statements that would be flagged because of the NOLAXMARGINS option will be reported as statement zero (because statement numbering occurs only after all the preprocessors are finished, but the detection of text outside the margins occurs as soon as the source is read).

STRICT
Under STRICT, the compiler flags any line that contains nonblank characters after the right margin.
XNUMERIC
Under XNUMERIC, the compiler flags any line that contains nonblank characters after the right margin except if the right margin is column 72 and columns 73 through 80 all contain numeric digits.

The default is RULES(LAXMARGINS). When you specify RULES(NOLAXMARGINS), the default is ALL.

LAXNESTED | NOLAXNESTED
Specifying RULES(LAXNESTED) causes the compiler not to flag the executable code in a procedure that follows any subprocedures.

Specifying RULES(NOLAXNESTED) causes the compiler to flag any executable code in a procedure that follows any subprocedures.

ALL
Under ALL, all violations of RULES(NOLAXNESTED) are flagged. ALL is the default.
SOURCE
Under SOURCE, only those violations that occur in the primary source file are flagged.

The default is RULES(LAXNESTED). When you specify RULES(NOLAXNESTED), the default is ALL.

LAXPUNC | NOLAXPUNC
Specifying NOLAXPUNC causes the compiler to flag with an E-level message any place where it assumes punctuation is missing.

For instance, given the statement I = (1 * (2);, the compiler assumes that a closing right parenthesis is meant before the semicolon. Under RULES(NOLAXPUNC), this statement will be flagged with an E-level message; otherwise, it will be flagged with a W-level message.

The default is RULES(LAXPUNC).

LAXQUAL | NOLAXQUAL
Specifying NOLAXQUAL(LOOSE) causes the compiler to flag any reference to structure members that are not level 1 and are not dot qualified. Consider the following example:
dcl
  1 a,
    2 b,
      3 b fixed bin,
      3 c fixed bin;

c   = 11;   /* would be flagged */
b.c = 13;   /* would not be flagged */
a.c = 17;   /* would not be flagged */
Specifying NOLAXQUAL(STRICT) causes the compiler to flag any reference to structure members that do not include the level-1 name. Consider the following example:
dcl
  1 a,
    2 b,
      3 b fixed bin,
      3 c fixed bin;

c   = 11;   /* would be flagged */
b.c = 13;   /* would be flagged */
a.c = 17;   /* would not be flagged */
ALL
Under ALL, all violations of RULES(NOLAXQUAL) are flagged. ALL is the default.
FORCE
Under FORCE, only those violations that occur in structures with the FORCE(NOLAXQUAL) attribute are flagged.

The default is RULES(LAXQUAL). When you specify RULES(NOLAXQUAL), LOOSE and ALL are defaults.

LAXRETURN | NOLAXRETURN
Specifying NOLAXRETURN causes the compiler to generate code to raise the ERROR condition when a RETURN statement is used in either of the following ways:
  • With an expression in a procedure that is coded without the RETURNS option
  • Without an expression in a procedure that is coded with the RETURNS option

ERROR will also be raised if the code falls through to the END statement in a PROCEDURE with the RETURNS attribute.

The default is RULES(LAXRETURN).

LAXSCALE | NOLAXSCALE
Specifying NOLAXSCALE causes the compiler to flag any FIXED BIN(p,q) or FIXED DEC(p,q) declaration where q < 0 or p < q.

It also causes the compiler to flag ROUND(x,p) when p < 0.

The message issued when the compiler flags ROUND(x,p) is different from that issued when the compiler flags the FIXED BIN(p,q) or FIXED DEC(p,q) declaration. Therefore, you can use the EXIT option to suppress the message issued when ROUND(x,p) is flagged and keep the message for other questionable declarations.

The default is RULES(NOLAXSCALE).

LAXSEMI | NOLAXSEMI
Specifying NOLAXSEMI causes the compiler to flag any semicolons appearing inside comments.

The default is RULES(LAXSEMI).

LAXSTG | NOLAXSTG
Specifying NOLAXSTG causes the compiler to flag declarations where a variable A is declared as BASED on ADDR(B) and STG(A) > STG(B) even (and this is the key part) if B is a parameter.

Note that even with NOLAXSTG specified, if B has subscripts, no IBM2402I E-level message will be produced.

The compiler would already flag this kind of problem if B were in AUTOMATIC or STATIC storage, but it does not, by default, flag this when B is a parameter (because some programmers declare B with placeholder attributes that do not describe the actual argument). For situations where parameter and argument declarations match (or should match), specifying RULES(NOLAXSTG) can help detect more storage overlay problems.

The default is RULES(LAXSTG).

LAXSTMT | NOLAXSTMT
Specifying NOLAXSTMT causes the compiler to flag any line that has more than one statement.
ALL
Specifying RULES(NOLAXSTMT(ALL)) causes the compiler to flag all violations of NOLAXSTMT. ALL is the default.
SOURCE
Specifying RULES(NOLAXSTMT(SOURCE)) causes the compiler to flag only those violations in the primary source file.

Additionally, NOLAXSTMT accepts EXCEPT with a (possibly empty) list of keywords that are not be flagged when a second statement on a line begins with one of these keywords. For example, this can allow DO; to appear on the same line as an IF … THEN statement.

The following keywords are allowed in EXCEPT:

allocate
assert
attach
begin
call
cancel
close
declare
define
delay
delete
detach
display
do
else
end
exit
fetch
flush
free
get
go
goto

halt
if
iterate
leave
locate
on
open
otherwise
put
read
reinit
release
resignal
return
revert
rewrite
select
signal
stop
unlock
wait
when
write

The default is RULES(LAXSTMT). When you specify RULES(NOLAXSTMT), the default is ALL.

LAXSTRZ | NOLAXSTRZ
Specifying LAXSTRZ causes the compiler not to flag any bit or character variable that is initialized to or assigned a constant value that is too long if the excess bits are all zeros (or if the excess characters are all blank).

The default is RULES(NOLAXSTRZ).

MULTICLOSE | NOMULTICLOSE
Specifying NOMULTICLOSE causes the compiler to flag all statements that force the closure of multiple groups of statement with an E-level message.

The default is RULES(NOMULTICLOSE).

Start of changeMULTIENTRY | NOMULTIENTRYEnd of change
Start of changeStart of changeSpecifying NOMULTIENTRY causes the compiler to flag code that contains multiple ENTRY statements.Start of change
ALL
Specifying NOMULTIENTRY(ALL) causes the compiler to flag all violations of RULES(NOMULTIENTRY).
SOURCE
Specifying NOMULTIENTRY(SOURCE) causes the compiler to flag only those violations that occur in the primary source file.
End of change

The default is RULES(MULTIENTRY). When you specify RULES(NOMULTIENTRY), the default sub-suboption is ALL.

End of changeEnd of change
Start of changeMULTIEXIT | NOMULTIEXITEnd of change
Start of changeSpecifying NOMULTIEXIT causes the compiler to flag code that contains multiple RETURN statements.Start of change
ALL
Specifying NOMULTIEXIT(ALL) causes the compiler to flag all violations of RULES(NOMULTIEXIT).
SOURCE
Specifying NOMULTIEXIT(SOURCE) causes the compiler to flag only those violations that occur in the primary source file.
End of change

The default is RULES(MULTIEXIT). When you specify RULES(NOMULTIEXIT), the default sub-suboption is ALL.

End of change
Start of changeMULTISEMI | NOMULTISEMIEnd of change
Start of changeSpecifying NOMULTISEMI causes the compiler to flag any line that contains more than one semicolon not in a comment or string.Start of change
ALL
Specifying NOMULTISEMI(ALL) causes the compiler to flag all violations of RULES(NOMULTISEMI).
SOURCE
Specifying NOMULTISEMI(SOURCE) causes the compiler to flag only those violations that occur in the primary source file.
End of change

The default is RULES(MULTISEMI). When you specify RULES(NOMULTISEMI), the default sub-suboption is ALL.

End of change
PADDING | NOPADDING
Specifying NOPADDING causes the compiler to flag all structures that contain padding.
ALL
Specifying NOPADDING(ALL) causes the compiler to flag all violations of RULES(NOPADDING).
SOURCE
Specifying NOPADDING(SOURCE) causes the compiler to flag only those violations that occur in the primary source files.

The default is RULES(PADDING). When you specify RULES(NOPADDING), the default sub-suboption is ALL.

PROCENDONLY | NOPROCENDONLY
Specifying NOPROCENDONLY causes any END statement that closes a PROCEDURE to be flagged if the END statement does not name the PROCEDURE, that is, if the END keyword is immediately followed by a semicolon.
ALL
Under RULES(NOPROCENDONLY(ALL)), the compiler flags all violations of NOPROCENDONLY. ALL is the default.
SOURCE
Under RULES(NOPROCENDONLY(SOURCE)), the compiler flags only those violations in the primary source file.

The default is RULES(PROCENDONLY). When you specify RULES(NOPROCENDONLY), the default sub-suboption is ALL.

RECURSIVE | NORECURSIVE
Specifying NORECURSIVE causes the compiler to flag any use of the RECURSIVE attribute or any procedure that directly calls itself.

Specifying RECURSIVE causes the compiler not to flag the use of the RECURSIVE attribute or any procedure that directly calls itself.

Note: Do not use RULES(NORECURSIVE) and DFT(RECURSIVE) together.

The default is RULES(RECURSIVE).

SELFASSIGN | NOSELFASSIGN
Specifying NOSELFASSIGN causes the compiler to flag all assignments where the source and the target are the same.

The default is RULES(SELFASSIGN).

UNREF | NOUNREF
Specifying NOUNREF causes the compiler to flag any level-1 AUTOMATIC variable that is not referenced and that, if it is a structure or union, contains no subelement that is referenced. NOUNREF ignores variables with names that start with any of the following prefixes: DSN, DFH, EYU, and SQL.
ALL
Specifying RULES(NOUNREF(ALL)) causes the compiler to flag all unreferenced variables. When NOUNREF is specified, ALL is the default.
SOURCE
Specifying RULES(NOUNREF(SOURCE)) causes the compiler to flag unreferenced variables that are not declared in an INCLUDE file.

The default is RULES(UNREF). When you specify RULES(NOUNREF), the default sub-suboption is ALL.

UNREFBASED | NOUNREFBASED
Specifiying NOUNREFBASED causes the compiler to flag unreferenced BASED variables that are in BASED storage.
ALL
Specifying RULES(NOUNREFBASED(ALL)) causes the compiler to flag all unreferenced BASED variables.
SOURCE
Specifying RULES(NOUNREFBASED(SOURCE)) causes the compiler to flag unreferenced BASED variables that are not declared in an INCLUDE file.

The default is RULES(UNREFBASED). When you specify RULES(NOUNREFBASED), the default sub-suboption is ALL.

Start of changeUNREFCTL | NOUNREFCTL End of change
Start of changeSpecifiying NOUNREFCTL causes the compiler to flag unreferenced CTL variables.
ALL
Specifying RULES(NOUNREFCTL(ALL)) causes the compiler to flag all unreferenced CTL variables.
SOURCE
Specifying RULES(NOUNREFCTL(SOURCE)) causes the compiler to flag unreferenced CTL variables that are not declared in an INCLUDE file.

The default is RULES(UNREFCTL). When you specify RULES(NOUNREFCTL), the default sub-suboption is ALL.

End of change
Start of changeUNREFDEFINED | NOUNREFDEFINEDEnd of change
Start of changeSpecifiying NOUNREFDEFINED causes the compiler to flag unreferenced DEFINED variables.
ALL
Specifying RULES(NOUNREFDEFINED(ALL)) causes the compiler to flag all unreferenced DEFINED variables.
SOURCE
Specifying RULES(NOUNREFDEFINED(SOURCE)) causes the compiler to flag unreferenced DEFINED variables that are not declared in an INCLUDE file.

Start of changeThe default is RULES(UNREFDEFINED). When you specify RULES(UNREFDEFINED), the default sub-suboption is ALL.End of change

End of change
Start of changeUNREFENTRY | NOUNREFENTRYEnd of change
Start of changeSpecifiying NOUNREFENTRY causes the compiler to flag unreferenced ENTRY constants.
ALL
Specifying RULES(NOUNREFENTRY(ALL)) causes the compiler to flag all unreferenced ENTRY constants.
SOURCE
Specifying RULES(NOUNREFENTRY(SOURCE)) causes the compiler to flag unreferenced ENTRY constants that are not declared in an INCLUDE file.

Start of changeThe default is RULES(UNREFENTRY). When you specify RULES(NOUNREFENTRY), the default sub-suboption is ALL.End of change

End of change
Start of changeUNREFFILE | NOUNREFFILEEnd of change
Start of changeSpecifiying NOUNREFFILE causes the compiler to flag unreferenced FILE constants.
ALL
Specifying RULES(NOUNREFFILE(ALL)) causes the compiler to flag all unreferenced FILE constants.
SOURCE
Specifying RULES(NOUNREFFILE(SOURCE)) causes the compiler to flag unreferenced FILE constants that are not declared in an INCLUDE file.

The default is RULES(UNREFFILE). When you specify RULES(NOUNREFFILE), the default sub-suboption is ALL.

End of change
Start of changeUNREFSTATIC | NOUNREFSTATICEnd of change
Start of changeSpecifiying NOUNREFSTATIC causes the compiler to flag unreferenced STATIC variables.
ALL
Specifying RULES(NOUNREFSTATIC(ALL)) causes the compiler to flag all unreferenced STATIC variables.
SOURCE
Specifying RULES(NOUNREFSTATIC(SOURCE)) causes the compiler to flag unreferenced STATIC variables that are not declared in an INCLUDE file.

The default is RULES(UNREFSTATIC). When you specify RULES(NOUNREFSTATIC), the default sub-suboption is ALL.

End of change
Start of changeYY | NOYYEnd of change
Start of changeSpecifying NOYY causes the compiler to flag the use of 2-digit years, including:
  • date-time patterns with the year specified as YY or ZY,
  • the DATE attribute without a date-time pattern (since that implies a pattern of YYMMDD),
  • Y4DATE, Y4JULIAN, and Y4YEAR built-in functions,
  • DATE built-in function,
  • date-time functions with a window argument.

The default is RULES(YY).

End of change

Default: RULES (IBM BYNAME CONTROLLED NODECSIZE EVENDEC ELSEIF GLOBALDO GOTO NOLAXBIF Start of changeLAXCONVEnd of change NOLAXCTL NOLAXDCL NOLAXDEF LAXENTRY NOLAXIF LAXINOUT Start of changeLAXINTERFACEEnd of change LAXLINK LAXNESTED LAXPUNC LAXMARGINS(STRICT) LAXQUAL LAXRETURN NOLAXSCALE LAXSEMI LAXSTG LAXSTMT NOLAXSTRZ NOMULTICLOSE Start of changeMULTIENTRY MULTIEXIT MULTISEMI End of change PADDING PROCENDONLY RECURSIVE SELFASSIGN UNREF UNREFBASED Start of changeUNREFCTL UNREFDEFINED UNREFENTRY UNREFFILE UNREFSTATIC YYEnd of change )