Under certain circumstances one may one to use a dynamically generated filename also for gdx files. The put_utilities can be used to achieve this:
file foo; scalar i; for (i=1 to 10, put_utilities foo 'gdxout' / 'out' i:0:0; execute_unload i; ); for (i=1 to 10, put_utilities foo 'gdxin' / 'out' i:0:0; execute_load i; display i; );
The log file reads:
--- Job Untitled_1.gms Start 03/05/07 21:53:32 GAMS Rev 147 Copyright (C) 1987-2007 GAMS Development. All rights reserved ... --- Starting compilation --- Untitled_1.gms(11) 2 Mb --- Starting execution --- Untitled_1.gms(7) 3 Mb --- GDXin=D:\work\gamsdir\projdir\out1.gdx --- GDXin=D:\work\gamsdir\projdir\out2.gdx --- GDXin=D:\work\gamsdir\projdir\out3.gdx --- GDXin=D:\work\gamsdir\projdir\out4.gdx --- GDXin=D:\work\gamsdir\projdir\out5.gdx --- GDXin=D:\work\gamsdir\projdir\out6.gdx --- GDXin=D:\work\gamsdir\projdir\out7.gdx --- GDXin=D:\work\gamsdir\projdir\out8.gdx --- GDXin=D:\work\gamsdir\projdir\out9.gdx --- GDXin=D:\work\gamsdir\projdir\out10.gdx --- Putfile foo D:\work\gamsdir\projdir\foo.put *** Status: Normal completion --- Job Untitled_1.gms Stop 03/05/07 21:53:32 elapsed 0:00:00.203
See also the entry: Dynamic renaming of put-files.