Operations Research topics: SAS/OR,
SAS Optimization, and SAS Simulation Studio

The name 'index_1' hides an outer declaration.

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

The name 'index_1' hides an outer declaration.

Hi,  

I have a formulation with more than two indices, SAS produce an error:

 

for example:

con problem_con{<index_1, index_2> in two_indices}:  ...

 

SAS produced an error and told me:

"The name 'index_1' hides an outer declaration."

What does this mean and how do I get rid of this error?

 

Thank you!


Accepted Solutions
Solution
‎07-26-2016 02:23 PM
SAS Employee
Posts: 447

Re: The name 'index_1' hides an outer declaration.

[ Edited ]

The message should just be a NOTE and not an ERROR.  It means that you have declared index_1 as a parameter and then later used it as a dummy index.  The following code yields the same behavior:

 

proc optmodel;
   num i;
put ({i in 1..3}); quit;

To avoid the note, either omit the declaration or use a different dummy index.

View solution in original post


All Replies
Solution
‎07-26-2016 02:23 PM
SAS Employee
Posts: 447

Re: The name 'index_1' hides an outer declaration.

[ Edited ]

The message should just be a NOTE and not an ERROR.  It means that you have declared index_1 as a parameter and then later used it as a dummy index.  The following code yields the same behavior:

 

proc optmodel;
   num i;
put ({i in 1..3}); quit;

To avoid the note, either omit the declaration or use a different dummy index.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 506 views
  • 1 like
  • 2 in conversation