SAS files into GAMS

questions about GAMS' tools
Jarenka
User
User
Posts: 64
Joined: 5 years ago

Re: SAS files into GAMS

Post by Jarenka »

For those who are working with R and GAMS, this could be helpful.

I think I corrected above problem. In attachment there is a new R-code, which works in GAMS.

In foto1 there is output in GAMS - a table "alldata" with dimensions and variables. In foto2 there is corrected R-code for this.

Now, I am trying to read the variables as parameters.

If you have any ideas, please let me know :-)
Attachments
foto2.JPG
foto1.JPG
Jarenka
User
User
Posts: 64
Joined: 5 years ago

Re: SAS files into GAMS

Post by Jarenka »

Guys, I think I did it.

I am sorry for posting so many posts, but I feel so excited by it.

Anyway, on the foto1 there is my last R-code that reads id *.dat file (shown in my previous post).

In GAMS program you have specify the code in foto2.

Be careful about the following things in R:
- when you specify how many dimensions a variable (or variables) has in one *.dat file, symDim has to have a value dim+1,
- if you want to make a nice "text" in GAMS during executing program, it is good to have some attributes specified in R - like these on the photo,

Some comments to GAMS program:
- include R-program to read in your *.gdx file created in R,
- specified dimensions of the parameter ("raa0_1998") ,
- load in the parameter,
- assign the parameter to variable(s) you want

I hope this will help you to work between R and GAMS.

Thank you Renger for your help !!!

Irena
Attachments
foto2.JPG
foto1.JPG
Post Reply