README for GPEXTRA This is an FTP directory maintained by Mark Horridge containing latest versions of various aids to GEMPACK work. In brief, the files are: VIEWHAR.ZIP ViewHar header array file viewer. DAGG.ZIP DAGG program for aggregating and disaggregating data files PREPRO.ZIP Text file pre-processor MEL.ZIP Shareware text editor MINORANI.ZIP Non-GEMPACK program to solve small model for teaching purposes UTILS.ZIP Small programs to make DOS even nicer MISC.ZIP Miscellaneous PRTSOL.ZIP Programs to process GEMPACK results RUNBTC.ZIP System of enhanced batch file processing GPEXTRA.ZIP All of the above in one large ZIP file Fuller descriptions and instructions follow. The instructions assume (and one or two batch files require) that you create a directory C:\GPEXTRA and put it in your DOS path. PKUnzip the various packages into the directory C:\GPEXTRA. Complaints and suggestions to mark.horridge@buseco.monash.edu.au Fix List 12/9/96 * added DOS error level setting to PREPRO * fixed scalar div by zero bug in ViewHAR ********************************************************* VIEWHAR.ZIP The VIEWHAR Windows program allows one to see the contents of Header Array Files. It is made available here so that you can update to the latest version. No installation program is given. Simply copy VIEWHAR.EXE and VIEWHAR.HLP over the top of your existing ViewHAR files. (You could play safe by renaming the old files first !). If you don't already have ViewHAR, copy both files into your GEMPACK directory. Use the €Program Manager..New..Program command to install the icon. ********************************************************* DAGG.ZIP The DAGG program is designed to perform the most common operations involved in aggregating or disaggregating real matrices on header array data files. It is used to assist in disaggregating or aggregating GEMPACK model data bases. It can read the newer format RE matrices, but writes the older RL format. (Tip: use your model's update facility with zero shock to turn the data base from RL to RE format). Changes for the second edition of DAGG (December 1995) include 3 new commands: two species of RAS command and the AGGREG command which allows the user to specify that, for example, export demand elasticities for an aggregated data file are to be weighted averages of those on the parent file, the weights being the values of exports. The instructions have also been expanded. They are in the file DAGG.DOC, a Word for Windows document. ********************************************************* PREPRO.ZIP PREPRO is a text file processor similar to the preprocessors supplied with or incorporated into many compilers. It is useful for tasks such as: * creation of large (boilerplate) documents by combining small documents * personalizing standard documents (mail merge) * maintaining several versions of a document in one source file and many other purposes which you may dream up. The source code for PREPRO is written in standard FORTRAN 77 source code so that it can be compiled and used on any target processor that supports FORTRAN 77. Instructions are contained in the text file PREPRO.DOC ********************************************************* MEL.ZIP MEL (Multi-Edit Lite) is a shareware editor which can: * handle big files * handle several files at once * uses the mouse * has windows-like command sequences If you like it, buy the full version (see MEL.DOC). ********************************************************* MINORANI.ZIP MinOrani is an interactive DOS program which generates numerical solutions for MO, the miniature or skeletal version of ORANI described in Chapter 2 of "ORANI: A Multisectoral Model of the Australian Economy", (Dixon, Parmenter, Sutton and Vincent; North-Holland 1982). A number of Word for Windows documents are included for use as teaching handouts. ********************************************************* UTILS.ZIP A small collection of useful DOS programs. BROWSE filename for quick viewing of a file. ESC to leave. WHERE recip*.* searches whole hard disk for a file SWEEP command executes "command" here and in every subdirectory below. e.g.: SWEEP DEL *.PI5 XC checks that groups of files are the same: see XC.DOC DIRSIZES output shows size in Kb of current directory and of each subdirectory below. Good before PKZIP -rp or xcopy/s HIDEBIG HIDESMLL SHOWBIG SHOWSMLL These four commands are all use to "hide" or "unhide" files. "Hidden" files are exempt from the action of DOS commands. This fact can be exploited to perform selective deletes and copies. Hide and UnHide files with these commands: hidebig 10000 hides all files >10k hidesmall 10000 hides all files <10k showbig 10000 unhides all files >10k showsmall 10000 unhides all files <10k attrib +h *.sl4 hides all SL4 files attrib -h *.* unhides all files examples of use: hidesmall 50000 del *.* deletes all files >50k attrib -h *.* hidebig 50000 pkzip bakup *.* zips up all files <50k attrib -h *.* ********************************************************* MISC.ZIP contains following files - all GEMPACK aids: PIEIT.BAT PIEIT.INP FINDEXOG.EXE SHORT.EXE PRTDAT.EXE PRTTAB.EXE READ.EXE READCHEK.EXE They are used as follows: PIEIT.BAT - makes PI5 file from SL4 Usage: PIEIT GTG_92 this reads GTG_92.sl4 and writes GTG_92.pi5, controlled by file PIEIT.INP assumed to be in C:\GPEXTRA directory. FINDEXOG - attempts to create exogenous variable list from INF file. Usage: FINDEXOG model Searches MODEL.INF to produce report file MODEL.CLS. Assumes that TABLO ran without errors and some condensation occurred. FINDEXOG assumes some attempt to follow a proper equation naming convention. For example, the equation which explains variable "x1" should be named "E_x1". If several equations together explain the whole of variable "x1", they should be named "E_x1_A", "E_x1_B", and so on. SHORT - makes files shorter for printing or viewing - removes page throws, blank lines and trailing spaces Usage: SHORT infilename outfilename PRTTAB - formats TAB file for printing (intelligent page throws, date etc) Usage: PRTTAB infilename outfilename Put "!P" in col 1 for page throw PRTDAT - like SEEHAR but shows only row and column totals useful for dumping big databases also shows number of negative elements READ: assembles several real matrices into one long text file suitable for input to MODHAR (using "at" command) USAGE: READ infile outfile where infile is a text file with one or more lines: each line contains: (a) a four letter header (b) number of rows (c) number of cols (d) name of a data file containing numbers (e) long name of data item for example: V100 103 103 V1BASD.DAT Intermediate inputs domestic If (b) and (c) are both 1, then READ expects a value rather than a filename. for example: VRSD 1 1 -8114 SAM residual The data files containing numbers must have the following format: Each row on one line, numbers separated by one or more spaces READ will stop with a runtime error if the format is wrong or if a file cannot be found, or if a matrix does not have the expected number of rows and columns. Use the READCHEK program to find how many rows and columns a data file has. ********************************************************* PRTSOL.ZIP Contains following files STRETCH.EXE SHORTCSV.EXE ACCUMSOL.EXE DEVIATE.EXE SIDEJOIN.EXE SLTOHTIT.BAT SLTOHTIT.INP SS2SHOCK.EXE BRIEFCSV.EXE All these programs are part of a method of processing GEMPACK results using SLTOHT to create a CSV file using the SPREADSHEET MAPPING FILE option. The batch file SLTOHTIT creates such a CSV file (and runs it through SHORTCSV to remove extra lines and GEMPACK messages). The command: SLTOHTIT temp pretty or, in a batch file: CALL SLTOHTIT temp pretty assumes that TEMP.SL4 and PRETTY.MAP are present. It makes TEMP.CSV. [NB: SLTOHTIT assumes that sltohtit.inp is in the directory c:\gpextra] PRETTY.MAP is a text file which contains one variable name per line. It is used to select from the SL4 file the variables for a table. The output TEMP.CSV file can be opened directly in Excel or processed further by the following programs: ACCUMSOL - combines matching CSV solution files made by SHORTCSV or SLTOHTIT - adds following columns: A total (arithmetic) sum of original columns B total (geometric) sum of original columns C average (geometric, if possible) of original columns - search for !!!: means average is only arithmetic nb if 1st 3 letters of var are Del or del then A B and C are all arithmetic Usage: ACCUMSOL infile1 infile2 .... outfile no more than 40 input files ACCUMSOL is used to prepare a table with several solutions, one per column. The input files must all have been prepared using SLTOHTIT with the SAME map file. Such tables are used to compare simulations, or to decompose complex simulations into the effects of different component shocks, or to present the results of year-on-year forecasts. The output is a CSV file which you can open in Excel. You can delete columns A,B and C in Excel if you don't want them. Above "geometric" sum and average means "compound": if A and B are percentage changes then C is the geometric total if 1 + C/100 = (1+A/100)*(1+B/100) and D is the geometric average (or average annual growth rate) where (1+D/100)*(1+D/100) = (1+A/100)*(1+B/100) DEVIATE is very useful in comparing two alternative sets of year-on-year forecasts. DEVIATE - reads two matching CSV files prepared by ACCUMSOL 1st one is control scenario 2nd one is alternative scenario output file contains deviations relative to control NB last THREE cols in input files are ignored Usage: DEVIATE infile1 infile2 outfile The problem sometimes arises, how do we split a large-change result into the effect of separate shocks. STRETCH offers one approach. To use it, prepare Johansen estimates for each shock, and a large-change total result. Use SLOTOHTIT and ACCUMSOL to combine these into one CSV file. Open this in EXCEL, delete the last three columns, and save as a CSV file (for input to STRETCH). STRETCH - adjusts Johansen columns to add to large-change sum Usage: STRETCH infile outfile Every line of infile is supposed to contain the same number of columns, separated by commas. The first column is the variable name. The next Npart columns are the Johansen decomposition. The final column is the large change total. Outfile has a similar format: The first column is the variable name. The next Npart columns are the Johansen decomposition, adjusted to add to the large change total. The next column is the large change total. 2 additional columns are added: the total of the original Johansen columns, and the original difference between Johansen and large change results Method of adjustment - the original difference is distributed in proportion to the absolute value of the Johansen columns. SS2SHOCK is indispensable in the following case, which arises, for example, in historical forecasting applications. You have completed a large simulation with a complicated closure. Now you wish to perform a matching simulation using another complicated closure. Every variable that is exogenous in the 2nd simulation must have the value that it did in the 1st simulation (whether or not that variable was originally exogenous). Create a SPREADSHEET MAPPING file containing the names of ALL variables exogenous in the 2nd simulation (the second CMF file will serve as a model). Using SLTOHTIT or SLTOHT and this map file, extract from the 1st SL4 file values for all variables which are to be exogenous in the second sim. The output CSV file will probably contain many zero values. SS2SHOCK removes these, and formats the remaining numbers so that they can be inserted directly into the 2nd CMF file as shocks. USAGE: SS2SHOCK infile outfile Creates shock file for insertion in CMF from SLTOHT SS output Infile: from SLTOHT SS output with Spreadsheet mapping file Outfile contains line like: Shock x2 3 = 3.1; SIDEJOIN.EXE - joins text files side by side Usage: SIDEJOIN infile1 infile2 .... outfile no more than 12 input files (use 2 steps to join more) Note SIDEJOIN has been mostly superseded by ACCUMSOL. SHORTCSV.EXE - shortens CSV file produced by SLTOHT SS map option Usage: SHORTCSV infile outfile MATRIX VARIABLES The system described above is based on one column per solution. For matrix variables another approach must be used. Use SLTOHT with HEADER map file. SLTOHT will make such a file, which you can edit. Write a Header Array file containing the matrix variables that you want. Run this through SEEHAR with SS option. You will get a CSV file. Clean it up with BRIEFCSV: BRIEFCSV - shortens CSV file produced by SEEHAR SS option Usage: BRIEFCSV infile outfile ********************************************************* RUNBTC.ZIP System of enhanced batch file processing contains files: RUNBTC.BAT BTCTOBAT.EXE PRTSOLHD.BTC PRTSOLSS.BTC RUNBTC.TXT For the batch file enthusiast who is irritated by the inability of GEMPACK programs to accept command-line parameters. Do you find yourself making BAT files like the following ? tablo