This option allows or disallows certain language capabilities and allows you to choose semantics when alternatives are available. It can help you diagnose common programming errors.
.-+---+----------------------------------------. | '-,-' | V .-IBM-. | >>-RULES--(----+-+-ANS-+----------------------------------+-+--)->< | .-BYNAME---. | +-+-NOBYNAME-+-----------------------------+ | .-NODECSIZE-. | +-+-DECSIZE---+----------------------------+ | .-ELSEIF---. | +-+-NOELSEIF-+-----------------------------+ | .-EVENDEC---. | +-+-NOEVENDEC-+----------------------------+ | .-GOTO---. | +-+-NOGOTO-+-------------------------------+ | .-GLOBALDO---. | +-+-NOGLOBALDO-+---------------------------+ | .-NOLAXBIF-. | +-+-LAXBIF---+-----------------------------+ | .-NOLAXCTL-. | +-+-LAXCTL---+-----------------------------+ | .-LAXDCL---. | +-+-NOLAXDCL-+-----------------------------+ | .-NOLAXDEF-. | +-+-LAXDEF---+-----------------------------+ | .-LAXENTRY---. | +-+-NOLAXENTRY-+---------------------------+ | .-LAXIF---. | +-+-NOLAXIF-+------------------------------+ | .-LAXINOUT---. | +-+-NOLAXINOUT-+---------------------------+ | .-LAXLINK---. | +-+-NOLAXLINK-+----------------------------+ | .-LAXMARGINS---------------------------. | +-+-NOLAXMARGINS--+--------------------+-+-+ | | .-STRICT---. | | | '-(--+-XNUMERIC-+--)-' | | .-LAXPUNC---. | +-+-NOLAXPUNC-+----------------------------+ | .-LAXQUAL-------------------------. | +-+-NOLAXQUAL--+------------------+-+------+ | | .-LOOSE--. | | | '-(--+-STRICT-+--)-' | | .-LAXSCALE---. | +-+-NOLAXSCALE-+---------------------------+ | .-LAXSEMI---. | +-+-NOLAXSEMI-+----------------------------+ | .-LAXSTG---. | +-+-NOLAXSTG-+-----------------------------+ | .-NOLAXSTRZ-. | +-+-LAXSTRZ---+----------------------------+ | .-MULTICLOSE---. | +-+-NOMULTICLOSE-+-------------------------+ | .-PADDING---. | +-+-NOPADDING-+----------------------------+ | .-PROCENDONLY---. | +-+-NOPROCENDONLY-+------------------------+ | .-STOP---. | +-+-NOSTOP-+-------------------------------+ | .-UNREF---. | '-+-NOUNREF-+------------------------------'
Under the ANS suboption:
Specifying RULES(DECSIZE) may cause the compiler to produce a large number of messages since if SIZE is disabled, then any statement of the form X = X + 1 will be flagged if X is FIXED DECIMAL.
This option can be useful in enforcing that SELECT statements be used rather than a series of nested IF-THEN-ELSE statements.
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 following would all be flagged under NOLAXIF:
dcl i fixed bin; dcl b bit(8); ... if i then ... if b then ...
For instance if A1 is declared as ENTRY(CHAR(8)) and A2 as ENTRY(POINTER) VARIABLE, then under RULES(NOLAXLINK), the compiler would flag an attempt to assign A1 to A2.
For instance if A3 is declared as ENTRY RETURNS(FIXED BIN(31)) and A4 as an ENTRY VARIABLE without the RETURNS attribute, then under RULES(NOLAXLINK), the compiler would flag an attempt to assign A3 to A4.
For example, if A5 is declared as ENTRY OPTIONS(ASM) and A6 as an ENTRY VARIABLE without the OPTIONS attribute, then under RULES(NOLAXLINK), the compiler would flag an attempt to assign A5 to A6 because the OPTIONS(ASM) in the declare of A5 implies that A5 has LINKAGE(SYSTEM) while A6 will have LINKAGE(OPTLINK) by default, since it has no OPTIONS attribute.
If the NOLAXMARGINS and STMT options are used together with one of the preprocessors, then any statements that would be flagged because of the NOLAXMARGINS option will be reported as statement zero (since 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).
For instance, given the statement "I = (1 * (2);", the compiler assumes that a closing right parenthesis was meant before the semicolon. Under RULES(NOLAXPUNC), this statement would be flagged with an E-level message; otherwise it would be flagged with a W-level message.
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 */
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 (since some customers declare B with placeholder attributes that do not describe the actual argument). For those customers whose parameter and argument declares match (or should match), specifying RULES(NOLAXSTG) may help detect more storage overlay problems.
Default: RULES (IBM BYNAME NODECSIZE EVENDEC ELSEIF GOTO GLOBALDO NOLAXBIF NOLAXCTL LAXDCL NOLAXDEF LAXENTRY LAXIF LAXINOUT LAXLINK LAXPUNC LAXMARGINS(STRICT) LAXQUAL LAXSCALE LAXSEMI LAXSTG NOLAXSTRZ MULTICLOSE PADDING PROCENDONLY STOP UNREF)