echo off rem rem rem * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * rem * * rem * PGC.BAT is used to sequentially print or plot STATA graph files * rem * * rem * In order for this BAT to run successfully COMMAND.COM needs to * rem * be located in a subdirectory specified in a PATH statement or it * rem * must be located in the directory where the BAT is being invoked. * rem * * rem * Written by: * rem * John A. Anderson, UNH Sociology Department * rem * August 1991 * rem * * rem * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * rem rem if NOT exist gphdot.exe goto ERROR_1 if NOT exist gphpen.exe goto ERROR_1 if "%1"=="" goto ERROR_2 if "%2"=="" goto ERROR_2 if NOT "%1"=="gphdot" goto CHECK_PEN if "%1"=="gphdot" goto CHECK_OPT :CHECK_PEN if NOT "%1"=="gphpen" goto ERROR_2 :CHECK_OPT if "%3"=="end_trick" goto DOGPH if "%4"=="end_trick" goto DOGPHO_1 if "%5"=="end_trick" goto DOGPHO_2 if "%6"=="end_trick" goto DOGPHO_3 if "%7"=="end_trick" goto DOGPHO_4 if "%8"=="end_trick" goto DOGPHO_5 if "%9"=="end_trick" goto DOGPHO_6 if NOT "%9"=="" goto ERROR_3 if NOT "%8"=="" goto GPHO_6 if NOT "%7"=="" goto GPHO_5 if NOT "%6"=="" goto GPHO_4 if NOT "%5"=="" goto GPHO_3 if NOT "%4"=="" goto GPHO_2 if NOT "%3"=="" goto GPHO_1 :GPH for %%p in (%2) do command /c %0 %1 %%p end_trick goto END_MSG :DOGPH %1 %2 goto END_1 :GPHO_1 for %%p in (%2) do command /c %0 %1 %%p %3 end_trick goto END_MSG :DOGPHO_1 %1 %2 %3 goto END_1 :GPHO_2 for %%p in (%2) do command /c %0 %1 %%p %3 %4 end_trick goto END_MSG :DOGPHO_2 %1 %2 %3 %4 goto END_1 :GPHO_3 for %%p in (%2) do command /c %0 %1 %%p %3 %4 %5 end_trick goto END_MSG :DOGPHO_3 %1 %2 %3 %4 %5 goto END_1 :GPHO_4 for %%p in (%2) do command /c %0 %1 %%p %3 %4 %5 %6 end_trick goto END_MSG :DOGPHO_4 %1 %2 %3 %4 %5 %6 goto END_1 :GPHO_5 for %%p in (%2) do command /c %0 %1 %%p %3 %4 %5 %6 %7 end_trick goto END_MSG :DOGPHO_5 %1 %2 %3 %4 %5 %6 %7 goto END_1 :GPHO_6 for %%p in (%2) do command /c %0 %1 %%p %3 %4 %5 %6 %7 %8 end_trick goto END_MSG :DOGPHO_6 %1 %2 %3 %4 %5 %6 %7 %8 goto END_1 :ERROR_1 cls echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ echo ³ *** ERROR *** ³ echo ³ ³ echo ³ Could not find GPHDOT.EXE or GPHPEN.EXE ³ echo ³ ³ echo ³ PGC.BAT must be invoked from a directory that contains ³ echo ³ either GPHDOT.EXE or GPHPEN.EXE ³ echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ goto END :ERROR_2 cls echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ echo ³ You must type in two parameters after the PGC command ³ echo ³ - Parameter #1 must be either GPHDOT or GPHPEN ³ echo ³ - Parameter #2 indicates the address of the files you ³ echo ³ want to print or plot ³ echo ³ - Parameters #3 to #6 indicate the STATA print options ³ echo ³ [These are not required parameters] ³ echo ³ ³ echo ³ Example 1: if the files that you want to print/plot are in ³ echo ³ the subdirectory C:\STATA\GPH you would type the following: ³ echo ³ ³ echo ³ PGC GPHDOT C:\STATA\GPH\*.* ³ echo ³ ³ echo ³ Example 2: if you want to use STATA print options the ³ echo ³ command might look as follows: ³ echo ³ ³ echo ³ PGC GPHDOT C:\STATA\GPH\*.* /n /r50 /c2 ³ echo ³ ³ echo ³ ** NOTE: Only six options may be used at any one time ³ echo ³ [this is a limitation of PGC.BAT & not of STATA] ³ echo ³ ³ echo ³ To print your files please retype your command at the prompt. ³ echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ goto END :ERROR_3 cls echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ echo ³ This .BAT file only allows for the use of Six (6) print ³ echo ³ options at any one time -- This is a limitation of this ³ echo ³ particular .BAT and NOT of your STATA program. ³ echo ³ ³ echo ³ If you wish to use more than six options or if you wish ³ echo ³ to use different options for different files you may ³ echo ³ enter each command individually at the DOS prompt or ³ echo ³ you can use a text editor to enter them line by line in ³ echo ³ a new .BAT file as shown in the example below: ³ echo ³ ³ echo ³ C:\STATA\gphdot graph1 /n /r80 /s50 /s025 /so110 /t122 /c10 ³ echo ³ C:\STATA\gphdot graph2 /l /r50 /s40 ³ echo ³ C:\STATA\gphdot graph3 /n /r80 /s50 /s025 /so110 /t122 /c10 ³ echo ³ ³ echo ³ Please refer to your STATA manual for individual entry ³ echo ³ and refer to your MS-DOS manual for information about ³ echo ³ creating and executing .BAT files ³ echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ goto END :END_MSG echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ echo ³ *** COMPLETED STATA PRINT JOBS *** ³ echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ goto END :END_1 rem This is the end_trick... an end around! :END