Dynamic names for GDX files
Moderator: aileen
Forum rules
Please ask questions in the other sub-forums
Please ask questions in the other sub-forums
Dynamic names for GDX files
How do I generate dynamic filenames for GDX files?
Re: Dynamic names for GDX files
Under certain circumstances one may want to use a dynamically generated filename for GDX files. The put_utility can be used to achieve this:
The log file reads:
Code: Select all
scalar i;
for (i=1 to 10,
put_utility 'gdxout' / 'out' i:0:0;
execute_unload i;
);
for (i=1 to 10,
put_utility 'gdxin' / 'out' i:0:0;
execute_load i;
display i;
);
Code: Select all
--- Starting compilation
--- new1.gms(10) 2 Mb
--- Starting execution: elapsed 0:00:00.015
--- new1.gms(2) 3 Mb
--- GDX File [...]\out1.gdx
--- GDX File [...]\out2.gdx
--- GDX File [...]\out3.gdx
--- GDX File [...]\out4.gdx
--- GDX File [...]\out5.gdx
--- GDX File [...]\out6.gdx
--- GDX File [...]\out7.gdx
--- GDX File [...]\out8.gdx
--- GDX File [...]\out9.gdx
--- GDX File [...]\out10.gdx
--- new1.gms(6) 3 Mb
--- GDXin=[...]\out1.gdx
--- GDXin=[...]\out2.gdx
--- GDXin=[...]\out3.gdx
--- GDXin=[...]\out4.gdx
--- GDXin=[...]\out5.gdx
--- GDXin=[...]\out6.gdx
--- GDXin=[...]\out7.gdx
--- GDXin=[...]\out8.gdx
--- GDXin=[...]\out9.gdx
--- GDXin=[...]\out10.gdx
*** Status: Normal completion
--- Job new1.gms Stop 05/25/20 15:16:40 elapsed 0:00:00.031