Page 1 of 1

Error 352

Posted: Thu Nov 21, 2019 11:28 am
by hbshrestha
Hi,

I encountered the Error 352 while compiling my GAMS code.
It says, " Set has not been initialized" although it has been defined before.
Could anyone suggest how to rectify this error?

Thanks,
Himalaya

Re: Error 352

Posted: Thu Nov 21, 2019 8:24 pm
by achristensen
best if you post some code.... is it possible to share publicly?

--adam

Re: Error 352

Posted: Mon Jul 20, 2020 7:55 pm
by Jubeyer
Hi ,
I am facing the same issues during compilation of my developed model I am getting the error message like this in the '.lst' file

523 GEN_BLOCK_SCHEDULE_MG.LO(MG_GEN,BLOCK,INTERVAL)$(ORD(BLOCK) GT 1) = 0;
**** $352
**** 352 Set has not been initialized


But I have declared the variable 'GEN_BLOCK_SCHEDULE_MG (MG_GEN,BLOCK,INTERVAL)' before that line along with the sets;

435 GEN_BLOCK_SCHEDULE_MG(MG_GEN,BLOCK,INTERVAL)

​Can you guide me how to fix this issue and why that is happening?

Sets have been also declared before;
9 SET
10 INTERVAL
11 GEN
12 GENPARAM
13 COSTCURVEPARAM
14 SYSPARAM
15 BLOCK
16 GENBLOCK
17 MG_GEN

Re: Error 352

Posted: Tue Jul 21, 2020 9:26 am
by Renger
as Adam wrote before: post your code that leads to the error, so people can run it and find what the cause is.
Cheers
Renger

Re: Error 352

Posted: Tue Jul 21, 2020 3:57 pm
by dirkse
Hello,

Many of the compilation errors that occur have to do with syntax - e.g. using symbols that are not declared, declaring an EEEQUATION, etc. But during compilation GAMS also checks for logical errors that would occur during the execution of the GAMS source. That's was error 352 is: an indication that execution would depend on a set that has not been initialized. The fix of course is to initialize the set. In some cases that means setting explicitly to empty. In others you have to include the data that define the set.

Here's a tiny example:

Code: Select all

set I;
parameter c(I);
c(I)$[ord(I) > 1] = 7;
If this doesn't help, you should include a short example of your own illustrating the problem.

-Steve

Re: Error 352

Posted: Tue Jul 21, 2020 8:46 pm
by brucemccarl
look for missing semi colons