Files for Running in Batch Mode This describes the syntax of the DOS .BAT files you can prepare to run RunDynam in batch mode. You prepare these files in your text editor. Each line is of the form start/wait <program> <type-or-run> <years> <Sim Details> where •<program> is the full path name for RunDynam (for example, c:\RunDynam\RunDynam). You dont need to add the .EXE at the end. •<type-or-run> is either base, rerun, policy or base+rerun or rerun+policy or all. [No spaces around the + if you use either base+rerun or rerun+policy.] •<years> is either (i) all (which means all relevant years), or (ii) ss (which means just the Spreadsheet job) or (iii) is of the form dddd-eeee where dddd is the starting year and eeee is the ending year. These must be years as shown on the Closure/Shocks page. For example, <years> may be 1999-2012. The <years> parameter determines whether the spreadsheet job is done. The spreadsheet job will be done if <years> is all, ss or of the form dddd-eeee where eeee is the last year. Any spreadsheet job run as part of a batch job covers all relevant years. At present it is not possible to do spreadsheet jobs covering only some years as part of a batch job. •<Sim Details> is the name of the Simulation Details file for the application you wish to solve. You can either specify the full path name (for example, c:\mymodel\model-basb-br1r-pl1p) or just the file name (with no directory at the start). If you specify just the file name with no directory at the start, the program looks in the current Working Directory (as when you last ran RunDynam) for the file. You do not need to add the .DS1 suffix. <program> and <type-or-run> must be present on each line. If <Sim Details> is not present, the current Sim Details (as currently loaded into RunDynam when you last exited) are used. <years> must be present if <Sim Details> is present. If <years> is not present, all is assumed. Example of a batch file. start/wait c:\RunDynam\RunDynam all all start/wait c:\RunDynam\RunDynam policy all model-basb-br1r-pl3p Here the first line runs all of the application currently loaded into RunDynam. The second line runs all years for a different policy, namely the one with Policy Sim Name PL3P. The start/wait command tells the batch file to wait until this line is completed before going on to the next line. Each line starts RunDynam running to carry out the solves specified in that line. When they are completed (or if an error occurs), RunDynam closes. Then control passes to the next line in the batch file (which will start RunDynam running again). You can also include lines to do Systematic Sensitivity Analysis (SSA) in batch mode. You can include other commands in BAT files which run RunDynam in batch mode. These include commands to change into a specified directory, to test the DOS ErrorLevel and to do other normal batch commands (such as deleting files, copying files, running other programs). If RunDynam encounters an error when running in batch mode, it sets the DOS ErrorLevel to 1. You can use this in your .BAT files, for example to terminate the .BAT job. Second Example of a batch file. d: cd \mymodel start/wait c:\RunDynam\RunDynam all all if errorlevel 1 goto error cd \mymodel2 start/wait c:\RunDynam\RunDynam policy all model-basb-br1r-pl3p if errorlevel 1 goto error goto end :error echo There has been an error :end You can use cd [change directory] commands or fully specify the path name of the Simulation Details files interchangeably. For example, the two sets of commands below run exactly the same RunDynam simulation, namely all years of all parts of the simulation in d:\mymodel\model-basb-br1r-pl3p. [However, other statements (eg, copy statements) in these two .BAT files may have different effects since the two .BAT files may be attached to different directories. When RunDynam is launched, Example 3a is attached to directory d:\mymodel whereas the Example 3b is attached to whatever directory it was launched from.] Example 3a d: cd \mymodel start/wait c:\RunDynam\RunDynam all all model-basb-br1r-pl3p Example 3b start/wait c:\RunDynam\RunDynam all all d:\mymodel\model-basb-br1r-pl3p URL of this topic: www.copsmodels.com/webhelp/rundynam/hc_batfiles.htm Link to full GEMPACK Manual Link to GEMPACK homepage |