How to replace a parameter entry from one gdx file to another

questions about GAMS' tools
Post Reply
Jubeyer
User
User
Posts: 41
Joined: 4 years ago

How to replace a parameter entry from one gdx file to another

Post by Jubeyer »

Hi,

I am very new to GAMS, I am trying to replace one parameter entry of an existing gdx file with another entry of the same name but different dimension and number of elements from another gdx file. It seems like I need to use the $loadr option but I don't really get it. Can anyone suggest how can I accomplish that.

Another question is how to remove one parameter entry from one gdx file and merge two gams file together with different contents?

Regards,
Jubeyer
User avatar
bussieck
Moderator
Moderator
Posts: 1037
Joined: 7 years ago

Re: How to replace a parameter entry from one gdx file to another

Post by bussieck »

There is no replace mechanism in GDX. You can load all your data from GDX into a GAMS program including your "old" p(i,j,k) now you make a new parameter pnew(i,j,k,l,m) from the values of the old parameters. Now you export all the parameters using execute_unload 'new.gdx', i,j,k,l,...,pnew=p; The pnew=p exports the parameter pnew with the GDX name p.

-Michael
Post Reply