Error 352

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

Error 352

Post by hbshrestha » 1 year ago

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

User avatar
achristensen
User
User
Posts: 14
Joined: 1 year ago

Re: Error 352

Post by achristensen » 1 year ago

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

--adam

Jubeyer
User
User
Posts: 27
Joined: 10 months ago

Re: Error 352

Post by Jubeyer » 4 months ago

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: 614
Joined: 4 years ago

Re: Error 352

Post by Renger » 4 months ago

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: 132
Joined: 4 years ago
Location: Fairfax, VA

Re: Error 352

Post by dirkse » 4 months ago

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: 5
Joined: 3 years ago

Re: Error 352

Post by brucemccarl » 4 months ago

look for missing semi colons

Post Reply