'include a txt file in GAMS - errors 140 & 36 in the first lines of my txt file

I am a new user in GAMS and I am trying to include a txt file in my code, but I get the same errors (error 140 & error 36) in the first lines of my txt file again and again. Could anyone help?

My code goes like this, and I have also attached the txt file

* define the set of asset classes
set n Number of returns /n1*n120/;

* define Tables, Parameters, Scalars
Scalar T /120/;

$INCLUDE prices.txt

Please note, that later in the code I need to use the data from the text file in an equation like this:

EQ1..     sum(n, p(n)*prices(n)) =e= price0*exp(r*time);

Thanks

prices.txt file



Solution 1:[1]

Your prices.txt does not contain valid GAMS syntax. What you need is something like this:

Parameter prices(n) /
  n1 455.5
  n2 44545.5
  /;

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lutz