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.
- IBM | ANS
- Under the IBM suboption:
- For operations requiring string data, data with the BINARY attribute is converted to BIT.
- For arithmetic operations, the following rules apply:
- If one operand is FIXED BIN and one is FIXED DEC, then the result is FIXED BIN even if the FIXED
DEC operand has a scale factor greater than zero.
For example, if
x
is FIXED BIN(15) andy
is FIXED BIN(31), thenx
+ 2 has the attributes FIXED BIN(16,0)x
+ 2.1 has the attributes FIXED BIN(20,4)y
+ 2 has the attributes FIXED BIN(31,0)y
+ 2.1 has the attributes FIXED BIN(31,4) - If both operands are unscaled FIXED BIN, then the result is unscaled FIXED BIN except some
divisions may produce a result with a non-zero scale factor.
For example, if
x
is FIXED BIN(15) andy
is FIXED BIN(31), thenx
/ 2 has the attributes FIXED BIN(31,16)y
/ 2 has the attributes FIXED BIN(31,0)
- If one operand is FIXED BIN and one is FIXED DEC, then the result is FIXED BIN even if the FIXED
DEC operand has a scale factor greater than zero.
- 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.
- Declaring a variable with the OPTIONS attribute implies the ENTRY attribute.
- BYNAME | NOBYNAME
- Specifying NOBYNAME causes the compiler to flag all BYNAME assignments
with an E-level message.
The default is RULES(BYNAME).
- COMPLEX | NOCOMPLEX
- Specifying RULES(NOCOMPLEX) causes the compiler to flag any use
of the COMPLEX attribute or built-in function, and any use of numbers
with an I suffix.
If you specify RULES(COMPLEX), the compiler will not flag such statements.
- ALL
- Under ALL, all violations of RULES(NOCOMPLEX) 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(COMPLEX). When you specify RULES(NOCOMPLEX), the default is ALL.
- 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).
- GLOBAL | NOGLOBAL
- Specifying RULES(NOGLOBAL) causes the compiler to flag any variable that is used in a nested
subprocedure of the block where the variable is declared with one of the following storage attributes:
- AUTOMATIC
- CONTROLLED
- DEFINED
- PARAMETER
- ASSIGNABLE STATIC
If you specify RULES(GLOBAL), the compiler will not flag such usage.
- ALL
- Under ALL, all violations of RULES(NOGLOBAL) are flagged.
- SOURCE
- Under SOURCE, only those violations that occur in the primary source file are flagged.
The default is RULES(GLOBAL). When you specify RULES(NOGLOBAL), the default is ALL.
- GLOBALDO | NOGLOBALDO
- Specifying NOGLOBALDO instructs the compiler to flag all DO loops with control variables that
are declared in a parent block.
Using a variable declared in a parent as a DO loop control variable will cause the loop performance to be much worse than if the variable is declared in the block in which it is used as a DO loop control variable.
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.
Specifying 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.
Specifying RULES(NOGOTO) will cause the compiler to flag the use of the EXEC HANDLE CONDITION and EXEC SQL WHENEVER statements as errors.
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).
- LAXCONV | NOLAXCONV
- Specifying 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.
- 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 except declarations of names
which start with 'CEE', 'DFH', 'DSN', 'EYU', 'IBM', 'PLI', and 'SQL'.Note: If an ENTRY should have no parameter, it must 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.
- LAXEXPORTS | NOLAXEXPORTS
- Specifying NOLAXEXPORTS causes the compiler to flag any compilation
with EXTERNAL routines that have a PACKAGE statement not specifying
an EXPORTS clause with a list of routines to be exported.
If you specify LAXEXPORTS, the compiler will not flag such compilation units.
The default is RULES(LAXEXPORTS).
- LAXFIELDS | NOLAXFIELDS
- Specifying RULES(NOLAXFIELDS) causes the compiler to flag the
following SQL statements:
EXEC SQL SELECT*
EXEC SQL INSERT INTO <name>
not followed by a parenthesized list of field names
The default is RULES(LAXFIELDS).
- 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 thex=(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 parameters with the explicit INOUT attribute are input (and possibly output) parameters and hence to issue a warning if the compiler thinks such a parameter has not been set.
If you specify STRICT as a suboption to RULES(NOLAXINOUT), then the compiler will assume any ASSIGNABLE BYADDR parameter is INOUT and will flag its use when possibly unset.
- ALL
- Under ALL, all violations of RULES(NOLAXINOUT) 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(LAXINOUT). When you specify RULES(NOLAXINOUT), LOOSE and ALL are defaults.
- LAXINTERFACE | NOLAXINTERFACE
- Specifying NOLAXINTERFACE causes the compiler to flag code that
does not contain a matching explicit declaration for each of its external
non-MAIN PROCEDUREs.Under NOLAXINTERFACE:
- If there is a PACKAGE statement, then every exported non-MAIN procedure must have an explicit declaration at package scope, and that explicit declaration must match the implicit declaration derived from its procedure statement.
- If there is no PACKAGE statement, then the outermost procedure, if not MAIN, must contain an explicit declaration for it, and that explicit declaration must match the implicit declaration derived from its procedure statement match.
The default is RULES(LAXINTERFACE).
- 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).
- The parameter description lists
- 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 STRICT.
- 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.
- LAXOPTIONAL | NOLAXOPTIONAL
- Specifying RULES(NOLAXOPTIONAL) causes the compiler to flag any
use of the OMITTED and PRESENT built-in functions whose parameters
are not declared as OPTIONAL.
- ALL
- Under ALL, all violations of RULES(NOLAXOPTIONAL) are flagged. ALL is the default.
- SOURCE
- Under SOURCE, only those violations that occur in the primary source file are flagged.
Then under RULES(NOLAXOPTIONAL), the compiler will flag OMITTED(a).Test: proc( a, b ); declare a fixed bin(31); declare b fixed bin(31) optional;
The default is RULES(LAXOPTIONAL). When you specify RULES(NOLAXOPTIONAL), the default is ALL.
- LAXPACKAGE | NOLAXPACKAGE
- Specifying NOLAXPACKAGE causes the compiler to flag any compilation
that does not contain an explicit PACKAGE statement.
If you specify LAXPACKAGE, the compiler will not flag such compilation units.
The default is RULES(LAXPACKAGE).
- LAXPARMS | NOLAXPARMS
- Specifying RULES(NOLAXPARMS) causes the compiler to flag any parameter
that does not have one of the attributes INOUT/INONLY/OUTONLY either
explicitly specified or implied by a different attribute (such as
BYVALUE).
If you specify RULES(LAXPARMS), the compiler will not flag such statements.
- ALL
- Under ALL, all violations of RULES(NOLAXPARMS) 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(LAXPARMS). When you specify RULES(NOLAXPARMS), 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 causes the compiler to flag any reference to structure members
that are not level 1. References which names start with 'CEE', 'DFH', 'DSN', 'EYU',
'IBM', 'PLI', and 'SQL' are excluded from the NOLAXQUAL checking.
- LOOSE
- Specifying RULES(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 */
- STRICT
- Specifying RULES(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 */
- FULL
- Specifying RULES(NOLAXQUAL(FULL)) causes the compiler to flag any reference to a structure member that does not include all of its parents' names.
- 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
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 a 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.
If you specify STRICT as a suboption to RULES(NOLAXSCALE), then the compiler will also flag any FIXED BIN(p,q) where q > 0. LOOSE is the default.- ALL
- Under ALL, all violations of RULES(NOLAXSCALE) 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(NOLAXSCALE). When you specify RULES(NOLAXSCALE), ALL is the default.
- 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 anIF … 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
writeThe 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).
- MULTIENTRY | NOMULTIENTRY
- Specifying NOMULTIENTRY causes the compiler to
flag code that contains multiple ENTRY statements.
- 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.
The default is RULES(MULTIENTRY). When you specify RULES(NOMULTIENTRY), the default sub-suboption is ALL.
- MULTIEXIT | NOMULTIEXIT
- Specifying NOMULTIEXIT causes the compiler to flag code that contains
multiple RETURN statements.
- 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.
The default is RULES(MULTIEXIT). When you specify RULES(NOMULTIEXIT), the default sub-suboption is ALL.
- MULTISEMI | NOMULTISEMI
- Specifying NOMULTISEMI causes the compiler to flag any line that
contains more than one semicolon not in a comment or string.
- 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.
The default is RULES(MULTISEMI). When you specify RULES(NOMULTISEMI), the default sub-suboption is ALL.
- PADDING | NOPADDING
- Specifying NOPADDING causes the compiler to flag structures that
contain padding.
- ALL
- Specifying NOPADDING(ALL) causes the compiler to flag all violations of RULES(NOPADDING) corresponding to the setting of the LOOSE/STRICT suboption.
- SOURCE
- Specifying NOPADDING(SOURCE) causes the compiler to flag only those violations that occur in the primary source file.
- LOOSE
- Specifying NOPADDING(LOOSE) causes the compiler to flag structures that contain internal padding.
- STRICT
- Specifying NOPADDING(STRICT) causes the compiler to flag structures
that contain any
- internal padding
- padding before the structure (so-called hang bytes or bits). This occurs when the structure is n-byte aligned but does not have a multiple of n bytes before its first element with that alignment; or the structure does not have a multiple of 8 bits before its first element with byte (or greater) alignment.
- padding after the structure. This occurs when the size of the structure is not a multiple of its alignment; or the structure does not have a multiple of 8 bits after its last element with byte (or greater) alignment.
The default is RULES(PADDING). When you specify RULES(NOPADDING), the default sub-suboption are ALL and LOOSE.
- 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.
- UNREFCTL | NOUNREFCTL
- Specifiying 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.
- UNREFDEFINED | NOUNREFDEFINED
- Specifiying 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.
The default is RULES(UNREFDEFINED). When you specify RULES(UNREFDEFINED), the default sub-suboption is ALL.
- UNREFENTRY | NOUNREFENTRY
- Specifying 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.
The default is RULES(UNREFENTRY). When you specify RULES(NOUNREFENTRY), the default suboption is ALL.
- UNREFFILE | NOUNREFFILE
- Specifying 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 suboption is ALL.
- UNREFSTATIC | NOUNREFSTATIC
- Specifying NOUNREFSTATIC causes the compiler to flag all unreferenced STATIC
variables except PLIXOPT and PLITABS.
- 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 suboption is ALL.
- UNREFVALUE | NOUNREFVALUE
- Specifying NOUNREFVALUE causes the compiler to flag unreferenced VALUE constants.
- ALL
- Specifying RULES(NOUNREFVALUE(ALL)) causes the compiler to flag all unreferenced VALUE constants.
- SOURCE
- Specifying RULES(NOUNREFVALUE(SOURCE)) causes the compiler to flag unreferenced VALUE constants that are not declared in an INCLUDE file.
The default is RULES(UNREFVALUE). When you specify RULES(NOUNREFVALUE), the default suboption is ALL.
- UNSET | NOUNSET
-
Specifying NOUNSET causes the compiler to flag the use of automatic variables that possibly have not been explicitly assigned a value.
The compiler follows this logic in determining when to flag these possible problems:
- If an automatic variable has possibly not been assigned a value
- If it has been initialized
- Under RULES(UNSET), use of its value is not flagged.
- Under RULES(NOUNSET), use of its value is flagged.
- If it has not been initialized, use of its value is flagged.
- If it has been initialized
- Otherwise, use of its value is not flagged.
This option is intended to help move users away from mindlessly applying an INIT value to everything.
The default is RULES(UNSET). When you specify RULES(NOUNSET), the default is ALL.
- If an automatic variable has possibly not been assigned a value
- YY | NOYY
- Specifying 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).
Default: RULES (IBM BYNAME COMPLEX CONTROLLED NODECSIZE EVENDEC ELSEIF GLOBAL GLOBALDO GOTO NOLAXBIF LAXCONV NOLAXCTL NOLAXDCL NOLAXDEF LAXENTRY LAXEXPORTS NOLAXFIELDS NOLAXIF LAXINOUT LAXINTERFACE LAXLINK LAXNESTED LAXOPTIONAL LAXPACKAGE LAXPARMS LAXPUNC LAXMARGINS(STRICT) LAXQUAL LAXRETURN NOLAXSCALE LAXSEMI LAXSTG LAXSTMT NOLAXSTRZ NOMULTICLOSE MULTIENTRY MULTIEXIT MULTISEMI PADDING PROCENDONLY RECURSIVE SELFASSIGN UNREF UNREFBASED UNREFCTL UNREFDEFINED UNREFENTRY UNREFFILE UNREFSTATIC YY )