|
Plain text |
Top Previous Next |
|
Plain text put files contain information arrayed in a fixed format for passage to another program. For example, the following segment of code from regput.gms writes data in 13 column wide fields from various internally calculated arrays into a file called tosass.put for subsequent use in a statistical program.
file tosass; put tosass; loop(run, put run.tl; put @12; put /; loop(decwant, s= fawelsum( "Agconswelf",decwant,run)/1000; put s:13:0;); put /; loop(decwant, s= fawelsum( "Agprodwelf",decwant,run)/1000; put s:13:2;); put /; loop(decwant, s= fawelsum( "AGtotwelf",decwant,run)/1000; put s:13:0;); put /; );
A portion of the resultant file (tosass.put) contents is
r1 30 40 50 60.00 70.00 80.00 7.56 15.11 22.67 r2 40 50 60 70.00 80.00 90.00 7.56 15.11 22.67 r3 50 60 70 80.00 90.00 100.00 7.56 15.11 22.67
The lines gives the case name for the following lines, which are typically the input and output data for a modeled scenario, followed by the data characterizing the case. In turn the target program needs to have instructions prepared that read that data in that format. |