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

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

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