                 General Pension Provider Instructions
     The batch file, RunPen4.bat, is set up to: 1) run the Generate
program, 2) build the Calculate program from the existing source code
and the source code created by the Generate program,  3) compile the
Calculate program source code, and 4) run the Calculate program for
all 3 runtypes on the example files supplied with the Pension Provider
software.
     I recommend that you copy the RunPen.bat file and modify it for
each data set you wish to process.  To modify a copy of RunPen.bat to
handle your data files you can use any standard DOS text file editor
such as Edit.com which comes with MS-DOS.  If you use an editor like
Word or WordPerfect the file MUST be saved as an ASCII text (DOS)
file.  You will need to replace all of the files in the example with
the .EXM extension.  These are the example data files.  You will also
want to rename the output files (these have EXM in the file name) to
something more appropriate to your study.  A disection of the batch
file RunPen.bat is found later in this document.  If you do not wish
to run the Calculate program on all three runtypes you can comment out
the calls to the Calculate program for those runtypes.  See the
Pen_PC95.TXT documentation files for definitions of the files and
Run Type values.


NOTE: DOS has a command line limit of 127 characters, be sure that the
file names in the batch file commands do not extend past the 127th
character.  This can be avoided by running the program from within the
subdirectory in which the data files are located in (file paths are
not required in this case).

     The program was written and tested in Borland Pascal with Objects
v7.0.  Since this package is no longer commercially available, the
backend programs (Calculate, Evaluate, Outside, etc.) have been modified
to run under Turbo Pascal which is still available.  Any modification
to the Generate or Integrate programs still requires Borland
Pascal in order to run without incident.  Runpen4.bat will
expect the Pascal compiler to be in the DOS path.  If it is not, you
will need to add it to your DOS path or modify the RunPen.bat file
accordingly.  If the compiler is not in the DOS path, you will also
have to copy the file DPMI16BI.OVL from the BIN subdirectory of the
compiler directory to the directory where you are working.  Borland
Pascal will offer to add itself to your DOS path upon installation,
that is the simplest way to achieve this.

     The batch file RunPen.bat is initially set up to run with the
example files included with the Pension Provider software.  The
example input files have the file extension .exm, the example output
fles for the Calculate program will have "EXM" in the file name.  You
will need to change these file names in the batch file to run with
your files.  To run the Pension Provider on the example files you only
need to call the original batch file RunPen.bat from the DOS prompt.
               Disection of the batch file RunPen.bat

NOTE: Lines with >>> at the beginning are the documentation lines, all
others are lines from the batch file RunPen.bat.

>>> Start batch file here <<<

>>> ECHO OFF stops the batch file lines from being written to the screen (monitor).
>>> The @ symbol tells DOS not to output this line to the screen.
@ECHO OFF

>>> All lines which begin with REM are comments, REM means remark.
REM RunPen.bat, this batch file does the following:
REM 1) Runs the Generate program to create the plan procedures and cases files.
REM 2) Integrates the procedures and cases with the Calculate source code.
REM 3) Compiles the Calculate program with the procedures and cases produced.
REM 4) Runs the Calculate program for each RUNTYPE value.

REM NOTE: If an error occurs during compilation of the Calculate program,
REM a message will come on screen and the error will be output.

REM NOTE: This batch file also outputs to the screen processing progress info
REM along the way using the DOS ECHO command.

REM NOTE: This file is currently set up to run the example files.
REM To use this file to run the Pension Provider software on your own files
REM substitute your file names in place of the example files (*.exm).

REM NOTE: the word REM in batch files means that the line is a comment (REMark)


REM Run the generate program
>>> ECHO tells DOS to print the following text to the screen.
>>> ECHO. means print a blank line to the screen.
ECHO.
ECHO Running the generate '95 program...
REM Syntax: GENER95 DictionaryFile GenerateDataFile
Gen95 pendict.new PENDAT95.EXM

REM Integrate the procedures and cases into the Calculate source code
ECHO.
ECHO Creating the plan procedures units ...
ECHO and inserting the cases files into the Evaluate source code files...
REM Syntax: INTEGR95 OrigEvalUnit OutEvalUnit ProcFile CasesFile Cases2File
Integr95 Eval95.pas Evalu95.pas Procedur.pas Cases.pas Cases2.pas

