Stata Technical Bulletin
STB-4
Using this BAT file eliminates the need for remembering a somewhat unusual MS-DOS command line. Also, it is “friendly”
and easy for beginners and students to use. If the command is not entered correctly, an explanation will be provided to help the
user reenter the command correctly.
Note: More information on the use of FOR and CALL can be found in Wolverton (1989). It should be noted, however, that I
was unable to successfully obtain the desired output when following Wolverton’s self-calling BAT example exactly. A comparison
of the PG. B AT and the BAT on page 83 will reveal the discrepancies.
Using a modifiable BAT file
When you require different Stata options or Stata print commands to be used with each graph in a series, a modifiable BAT
file can be effectively used.
1. Using a text editor, create a BAT file (e.g., PJOB.BAT) and list “line-by-line” the necessary Stata command for each graph
(in this example, store PJOB.BAT in the subdirectory that contains GPHDOT.EXE and/or GPHPEN.EXE).
Example: GPHDOT C:\STATA\MYGRAPH\ONE.GPH /N
GPHDOT C:\STATA\MYGRAPH\TWO.GPH /N /+ ∕C2
GPHPEN C:\STATA\MYGRAPH\THREE.GPH
2. Execute the BAT file.
3. Using your text editor, modify the BAT file each time you wish to print a different set of graphs.
Using Windows 3.0 Enhanced Mode to increase productivity
When a printing session is expected to take up a fair amount of time you have two choices—go to lunch or use Windows
3.0 in enhanced mode to print your graphs in the background while doing other work on your word processor, spreadsheet, or
Stata.
1. To use enhanced mode with Windows, you need an 80386 or 80386SX processor—if you have a 386 choose any of the
printing methods described above.
2. Access your DOS COMMAND. COM by double clicking on the DOS Prompt icon (if you do not have a DOS Prompt icon, use
your file manager to run COMMAND.COM).
3. When DOS becomes active, hold down the ALT key and press the SPACEBAR.
4. Click on “Settings...” in the drop own menu that is displayed.
5. Under “Tasking Options” click on “Background” and then click on “OK”.
6. Enter the command for the Stata print method of your choice at the DOS prompt—you can now minimize the COMMAND
window into an icon and access another program such as your word processor—your graphs will continue printing in the
background until they are completed.
References
Wolverton, Van 1989. Supercharging MS-DOS. Redmond, WA: Microsoft Press
os2.1 Questions and answers about Stat/Transfer—an addendum
Ted Anagnoson, California State University, Los Angeles
In STB-2, there were a series of questions and answers about Stat/Transfer. While they are complete as far as they go, I
have discovered several characteristics of Stat/Transfer that will make life much easier for those of you who use it to move
datasets around.
Q. I am using Borland’s Quattro Pro Spreadsheet. Can I use Stat/Transfer to move my data into Stata?
A. The answer given was to save the spreadsheet in the .wkl format that Borland and most spreadsheets provide and then
move it. This is OK, but we had a case this summer in our workshops on exploratory data analysis and Stata where Quattro
had saved the worksheet with a blank line in row 1, the variable names in row 2, a blank line in row 3, and the data
starting in row 4. Since Stat/Transfer assumes that the top row of the spreadsheet is the variable names and the next row
is the first case of data, it would not transfer over this worksheet.1 So you might need to look at the spreadsheet either in
Quattro format or in Lotus format and make sure that there are no blank lines or other inconsistencies.
Q. How can I control the size and data type of my Stata variables?