- About CISER Computing
- Computing Resources
- Request a CISER Computing Account
- Computing Node Availability and Usage
- Computing News & User Notes
- HelpDesk Services
- CISER Computing Basics
- CISER Computing FAQ
- Workshop Downloads
- Workshop Schedules & Registration
- Software on the Computing Nodes
- Online Help for Statistical Software
- Buying Statistical Software at Cornell
Reading ascii files with no filename extension into Stata
Q. I get the following error when trying to read a particular dataset from the CISER Data Archive, even though I’m certain I have the pathname correct. What is the problem?
file U:\ArchiveData\he\104\da6847.raw not found
r(601);
A. As a shortcut, many Stata commands (such as use, save, insheet, outsheet, infile, outfile and infix) add a default extension to file names that lack one.
For example, if you type:
infix var1 1-6 var2 7-9 using filename
then Stata will assume that you are referring to filename.raw.
Many ASCII files in the CISER Data Archive have no file extension at all. To prevent Stata from adding the default file extension to these, simply add a period to the end of the file name.
For example, if you wish to read the first two variables from the 1993 Natality Detail File, use:
infix year 1-4 rectype 5 using U:\ArchiveData\he\104\da6847.
If you omit the period, Stata will look in vain for U:\ArchiveData\he\104\da6847.raw and return the error message above.