REM Compile the calculate program, and check to see if it was successful
ECHO.
ECHO Compiling the Calculate '95 program...
>>> BPC is the Borland Pascal DOS Protected Mode compiler,
>>> Protected Mode allows the program to access more than the lower 640K of memory.
>>> The compiler options /GD, /B, etc. can be looked up in the compiler
>>> documentation
BPC /GD /B /CP /L /$N+ /$E+ CALC95 > ERRORS.TXT
>>> The compiler program will return a numeric result if there is an error,
>>> this can be tested for using the DOS "IF ErrorLevel" command.
>>> GOTO tells DOS to search for the label ":ERRORS" in the batch file and resume
>>> processing of the batch file at that point
IF ERRORLEVEL 1 GOTO ERRORS

>>> The batch file continues on the next page.....
>>> If compilation is successful the following lines will execute.
>>> The following lines will delete any unneeded files.
REM Delete extraneous files...
REM Any of the following lines can be commented to save the plan procedures
REM units source code, object or map files.
>>> EvlP*.pas are the source code unit files created by Integrat.exe
>>> from Procedur.pas
DEL EVLP*.PAS
>>> *.tpp are the Pascal object files created by the compiler.  Object files are
>>> compiled source code files.  The object files get put into the executable file,
>>> Calc95.exe.  Once this is done the object files are no longer needed.
DEL *.TPP
>>> The MAP file is a description of the executable file, it is used for debugging
>>> the program.
DEL CALC95.MAP
>>> Procedure.pas, Cases.pas and Cases2.pas are the source code files that were
>>> created by the Generate program.  These can be deleted once the Calculate
>>> program has compiled successfully, as they are also no longer needed.
REM DEL Procedur.pas
REM DEL Cases.pas
REM DEL Cases2.pas


>>> Run the Calculate program with the example files.
>>> The example input files all have extension .EXM, the example output files
>>> all have the letters EXM in the file name.
REM Run the Calculate program for the 3 run types...
ECHO.
ECHO Running the Calculate '95 program...RUNTYPE 1.2
REM Syntax: CALC95 RunType DataFile ParameterFile DataOutFile TableOutFile ErrorOutFile
Calc95 1.2 INDATA.exm inparm.95x outexm12.dat outexm12.tab outexm12.err

ECHO.
ECHO Running the Calculate '95 program...RUNTYPE 3.2
REM Syntax: CALC95 RunType DataFile ParameterFile DataOutFile TableOutFile ErrorOutFile
Calc95 3.2 INDATA.EXM inparm.95x outEXM32.dat outEXM32.tab outEXM32.err

ECHO.
ECHO Running the Calculate '95 program...RUNTYPE 4.2
REM Syntax: CALC95 RunType DataFile PlanFile ParameterFile DataOutFile TableOutFile ErrorOutFile
Calc95 4.2 PLANDATA.EXM inparm.95x INPLAN.EXM outEXM42.dat outEXM42.tab outEXM42.err

REM Successful run, go to the end of the batch file
>>> jump over the errors portion of the batch file to the end of the batch file,
>>> marked by the label ":END"
GOTO END

REM Compilation errors routine...
>>> ":ERRORS" is a label, labels are markers used by the batch file processor to
>>> mark positions for moving around the file.
:ERRORS
ECHO Errors occured during compilation, press any key to see the error file...
PAUSE
REM ECHO Errors occured during compilation...
REM ECHO Check the error file, Error.txt, for error listings...
TYPE ERRORS.TXT | MORE

:END
>>> End batch file here <<<

            Pension Provider Runtime/Compilation Support


     The Pension Provider programs can be run from the DOS command
line.  However, unless you have a good knowledge of Borland (Turbo)
Pascal and fully understand what is happening in the batch file,
RunPen.bat, I recommend that you use a copy of RunPen.bat to run the
programs on the data sets.  If you have questions concerning the use
of PC batch files please check with your local computer support person
or contact the support person listed below.


Any questions or comments may be directed to:

Jody Lamkin
University of Michigan
Institute for Social Research - Survey Research Center
Room 2062
P.O. Box 1248
Ann Arbor, MI 48106

Phone:
(313) 763-0418 or (313) 764-4417

e-mail:
jodyl@umich.edu


or
Bob Peticolas
16 Kimberly Ann Drive
Greenville, RI 02828

Phone: (401) 949-2279
e-mail: rwp@pipeline.com
