Search found 17 matches

by AndrewC
11 months ago
Forum: Syntax
Topic: Call error
Replies: 7
Views: 2628

Re: Call error

Could you try the following:

$CALL GDXXRW MLI_SAM2018.xlsx Par=SAM rng=D4:DD108 log=gdxxrw_input_data.log trace=3

This will produce a new file called gdxxrw_input_data.log which might contain additional useful information to help figure this out.
by AndrewC
11 months ago
Forum: Syntax
Topic: How can i set option seed=<A SCALAR>
Replies: 1
Views: 5734

How can i set option seed=<A SCALAR>

Amongst various model settings we read in from gdx it includes a random seed value. We want to assign this random seed using the option seed= But the compiler complains it is expecting an interger, so I guess it is a compilation time setting? Is there a way to read in some model settings from file a...
by AndrewC
1 year ago
Forum: Syntax
Topic: csv2gdx - detecting failures during execution rather than compilation
Replies: 3
Views: 4152

Re: csv2gdx - detecting failures during execution rather than compilation

Thanks, a lot fo rme to unpack. Ive never really delved deeply into all this stuff because I mainly run my own models so can figure out crashes when they happen. With our models moving more and more into the clients hands they tend to screw up the data more regularly, so I am going to have to learn ...
by AndrewC
1 year ago
Forum: Syntax
Topic: Is there a way to $include csv files into parameters/sets?
Replies: 2
Views: 2591

Is there a way to $include csv files into parameters/sets?

I often have data read in using $include files, formatted using the a.b.c 10 format parameter myData(a,b,c) / $include myData.txt /; myData.txt: a1.b1.c1 10 a2.b2.c2 20 Is there a way to do this with csv files? parameter myData(a,b,c) / $include myData.csv /; myData.csv: a1,b1,c1,10 a2,b2,c2,20 The ...
by AndrewC
1 year ago
Forum: Syntax
Topic: csv2gdx - detecting failures during execution rather than compilation
Replies: 3
Views: 4152

csv2gdx - detecting failures during execution rather than compilation

I am new to csv2gdx so I am trying to get my head around how it operates when the input csv is bad. I want to generate some gdx files from csv inputs. But sometimes those input csv files might be bad. When in use GDXXRW to read from Excel, if the data is bad it just doesn't generate the GDX output, ...
by AndrewC
1 year ago
Forum: Syntax
Topic: How to make a datetime stamp for prefixing to reports
Replies: 1
Views: 3918

How to make a datetime stamp for prefixing to reports

I want to make a datetime stamp when the model starts and then prefix this to all the reports the GAMS code creates during execution. I tried the following but it doesn't seem to evaluate the date functions at compile time: { Create the report prefix Gregorian datetime stamp } $setglobal REPORT_PREF...
by AndrewC
1 year ago
Forum: Syntax
Topic: Using $goto during execution - possible?
Replies: 1
Views: 3306

Using $goto during execution - possible?

We have some code where it would be very useful if we could do a $goto jump during execution. For example at the beginning read in some data, and if we know there is an issue with the data then do a $goto jump to the end. The conditional would be a scalar value only known during execution. is this p...
by AndrewC
2 years ago
Forum: Syntax
Topic: Help wanted speeding up code
Replies: 2
Views: 1751

Re: Help wanted speeding up code

Amazing, thank you so much. Just a small note, I changed the code that assigned the valLastYear to the unpopulated values to be: MY_DATA(g,ay)$(ord(ay) > posLastYear(g)) = valLastYear(g); The reason is that we might have some 0 data in MY_DATA(g,ay) before the year that contains the last year value....
by AndrewC
2 years ago
Forum: Syntax
Topic: Help wanted speeding up code
Replies: 2
Views: 1751

Help wanted speeding up code

We have some code that has become a bottleneck as the data size has increased. I know that how things are written can affect the speed of code execution in GAMS so wondered if someone could help us. We have annual data in the database that contains the assumption that if data is missing then the las...
by AndrewC
2 years ago
Forum: Syntax
Topic: Can I distinguish parameter value defined as zero vs default to zero
Replies: 1
Views: 2583

Can I distinguish parameter value defined as zero vs default to zero

We are reading parameter data in from a GDX file (created using either GDXXRW and Excel or via Python depending on our application). If the dataset did not have data entered for a given set of indexes, MY_PARAMETER(i,j) returns 0; If the dataset did have data entered for a given set of indexes but t...