compile-time variable/Parameter

Hello guys
Hope you all are fine and healthy.
This is probably a novice question and I hope you don’t mind.

What is the difference between a ‘parameter’ and a ‘compile-time variable’ ?
I have seen codes starting with compile-time variables, such as:

$set P 130

I don’t get what facility it may bring in contrast with defining ‘P’ as a normal parameter. Specially since using ‘P’ in the code is a bit harder since it should be referred to as %P%.
Thanks for your consideration
Iman

Iman,

A compile-time variable is a mechanism for text substitution. For example, your GAMS code can look like this:

set I;
$gdxin data_%CASENAME%
$load I
$gdxin
blah blah blah
solve m using nlp min z;
execute_unlload ‘results_%CASENAME%’, blah, blah, blah;

and you can run the GAMS model like this gams xxx.gms --CASENAME=baseline etc

A parameter is a GAMS symbol and more than just some text.

-Steve

Dear Steve,
Thank you very much for the reply.
Also, I’d like to thank you for your answer to someone else’s post about the error msg in EMP: “key expected … but instance not in variable rim”.
Your reply worked for me as well. I truly appreciate your generous efforts,
You’re a SAVIOR

Iman