Troubleshooting
Problem
This document explains why the debugger may issue the message CPF7E56 when trying to EVAL a variable.
Resolving The Problem
This document explains why the debugger may issue the message CPF7E56 when trying to EVAL a variable.
Problem
When debugging a program using STRDBG, a programmer may come across message CPF7E56 when doing an EVAL on a variable. This happens when the variable name is the same as the module name.
Consider the following code:
Note: In this example, you will want to name the program/module FIELD.
Example
Dfield S 5a
/Free
field='Hello';
*INLR=*on;
/End-Free
If this module is named Field and placed into debug, the debugger will issue message CPF7E56 if you try to EVAL the variable 'field'. This is the full message:
Message ID . . . . . . : CPF7E56 Severity . . . . . . . : 40
Message type . . . . . : Diagnostic
Date sent . . . . . . : 07/21/10 Time sent . . . . . . : 18:20:07
Message . . . . : Identifier is ambiguous
Cause . . . . . : The identifier in position &1 of the input buffer is
ambiguous.
Recovery . . . : Enter the expression again with the identifier fully
qualified.
Technical description . . . . . . . . : Refer to the language reference
manual for the language you are using for a technical description of the
grammar recognized by the Source Debugger.
This is because the name 'Field' is being generated into the debug code two times by the compiler; once as the module name and once as the variable name. When the debugger is instructed to evaluate the contents of 'Field', it searches for the name 'Field'. It finds both copies of the name and cannot distinguish between the two. It then throws the error 'Identifier is Ambiguous'.
Resolution
You should do either of the following:
1. Recompile the program/module by issuing the CRTBNDRPG command or the CRTRPGMOD command and providing a different name than FIELD
OR
2. Rename the variable so that the module/program name and variable name are different.
Problem
When debugging a program using STRDBG, a programmer may come across message CPF7E56 when doing an EVAL on a variable. This happens when the variable name is the same as the module name.
Consider the following code:
Note: In this example, you will want to name the program/module FIELD.
| Caution: This is an example only. IBM accepts no responsibility for its correctness. |
Example
Dfield S 5a
/Free
field='Hello';
*INLR=*on;
/End-Free
If this module is named Field and placed into debug, the debugger will issue message CPF7E56 if you try to EVAL the variable 'field'. This is the full message:
Message ID . . . . . . : CPF7E56 Severity . . . . . . . : 40
Message type . . . . . : Diagnostic
Date sent . . . . . . : 07/21/10 Time sent . . . . . . : 18:20:07
Message . . . . : Identifier is ambiguous
Cause . . . . . : The identifier in position &1 of the input buffer is
ambiguous.
Recovery . . . : Enter the expression again with the identifier fully
qualified.
Technical description . . . . . . . . : Refer to the language reference
manual for the language you are using for a technical description of the
grammar recognized by the Source Debugger.
This is because the name 'Field' is being generated into the debug code two times by the compiler; once as the module name and once as the variable name. When the debugger is instructed to evaluate the contents of 'Field', it searches for the name 'Field'. It finds both copies of the name and cannot distinguish between the two. It then throws the error 'Identifier is Ambiguous'.
Resolution
You should do either of the following:
1. Recompile the program/module by issuing the CRTBNDRPG command or the CRTRPGMOD command and providing a different name than FIELD
OR
2. Rename the variable so that the module/program name and variable name are different.
[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m3p000000F91QAAS","label":"Programming ILE Languages-\u003EDebugger"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]
Historical Number
567759228
Was this topic helpful?
Document Information
Modified date:
29 April 2025
UID
nas8N1012116