User Tools

Site Tools


This is an old revision of the document!

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.

IMPRESSUM / LEGAL NOTICEPRIVACY POLICY gams/how_can_i_find_unused_symbols_in_my_gams_model.1620330819.txt.gz · Last modified: 2021/05/06 21:53 by Atharv Bhosekar