#INFO

The #INFO compiler command causes the compiler to report or suppress conditions encountered by the compiler that may require attention.

The PSL compiler distinguishes three levels of messages: information, warning, and error. Error messages are always reported by the compiler, but the reporting of warning messages and informational messages is controlled by the environment, the process, or the source unit.

Every message is linked to a group. The #INFO compiler command can be used to show or suppress all warning messages and information messages for a particular group.

Refer to the Troubleshooting Compiler Warnings section for details on each of the compiler warnings.

The compiler warnings and informational messages do not impact the generated code. However, you should use them to check or modify the source code appropriately. Do not use this compiler command unless there is an explicit need to override the environment default.

Syntax

#INFO grouplist ON|OFF

Parameters

grouplist

One or more groups of messages to show (ON) or suppress (OFF) from the following list:

  • ACCESS - Subroutine not accessible by external routine

Recommended settings:

- Development environments for Version 6.4 and lower: OFF

- Development environments for Version 7.0 and higher: ON

- Production environments for all versions: OFF

  • BYPASS - #BYPASS compiler command encountered

Recommended settings:

- Development environments for all versions: ON

- Production environments for all versions: OFF

  • DATABASE - Method is not database independent

Recommended settings:

- Development environments for all versions: ON

- Production environments for all versions: OFF

  • DEAD - Dead code

Recommended settings:

- Development environments for all versions: ON

- Production environments for all versions: OFF

  • DEPRECATED - Deprecated feature detected

Recommended settings:

- Development environments for Version 6.4 and lower: OFF

- Development environments for Version 7.0 and higher: ON

- Production environments for all versions: OFF

  • DYNAMIC - Dynamic SQL statement or other dynamic construct

Recommended settings:

- Development environments for all versions: ON

- Production environments for all versions: OFF

  • FUNCTION - Extrinsic function replaced

Recommended settings:

- Development environments for all versions: OFF

- Production environments for all versions: OFF

  • GLOBAL - M Global Reference

Recommended settings:

- Development environments for all versions: ON

- Production environments for all versions: OFF

  • LENGTH - Indicates that a maximum length is exceeded. This is reported for names of labels and names of routines. Note that exceeding the maximum length of a local variable name is considered an error if the subroutine contains another name that cannot be distinguished at the target language level.

Recommended settings:

- Development environments for all versions: ON

- Production environments for all versions: OFF

  • MISMATCH - Parameter type mismatch in function or subroutine call, or data type mismatch in assignment

Recommended settings:

- Development environments for all versions: ON

- Production environments for all versions: OFF

  • PRECEDENCE - Ambiguous operator precedence

Recommended settings:

- Development environments for all versions: ON

- Production environments for all versions: OFF

  • READ - Restricted command (READ)

Recommended settings:

- Development environments for all versions: OFF

- Production environments for all versions: OFF

  • RECEXISTS - Possible runtime error RECEXISTS

Recommended settings:

- Development environments for all versions: ON

- Production environments for all versions: OFF

  • SCOPE - Scope of variable is not defined

Recommended settings:

- Development environments for Version 6.4 and lower: OFF

- Development environments for Version 7.0 and higher: ON

- Production environments for all versions: OFF

  • SYNTAX - A syntax error has been corrected by the compiler

Recommended settings:

- Development environments for all versions: ON

- Production environments for all versions: OFF

  • SYSVAR - Assigning system variable

Recommended settings:

- Development environments for all versions: ON

- Production environments for all versions: OFF

  • XECUTE - Restricted command - runtime XECUTE

Recommended settings:

- Development environments for all versions: ON

- Production environments for all versions: OFF

ON|OFF

An indication of whether the compiler should show (ON) or suppress (OFF) messages from the selected groups. The default is ON.

When Became Available

Profile v7.0

Example

#INFO           // Test of scope warnings. Do not use this in your code.

new abc         // Local Scope

type Number n   // Local scope

 

set zzz=n       // zzz not declared...

quit

This produces the following warnings when compiled:

%PSL-W-SCOPE: Unscoped variable: zzz

At source code line: 7 in subroutine:

%PSL-W-SCOPE: Undefined variable: n

At source code line: 7 in subroutine:

%PSL-W-SCOPE: Unreferenced variable: abc

At source code line: 8 in subroutine: