This is file bonus.txt The BUNDLExx package installs these command-line programs: AggHAR for aggregating model data HAR files - see ViewHAR online help Change32 batch global search and replace editor CleanupRDyn deletes from current folder un-needed files made by RunDynam CSV2HAR convert database text format to real header in HAR file DiffHAR computes differences between matching real matrices on two HAR files DirSizes shows sizes of directories and subdirectories DumpSets writes all sets used in input HAR file to output HAR or TXT file Excerpts renumbers excerpts in TAB files Fuj2Lhy convert Fujitsu-format HAR file into Lahey-format HAR file GemTimes extracts main CPU times from log file of Gempack simulation HAR2CSV convert real headers in HAR file to database text format HAR2Txt turns HAR file into GEMPACK text data file HAR2XLS turns HAR file into XLS file Head2CSV convert specified header in HAR file to CSV file Head2XLS convert specified header in HAR file to XLS file Head2PX convert real header(s) in HAR file to PC-Axis [.px] file(s). HideBig temporarily "hide" larger files in current folder (prior to zip or backup) InterMap: makes 3-column table showing mappings of two sets Left and Right to a 3rd set Middle. Later for batch files: allows you to branch if fileA is later than fileB Lhy2Fuj convert Lahey-format HAR file into Fujitsu-format HAR file MergeHAR combines headers from 2 HAR files into one; versatile options RenSet renames all occurrences of one set in a HAR file ScaleHAR multiplies real numbers in HAR file with a common factor Seq2har reads SEQ file to make HAR file of timeseries results SetErr for batch files: sets or clears the DOS errorlevel ShowBig "unhide" larger files in current folder (undo HideBig) SortHead sorts real vector in HAR file SplitHAR splits 1 HAR file into many; reverses the action of CMBHAR TABLTG a batch file which, ONLY IF NECESSARY, runs TABLO and LTG TinyHAR turns zeroes into tiny numbers, or tiny numbers into zeroes TstHAR allows TABLO-generated program to influence flow-of-control in BAT file Txt2HAR turns GEMPACK text data file into HAR file Where32 locates files on your hard disk XLS2Head convert matrix in XLS file to header in HAR file ZipSEQ Zips an SEQ file (and SL4 files listed therein) from a RunDynam simulation Each is designed to be used within the DOS box, or in a batch program. You can get brief help for each command by typing its name without arguments. EG, type "WHERE32" to see instructions. WHERE32 AND DIRSIZES ******************** These are 2 general utility programs: Where32 finds files you have lost, identifies the most recent version of files with the same name, and shows which version of XXX.EXE is run when you type XXX. DirSizes shows the size of the current directory and of each folder below the current directory. It can be used to discover which directories are responsible for using up hard disk space. Often the display is too much for a single screen; in that case, type "DirSizes | more" or "DirSizes > LOG" and then print or view the file LOG. DirSizes takes an optional integer parameter N to restrict report to N directories deep. HIDEBIG and SHOWBIG ******************* Use these when you want to zip or backup a folder, excluding some very large files. You would go: DIR/OS to see files, biggest last HIDEBIG 1000000 to "hide" files size > 1 megabyte ZIP myzip *.* to zip all visible files (but not those > 1 megabyte) SHOWBIG 1000000 to "unhide" files size > 1 megabyte CHANGE32 ******** Batch Global Search and Replace Editor USAGE: change32 changefile infile outfile Converts infile using list in changefile changefile contains a list of replacements each line contains one old/new pair, thus /oldstring/newstring/ any delimiter may be used instead of "/" example from command line: for %a in (*.sti) do change32 chnglist %a newfiles\%a example in batch file: for %%a in (*.sti) do change32 chnglist %%a newfiles\%%a MERGEHAR ******** Merges the contents of two HAR files into one HAR file. This could be useful, when you use TABLO programs to produce data matrices which are scattered over different output files. Or, if you find your TABLO program has to do a lot of copying of matrices from one file to another, consider using MergeHAR to do this task. A HAR file may not contain two matrices with the same 4-character key (or header). MergeHAR allows you to choose what happens if a header name clash occurs. MergeHAR also allows you to exclude from a file any headers that are not also present on another file. Some GEMPACK programs, such as CMBHAR, insist that several input files contain exactly the same headers. You could use MERGEHAR with the "NN1" option (see below) to produce such files. A typical MergeHAR command might be: MERGEHAR OLD1.HAR OLD2.HAR NEW.HAR YY2 where, OLD1.HAR and OLD2.HAR are the 2 existing input files. NEW.HAR is the new output file. The last parameter must consist of 3 characters as follows: Char 1 for headers unique to OLD1: Y - copy, N - ignore. Char 2 for headers unique to OLD2: Y - copy, N - ignore. Char 3 for headers common to both: 1 - use OLD1, 2 - use OLD2, N - ignore So, in the example above, "YY2" means: Take all headers from both files, except OLD1 headers that also exist in OLD2. TABLTG ****** TABLTG is designed to assist the automation of data procedures which use TABLO-generated Fortran programs. These often include one or more batch (BAT) files which: run TABLO to create a FOR file run LTG to create an EXE file run the EXE file Often, the TABLO and LTG stages take much longer than running the EXE. TABLTG saves time by running TABLO and LTG only when necessary, that is, only when the EXE file is missing or predates the TAB file. To use it you would create a BAT file like the following: CALL TABLTG JOB1 JOB1 -cmf JOB1.CMF You might execute the BAT repeatedly, but TABLO and LTG would only be run if you had altered JOB1.TAB since last time. In more detail, the command: Runs TABLO and LTG if necessary, eg, if EXE or AXS or AXT is missing or has earlier date than TAB. %1 (1st parameter) is name of TAB file, without suffix. %2 (2nd parameter) is optional: it is name of STI file, WITH suffix. If %2 is omitted, but there exists a STI file with the same name as the TAB (but with STI extension), then TABLTG will use that STI file. Otherwise TABLO runs with no STI. If a STI file is used, TABLTG assumes that the STI file refers to (ie, contains name of) the TAB file mentioned as %1. There are more detailed notes at the top of the BAT file. RENSET ****** RenSet: renames occurrences of a set in HAR file. Example: RenSet OLD.HAR NEW.HAR REGION ZONE' above, OLD.HAR is input file, using set REGION. NEW.HAR is output file ... -- every occurrence of set REGION will be renamed to set ZONE.'); See "Rename Set" topic in ViewHAR online help. SETERR and LATER **************** These are 2 small programs useful in batch files: SETERR sets or clears the DOS errorlevel LATER allows you to branch if file A is later than file B TABLTG.BAT shows an example of their use. TinyHAR ******* Zeros in CGE databases can cause problems. TinyHAR can be used to turns all zeros into very tiny numbers, so avoiding the problems. You could type: TinyHAR OLD.HAR NEW.HAR 1.0E-20 where OLD.HAR is the existing input file. NEW.HAR is the new output file. zeros and numbers with abs value < 1.0E-20 will be replaced by 1.0E-20. Type "Tinyhar /?" to get more instructions. It is possible to replace zeros in selected headers only. There is also a /D option which turns numbers below a certain limit into zeros. ScaleHAR ******** Multiplies real numbers in HAR file with a common factor. Useful in GAMS where the size of flows must be appropriate. example: ScaleHAR OLD.HAR NEW.HAR 0.001 1BAS 2BAS above, OLD.HAR is the existing input file. NEW.HAR is the new output file. Real numbers will be multiplied by 0.001 1BAS and 2BAS are the headers to be altered. If no headers are specified], zeros will be replaced in ALL real headers will be scaled. The /X (exclude) option may be added at the end to reverse the action. example: ScaleHAR OLD.HAR NEW.HAR 1E-3 1BAS 3BAS /X scales all real numbers EXCEPT headers 1BAS and 3BAS. SplitHAR ******** Splits 1 HAR file into many, corresponding to columns of last dimension (ie, reverses the action of CMBHAR). example: SplitHAR COMBINED.HAR NUFIL JCOL above, COMBINED.HAR is the existing input file. SplitHAR expects this to contain several RE matrices which mostly have a last dimension of length N (N is computed as the modal size of the last dimension of RE matrices). N output files will be produced, each containing 1 of the slices 1-N from all original RE matrices that had last dimension of size N. NUFIL is a key used to construct output filenames by adding digits, giving NUFIL001.HAR, NUFIL002.HAR, up to a possible maximum of NUFIL999.HAR. The last parameter is optional but must be a legal header name not used on the input file. If present, each output file will have an additional header containing a single integer: the column from which data was drawn. Txt2HAR ******* turns GEMPACK text data file into HAR file. examples: Txt2HAR old.txt new.har (reads old.txt, writes new.har) Txt2HAR horse.txt (reads horse.txt, writes horse.har) HAR2Txt ******* turns HAR file into GEMPACK text data file. examples: HAR2Txt old.har new.txt (reads old.har, writes new.txt) HAR2Txt horse.har (reads horse.har, writes horse.txt) If file suffixes are omitted, default ".HAR" or ".TXT" suffixes are assumed, (unless the filename ends with a period). For example: HAR2Txt old new (reads old.har, writes new.txt) HAR2Txt horse. (reads horse, writes horse.txt) Use optional 3rd parameter to extract 1 header only, eg: HAR2Txt old.har new.txt VFMD (reads header VFMD from old.har, writes it to new.txt) GPDel ***** deletes rebuildable products of TAB files (to save space) Usage: GPDEL /D Action: for each TAB file in current folder, deletes files of same name with the following extensions (suffixes): .EXE .AXS .AXT .GSS .GST .MIN .MNC .INF .CLO .LOG .MDV .MDC .MDE Option: GPDEL /S Works as above in current folder AND ALL SUBFOLDERS. SortHead ******** Sorts real vector in HAR file. example: SortHead OLD.HAR DAT3 NEW.HAR /R above, OLD.HAR is the existing input file; DAT3 is the header to be sorted: must be a real vector; NEW.HAR is the new output file. /R is optional: it reverses the sort order (so largest comes first). The output file will contain: * a copy of the original header * SRTD: the sorted vector * RANK: the ranking of the original vector [integer] * ORDR: the order in which original items appear in SRTD [integer] * SSET: set SRT sorted elements of input set. Download example programs showing how to use SortHead from: http://www.copsmodels.com/gpmark.htm Note: Above is only useful for older GEMPACK. Since GEMPACK 9, sorting and ranking may be performed from within the TAB file. DiffHAR ******* Computes differences between matching real matrices on two HAR files. example: DiffHAR OLD1.HAR OLD2.HAR DIFFS.HAR P above, OLD1.HAR and OLD2.HAR are the 2 existing input files. DIFFS.HAR is the new output file. The last parameter must consist of one or more of the letters O, D, P or M: O for original values D for ordinary changes = OLD1-OLD2 P for percent changes = 100*[OLD1-OLD2]/OLD2 M for difference metric = |a-b| if |a|<1 or |b|<1, else = |a-b|/MIN(|a|,|b|) DiffHAR seeks "matching" real matrices [ie, same header and dimension] in the two files, and writes corresponding matrices of ordinary or percent changes to the output file. You could use DiffHAR either for checking differences between two files, or to compute results as the difference between quantities on the initial and updated datafiles used in some simulation. DiffHAR can also compare solution files, if both inputs have SL4 extension. DumpSets ******** DumpSets: writes all sets used in input HAR file to output HAR or TXT file. Sets stored in a HAR file are of two types: (1) sets stored as vectors of strings on their own character headers (2) sets attached (as labels) to real arrays. DumpSets is the only way to extract sets of type (2). Example use: DumpSets OLD.HAR ALLSETS.HAR above, OLD.HAR is input file. ALLSETS.HAR is output file containing all sets used in OLD.HAR The 4-letter header used for each output set corresponds to the input header where that set was found. If the extension of the 2nd (output) file is TXT, the output file will be in GEMPACK text format; otherwise, the output file will be in HAR format. TstHAR ****** TstHAR: check if specified header in HAR file contains positive scalar; for use in batch files to control flow by errorlevel value. Example: TstHAR OLD.HAR DAT3 above, OLD.HAR is the existing input file; DAT3 is the header to seek If OLD.HAR does not exist, or is not a HAR file, or if there is no scalar RE header DAT3, TstHAR will terminate with errorlevel 2. Otherwise, if DAT3 contains a number <=0, TstHAR will terminate with errorlevel 1. Otherwise, TstHAR will terminate with errorlevel 0. Example BAT file might read ........do something which produces OLD.HAR with scalar header DAT3 ........value in DAT3 controls what happens next TstHAR OLD.HAR DAT3 REM next two tests must be in the following order if errorlevel 2 goto REALERROR if errorlevel 1 goto NONPOS REM if we get here, errorlevel must be zero echo DAT3 contained a positive number ........do some things goto endbat :NONPOS echo DAT3 contained number <= 0 ........do some other things goto endbat :REALERROR echo ERROR...ERROR....ERROR :endbat XLS2Head and Head2XLS ********************* These 2 programs convert between HAR and XLS (Excel97) format. XLS2Head: convert matrix in XLS file to header in HAR file. syntax: XLS2Head xlsfile sheetno nrow ncol row1 col1 head harfile example: XLS2Head NEW.XLS 1 33 2 4 5 DAT3 NEW.HAR above, OLD.XLS is the existing input Excel file; "1" means look in the first worksheet [normally Sheet1]; "33 2" means extract a matrix of 33 rows and 2 columns; "4 5" means topleft cell of matrix is at position [4,5] on the worksheet; DAT3 is the header on output HAR file; NEW.HAR is the output HAR file. Notes: Every cell to be extracted must contain a number. Row and column labels are not extracted. Input XLS must not be currently open in Excel. If outfile file exists, header will be added; otherwise new output file will be created. Head2XLS: convert specified header in HAR file to XLS file. example: Head2XLS OLD.HAR DAT3 NEW.XLS above, OLD.HAR is the existing input file; DAT3 is the header to be placed in XLS: must be a real array; NEW.XLS is the new output Excel file. HAR2XLS ******* This programs writes all (or selected) headers to an XLS file, one header per sheet. example: har2xls OLD.HAR NEW.XLS 1BAS 2BAS above, OLD.HAR is the existing input file. NEW.XLS is the new output Excel file (xls suffix is assumed). 1BAS and 2BAS are the headers (max allowed=50) to be written to NEW.XLS. If no headers are specified, all real and integer arrays will be written, one per sheet (sheetname=header). First few sheets will contain file history, sets, mappings, and integer vectors. Works the same as the ViewHAR File..Save as..XLS command. HAR2CSV and CSV2HAR ********************* These 2 programs convert between HAR and a one-value-per-line text format used by database and some other programs (ComTrade,Stata). The CSV2HAR program is described in CSV2HAR.DOC. HAR2CSV: writes real arrays from HAR file to CSV text-file database format -- one row for each nonzero cell. example: har2csv OLD.HAR NEW.CSV 1BAS 2BAS above, OLD.HAR is the existing input file. NEW.CSV is the new output file. 1BAS and 2BAS are the headers to be written to NEW.CSV. If no headers are specified, all real arrays will be written You can add option "/D" at the end: example: har2csv OLD.HAR NEW.CSV /D The "/D" causes an additional descriptive row to precede each item. Or you can add option "/T" at the end, to use tabs (not commas) as separators; or add "/TD" for both options. ZipSEQ ****** Zips an SEQ file (and SL4 files listed therein) from a RunDynam simulation. ZipSEQ: creates ZIP of SEQ file and all SL4 files listed in SEQ file. Usage: ZipSEQ infile outfile where: infile: existing SEQ file listing 1 or 2 series of SL4 files outfile: output ZIP file to be created SEQ2HAR ******* Seq2har: reads SEQ file to make HAR file of timeseries results Usage: seq2har infile outfile nseries -opt1 -opt2 -opt3 where: infile: existing SEQ file listing 1 or 2 series of SL4 files outfile: output HAR file to be created nseries: must be one of 1, 2, or 3, where: 1: means get results for 1st (eg, base) series only. 2: means get results for 2nd (eg, policy) series only. 3: means compute difference (eg, 2-1 deviation) in results between 2 series. options: if present, must be one or more of: -C: cumulate results (otherwise year-on-year is produced). -M: macro variables (<=12 chars) are combined into a single header "MACR". -S: headers are sorted by variable name. For example: seq2har mysim.seq out.har 3 -M -S puts cumulative deviations in out.har, combining macros and sorting by variable name. Caveat: as of June 2010 this program is still evolving ... details may change INTERMAP ******** InterMap: prepares 3-column table relating two sets L and R, which each map to a 3rd set M. Example: InterMap OLD.HAR Left2Middle Right2Middle Out.CSV Above, OLD.HAR is the existing input file which contains the following 2 mappings: Left2Middle is the name of a mapping from set L to set M. Right2Middle is the name of a mapping from set R to set M. Out.CSV is a text output file that you can read into Excel. Note, to avoid problems, please ensure first that you can see both mappings with ViewHAR's Aggregation..Choose Mappings command, and that both mappings map to the same set. Head2CSV ******** Head2CSV: convert vector or matrix real header in HAR file to CSV spreadsheet format Takes 3 parameters. Example: Head2CSV OLD.HAR DAT3 NEW.CSV above seeks real header DAT3 in OLD.HAR and writes it to NEW.CSV You could read the data in R with the statement: mydata <- read.table("new.csv",header=TRUE,row.names=1,sep=",") Head2PX ******* Head2PX: convert real header(s) in HAR file to PC-Axis [.px] file(s). Can take 1, 2, or parameters. 1st parameter must be an existing HAR file. Example with 1 parameter: Head2PX OLD.HAR above turns each real header in OLD.HAR into a PX file named after that header. Example with 2 parameters: Head2PX OLD.HAR DAT3 above seeks real header DAT3 in OLD.HAR and writes it to DAT3.PX. Example with 3 parameters: Head2PX OLD.HAR DAT3 NEW.PX above seeks real header DAT3 in OLD.HAR and writes it to NEW.PX. CleanupRDyn ************ Deletes from current folder un-needed files made by RunDynam Use to reduce the size of a RunDynam working folder prior to backing up, or to save disk space. Usage: CleanupRDyn ALL Deletes the following files: *.bot *.top *.csv *.rsl *.sl4 *.slc *.sli *.sol *.udc *.bak *.log *.cmf *.ds3 *.ds4 *.ds5 xx.xx ???-????-*.har ????-*.txt batchjob*.ds? Please ensure that HAR files (eg, shock files) that you need to keep do NOT match the pattern ???-????-*.har.