Explanatory text rules

Top  Previous  Next

The statements declaring sets, scalars, parameters, tables, files, acronyms, variables, equations and models all can contain explanatory text.  These explanatory text entries must follow a set of rules.  Namely they

Are optional
Can be up to 255 characters long
May be quoted or unquoted
May contain spaces
Must all be entered on one line along with the item name
In unquoted text
Can only contain the special character _ (underscore).
Cannot contain GAMS reserved words (variable, parameter, etc.).
In quoted elements
Any special characters are allowed (including international ones if charset=1 option used)
Must have matching quotes at the beginning and end of each element name.
May use either " or ' but the usage of these must match up.
May contain GAMS reserved words are allowed in quotes.
Can nest quiotes with oly the outer quotes being of concern to GAMS i.e. they could contain "A nested 'quote' like this"
Should not be treated as optional for named items since will appear in the Symbol List as argued in the Writing Models and Good Modeling Practices chapter.

 

Note the explanatory text for set elements is only accessible through the .te put file command

Examples:

Below the explanatory text for item names in green and the explanatory text for set element names in blue.  Note for ease of understanding, each example has a separate line for each element (namerules.gms)

 

Setshoess    "my test"

                        /tennis  here i can tell you what this is

                         dress   'special characters if needed /*+-'/

Setkshoes        with underscore_;
Setkshoes3       "with special characters * / ? , ";
Setkshoes4       "with 'quotes' like in can't and won't "
Parameterdata3                THIS IS explanatory text       /1/;
VariableA6item        "***** look at this one";
EquationWh(shoes)     Model equation;
Modelnotexthere /all/;