User Tools

Site Tools


gams:create_a_new_gams_chart_for_every_element_of_a_set

Creating a new GAMS Chart for every element of a set

The code below writes a new chart file for every element in set bc of an example model. Required spreadsheets: result_rismacro2000.xls, result_valagg2000.xls

*IMPORT DATA VALUE ADDED
$onecho> task1.txt
par=A   rng=a1
dset=x  rng=b1 cdim=1
dset=ac rng=a2 rdim=1
$offecho
$call Gdxxrw.exe result_VALagg2000.xls @task1.txt
$gdxin result_VALagg2000.gdx
set x(*);
$load x
set ac(*);
$load ac
parameter VALagg2000(ac, x);
$load VALagg2000=A
$gdxin

*IMPORT DATA risMACRO2000
$onecho> task2.txt
par=B   rng=a1
dset=bc rng=a2  rdim=1
$offecho
$call Gdxxrw.exe result_risMACRO2000.xls @task2.txt
$gdxin result_risMACRO2000.gdx
set bc(*);
$load bc
parameter risMACRO2000(bc, x);
$load risMACRO2000=B
$gdxin

execute_unload "pvx.gdx";
$onecho > pv.pv.gch
[CHART]
VERID=GAMSIDE Chart(s) V1
GDXFILE=pvx.gdx
TITLE=VALagg2000

[SERIES1]
SYMBOL=VALagg2000
TYPE=multi-line
Map=2,1
$offecho

file f;
put f;
loop(bc,
   put_utility 'ren'/'pv_' bc.tl:0 '.gch'
   put "[CHART]"
      /"VERID=GAMSIDE Chart(s) V1"
      /"GDXFILE=pvx.gdx"
      /"TITLE=" bc.tl
      /"[SERIES1]"
      /"SYMBOL=risMACRO2000"
      /"TYPE=line"
      /'FILTER="' bc.tl:0 '",*'
      /"MAP=2,1";
   );
putclose;
gams/create_a_new_gams_chart_for_every_element_of_a_set.txt · Last modified: 2007/08/10 09:00 (external edit)