This shows you the differences between two versions of the page.
— |
gams:how_can_i_find_unused_symbols_in_my_gams_model [2007/08/14 08:57] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== How can I find unused symbols in my GAMS model? ====== | ||
+ | Q: //I'd like to find unused symbols in my GAMS models, e.g. sets and parameters that are declared but never used: not assigned to or referenced. I can look at the $onsymxref output but is there something that just tells me the unused symbols?// | ||
+ | |||
+ | You can get that information from a symbol reference file. Add the command line option ''rf=text'', where ''text'' is the name of your reference file to your GAMS command line. All symbol references will be written to this file. | ||
+ | |||
+ | If you use the GAMS IDE, click on the line in your process window, which starts with | ||
+ | |||
+ | ''--- RefFile ..'' | ||
+ | |||
+ | and you will get the contents of the reference file (here ''trnsport.ref'') nicely organized. The last tab (unused) shows the unused symbols. A double click on of the entries will get you to the corresponding position in the source file. | ||
+ | |||
+ | |||
+ | {{gams:trnsport_ref.jpg|}} |