Error 352

Problems with modeling
Post Reply
hbshrestha
User
User
Posts: 1
Joined: 4 years ago

Error 352

Post 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
achristensen
User
User
Posts: 18
Joined: 4 years ago
Location: Fairfax, VA

Re: Error 352

Post by achristensen »

best if you post some code.... is it possible to share publicly?

--adam
Jubeyer
User
User
Posts: 41
Joined: 4 years ago

Re: Error 352

Post 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
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: Error 352

Post 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
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
User avatar
dirkse
Moderator
Moderator
Posts: 214
Joined: 7 years ago
Location: Fairfax, VA

Re: Error 352

Post 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
brucemccarl
User
User
Posts: 13
Joined: 6 years ago

Re: Error 352

Post by brucemccarl »

look for missing semi colons
Post Reply