Description
Generates some useful files from the Model Library.
Small Model of Type : GAMS
Category : GAMS Model library
Main file : gamsutil.gms includes : gamsmod.inc gamsref.inc
$title Generates some useful Files from the Model Library (GAMSUTIL,SEQ=190)
$onText
Generates some useful files from the Model Library.
GAMS Development Corporation, Modeling Tool Box.
The following system configuration/document files are written:
gamslib.glb IDE index and documentation
modlibfs.txt Makefile input file
All files $included, read and written have to be in the same
directory. This program can be execute from another location
by using the GAMS parameter U1, for example:
>gams gamsutil.190 U1=c:\oldd\alex\gams\gamslib\ver008\test\
Keywords: GAMS language features, GAMS model library
$offText
$setGlobal gamslib '%gams.u1%'
File
glb 'IDE model library index' / '%gamslib%gamslib.glb' /
glist 'makefile index file' / '%gamslib%modlibfs.txt' /;
Scalar first;
$offListing
$include gamsmod.inc
$onListing
*
* IDE modlib file
*
put glb
'Version = 5'
/ 'LibraryName = GAMS Model Library %version%'
/ 'Columns = 6'
/ '5 = SeqNr'
/ '6 = Lic|C=Community, D=Demo, L=Requires license'
/ '1 = Name'
/ '2 = Application Area'
/ '3 = Type'
/ '4 = Description'
/ 'InitialSort = 3'
/ '*$*$*$';
glb.lcase = 1;
loop(sm(s,m),
put / 'Files = ' m.tl:0 '.' s.tl:0; loop(incmap(inc,s), put ',', inc.tl:0;);
glb.lcase = 2;
put / '1 = ' m.tl:0;
put / '2 = '; first = 1;
loop(as(a,s)$first, put a.te(a); first = 0;);
put / '3 = '; loop(tss(t,s), put t.tl;);
glb.lcase = 0; put / '4 = ' m.te(m)
/ '5 = ' '000000':ceil(log(card(s) + 1)/log(10))
put @(glb.cc - card(s.tl)) s.tl:0
/ '6 = ';
put$community(s) 'C';
put$demo(s) 'D';
put$(not community(s) and not demo(s)) 'L';
glb.lcase = 1;
put_utilities 'glb'/ '%gamslib%' m.tl:0 '.' s.tl:0;
put / '*$*$*$';
);
putClose;
*
* makefile input
*
$sTitle List of all Files in Makefile Format
glist.lcase = 1;
put glist 'MODLIBFILES = \'
/ 'gamslib.glb \'
/ 'modlib.log \' ;
loop(inc, put / inc.tl:0 ' \';);
loop(sm(s,m), put / m.tl:0 '.' s.tl:0 ' \';);
putClose / / glist;