Troubleshooting Compiler Warnings

To view the causes and solutions of PSL compilation warnings, click the first letter of the error message text:

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z

Accept requires = sign: <parameter>

Cause:

A parameter in the #ACCEPT compiler command did not include an equal sign.

 

#ACCEPT ;;DSGN = Joe Smith;CRJane Doe

 

Solution:

Insert the equal sign where required in the parameter.

 

#ACCEPT ;;DSGN = Joe Smith;CR = Jane Doe

Accept requires: Date Field

Cause:

An #ACCEPT compiler command does not include the Date parameter.

 

#ACCEPT ;PGM = John Miller;DSGN = Joe Smith;CR = Jane Doe

 

Solution:

Include the Date parameter in the command.

 

#ACCEPT Date = 10/25/2002;PGM = John Miller;DSGN = Joe Smith;CR = Jane Doe

Accept requires: PGM Field

Cause:

An #ACCEPT compiler command does not include the PGM parameter.

 

#ACCEPT Date = 10/25/2002;;DSGN = Joe Smith;CR = Jane Doe

 

Solution:

Include the PGM parameter in the command.

 

#ACCEPT Date = 20/25/2002;PGM = John Miller;DSGN = Joe Smith;CR = Jane Doe

Ambiguous operator precedence

Cause:

Two operators appear in an ambiguous order in an expression. Two possible interpretations exist.

 

if rs.next() set PTRC = rs.getCol(1)\1000-1*1000

 

Solution:

Use parentheses to clarify the order in which the compiler should interpret the expression.

 

if rs.next() set PTRC = ((rs.getCol(1)\1000)-1)*1000

Assigning system variable: <name>

Cause:

PSL code is attempting to assign a value to a system variable.

 

type Public Number CID

set %SystemDate = 2

 

Solution:

This should be reserved for selected batches and service class drivers.

Cast expression to class: <class>

Cause:

An object of a primitive class (e.g., Number, String, Date, Boolean) refers to a method of a different primitive class. PSL implicitly casts the object to the other class.
 

Solution:

(1) Instantiate the object in the class of the method.

(2) Explicitly cast the object in the expression

set x = x.piece(".",2)  // piece is a method of the String class

Class is case sensitive: <Class>

Cause:

The record class definition is case sensitive but the compiler can recognize and warn when the class entered could match a defined class.

 

type string xyz
 

Solution:

PSL fixes the case if it can find the class. Avoid the warning by correcting the case.

 

type String xyz
 

Compiler Error at aCaller^URECORD, Cache not described for <caller>(<variable>) at: <tag>

Cause:

This warning is a debug error within the compiler logic itself.
 

Solution:

This warning should not occur. However, if it does, contact the FIS PSL support/development.

Dead code

Cause:

The compiler identified dead code (i.e., code that has no reference).

 

type RecordDEP dep = Db.getRecord("DEP","CID=:CID")

do XXX(.dep)

quit

set X = 4

 

Solution:

Remove dead code from the program, as it adds to program complexity and size for no reason. You can temporarily warehouse code in a program by enclosing it within a comment fence /* and */.

 

type Public Number CID

set %CurrentDate = 2

type RecordDEP dep=Db.getRecord("DEP","CID=:CID")

do XXX(.dep)

quit

 

Dynamic SQL statement

Cause:

The compiler generated dynamic SQL code.
 

Solution:

Because the use of dynamic SQL may negatively impact run-time performance, the compiler generates this warning to remind you to formally review and accept the code.

Extrinsic function replaced: <expression>

Cause:

Code that was written to use a utility function that has been registered in table STBLPSLFUNSUBS was converted to use a method instead of the utility.
 

Solution:

Consider changing the code to use the method instead of the utility function.

Invalid label reference inside block

Cause:

A label appears within a nested DO block. For example,

 

do {

   label set x=y

}

 

Solution:

Remove the label reference contained within the block at the specified line. For example,

 

do {

   set x=y

}

Invalid tag with parameters inside subroutine: <subroutine>

Cause:

A subroutine contains a line label with parameters.

 

a                               // Subroutine a

   do something

b(parameter)            // Illegal tag inside a

   quit

 

Solution:

Do not place tags inside subroutines (even though M allows this).

 

a                               // Subroutine a

   do something

   quit

