GAMS error- Too much data on this line- rest ignored

Problems with syntax of GAMS
Post Reply
scouser_s
User
User
Posts: 8
Joined: 4 years ago

GAMS error- Too much data on this line- rest ignored

Post by scouser_s »

I am trying to load data from a csv file (attached) using the following command:

set
i /1*1001/
;
parameter x(i)/
$ondelim
$include Data.csv
$offdelim
/;

The file has only 1001 data points. However, I am getting the following message in GAMS:

error 465 Too much data on this line - rest ignored. Any suggestion on fixing this error is much appreciated.
Attachments
Data.csv
(5.75 KiB) Downloaded 197 times
Fred
Posts: 372
Joined: 7 years ago

Re: GAMS error- Too much data on this line- rest ignored

Post by Fred »

Hi,

You are not using proper GAMS syntax. You miss the indices and also it seems that you do not need $ondelim.
The following code snippet illustrates how your data should be formatted (with or withour $ondelim)

Code: Select all

parameter x(i)/
1 2, 2 2.003, 3 2.006, 4 2.009
/;
parameter xx(i)/
$ondelim
1,2
2,2.003
3,2.006
4,2.009
$offdelim
/;
I suggest to have a look at the documentation: https://www.gams.com/latest/docs/UG_Dat ... ASCII.html

I hope this helps!

Fred
Post Reply