User Tools

Site Tools


gams:conditional_file_include

Conditional file include

Q: I'm trying to optionally include some code into my model. I was thinking this line would work, but it doesn't evaluate correctly. Could you please advise?

setglobal isUncertainty 1
...
$if %isUncertainty% == "1" $include ../uncertainty/input/coll10.gms

Try:

$SetGlobal isUncertainty
$if SetGlobal isUncertainty $Include sub.inc 
gams/conditional_file_include.txt · Last modified: 2007/05/04 10:58 (external edit)