Enable $show / $showVariables from Command Line

Hi :wave:

I’m parsing the results of the $show command, specifically $showVariables (aka the compile time variable list) using a script. Right now, the script relies on the $show command being present at the end of an input GAMS file, otherwise the compile time variable list would obviously not be printed to the listing file.

Sometimes, the $show command is deleted on accident, which then breaks the script. Is there a way to enable the $show from the command line, or a possibility to export the list of compile time variables to a file (e.g. like the reference command https://www.gams.com/45/docs/UG_GamsCall.html#GAMSAOreference).

Thanks for your help!
Best
Christoph

Christoph,

There is no command line parameter or similar to trigger this. The first thing that comes to my mind for this is to run with some driver.gms which you run to wrap yourMoldel.gms like this

$include %myCode%
$show

and call it like

gams driver.gms --myCode=yourModel.gms

. In such driver you could then of course also define more things you usually need.

Hope that helps,
Lutz

Hey Lutz,

Thanks your suggestion! That’s indeed a clever and simple solution, though I have to check if it breaks other parts of the script since it changes the include file structure!
Thanks,
Christoph