Literal delimiter (") expected

Cause:

A string literal was started with double quotes. However, the matching closing quotes are missing.

 

write "Hello

quit

 

Solution:

Add the missing closing double quotes, or remove the misplaced starting quotes.

 

write "Hello"

quite

M global reference: <atom>

Cause:

This message identifies a place where a global reference was included. This message appears as a warning in versions prior to Profile version 7.0, and as an error in v7.0 and later.
 

Solution:

Modify the code to avoid the use of globals.

MatchCount exceeds possible matches: <count>

Cause:

The third parameter of Db.isDefined (i.e., match) was used, and the compiler cannot determine that the third parameter value would always be exceeded.
 

Solution:

Review the count and its use. It may be used incorrectly.

Method is case sensitive: <method>

Cause:

An inappropriate case was used in the name of the method.

 

type RecordDEP dep=Db.GetRecord("DEP","cid")
 

Solution:

If the PSL compiler can find the method in the method table based on the specified class, PSL fixes the case. To silence the warning message, change the case.

 

type RecordDEP dep=Db.getRecord("DEP","cid")
 

Method is not database independent: toString

Cause:

The method used is not database independent. For example, any method that moves an entire row of data from an object into a string is not compliant, because the nodes and positions change depending on the database environment.
 

Solution:

There is no solution other than using another method to use the data or manipulate it. If a customer is not working on a database independent version and will never work on one, then they can ignore this warning.

Method is not implemented

Cause:
 

A method is registered in the OBJECTMET table that has not yet been coded.

Solution:

None, you cannot use the method.

Missing block terminator and quit from: <subroutine>

Cause:

The compiler sensed a block start but encountered a subroutine label prior to the block terminator. That is, a subroutine label appears within a nested DO block. For example,

 

do {

label set x = y

}

 

Solution:

PSL adds the appropriate number of block terminators and inserts a Quit prior to the label reference. However, since PSL produces this warning, it is a strong indication that something is wrong. This warning should never be accepted.
OR

You can remove the label reference contained within the block at the specified line. For example,

 

do {

     set x = y

}

Missing QUIT from previous subroutine: <subroutine>

Cause:

A subroutine that instantiated an object did not include a quit command prior to the start of another label that receives parameters.

 

XYZ

   type RecordDEP dep=Db.getRecord("DEP","cid")

 

tyu("xyt")

   quit

 

Solution:

PSL inserts a line with a Quite prior to the label.
OR

You can insert a quit command prior to the start of the second label.

 

XYZ

   type RecordDEP dep=Db.getRecord("DEP","cid")

   quit

 

tyu("xyt")

   quit

Modifying a PSL instrinsic variable: <variable>

Cause:

The name "Db", "Class", "Object", "Runtime", or "Schema" was used in application code as an object name.
 

Solution:

Although these names can be used in PSL compiler code to build methods, they cannot be used in application code. Choose another object name.

More actual parameters: <actual> than formal: <formal>

Cause:

A routine is attempting to pass more parameters to a subroutine label than the label has defined.
 

Solution:

Review parameters of the label being called and the routine calling that label. Determine which has the correct number of parameters. If you need to modify the label being called, review all routines calling that label to ensure that they pass the correct number of parameters.

Multi-line comment terminator expected: */"

Cause:

A multi-line comment is not terminated before the end of the source file.
 

Solution:

Add the multi-line comment terminator (i.e., */") at the end of the appropriate comment line.

Parameter type mismatch: <subroutine>(<formal>) called by <subroutine>(<actual>)

Cause:

The type of parameter being passed to a subroutine does not match the type of parameter being received. This warning appears when the parameters are not formally declared.
 

Solution:

Review the formal typing of parameters, and correct the mismatch.

Possible run-time error RECEXISTS

Cause:

This warning occurs for two reasons:

(1) An object was passed from one label to another. It is possible that the object may return from the subroutine call with a record that is totally different from the one passed to it.

(2) PSL instantiated a Record<class> object that contains multiple nodes and that may already be in scope. This could cause a fatal run-time condition for tables (e.g., DEP, LN) if an existing object is partially replaced. In addition to this warning, PSL inserts code to perform a run-time check, and will throw an error if an object is in scope.

 

type RecordDEP dep = Db.getRecord("DEP","CID=:CID")

do XXX(.dep)

quit

 

XXX(RecordDEP dep)

type Public Number ICID

 

Solution:

The solution depends on the cause of the warning:

(1) Do not pass objects from one label to another.

(2) Type a new definition instead of reusing the same object without typing it.

 

type RecordDEP dep = Db.getRecord("DEP","CID=:CID")

do XXX(.dep)

quit

 

set dep = Db.getRecord("DEP","CID=:ICID")

quit

Property is case sensitive

Cause:

Properties such as those associated with the column class (DES,JOURNAL,KEY,LEN,OLDVAL,TYP) are case sensitive (i.e., lowercase is expected). PSL can determine when a case sensitivity issue exists and correct it but warns about it as well

 

XXX(RecordDEP dep) s dep.bal.JOURNAL=0
 

Solution:

Change the case of the property to be lowercase.

 

XXX(RecordDEP dep) s dep.bal.journal=0
 

Restricted command

Cause:

The read command is included in a routine.
 

Solution:

Modify the code to use the IO class methods instead.

Restricted command - runtime Xecute

Cause:

The xecute command was used, causing run-time evaluation of the M code which results in slower performance than compiled code.
 

Solution:

Limit the use of the xecute command.

Space or operator expected after: <character>

Cause:

An expression or empty argument was required but did not terminate normally.

 

for I=1:1:3:4 do

 

Solution:

Correct the expression and properly terminate it.

 

for I=1:1:34 do

Two spaces expected after command: <command>

Cause:

A command (e.g., else, for, quit) requires two spaces after it but they were not found.

 

if x=y s f=p
else s f=y
 

Solution:

PSL inserts two whitespaces after an argumentless command. For ELSE, FOR, and QUIT commands, PSL verifies that the next expression is a PSL command before adding a space. For QUIT, if a variable is scoped with the same name as a command, PSL does not repair the whitespace because the intent is ambiguous.

Undefined variable: <name>

Cause:

A variable is referenced within a subroutine but cannot be defined at compilation based on the scope and flow of the program. This occurs when a variable is locally scoped with a Type or New command and subsequently referenced before it is assigned or instantiated.

However, after a subroutine, function, or method is called, this test is suspended because the variable may be assigned in the called code. This test is also suspended if a variable is passed in as a formal parameter or scoped as a Public variable.
 

Solution:

Rewrite the code to assign or instantiate the variable before referencing the variable. Quit with the value after the loop finishes processing.

Unreferenced variable: <name>

Cause:

A variable is passed into a subroutine or scoped within a subroutine and never referenced.
 

Solution:

Rewrite the code to reference the variable, or do not pass or scope the variable in the subroutine.

Unscoped variable: <name>

Cause:

A variable referenced in a subroutine has not been scoped, either as a formal input parameter, with the M New command, or with the PSL Type command.
 

Solution:

Variables that are passed into a subroutine (if they are not parameters) should be scoped in the subroutine as Public variables. For example,

 

Type Public [String|Number|Date|AnyClass] variable