How do I use a Stata data file in SAS?
1. Reading a Stata data file with SAS
SAS reads Stata data files with proc import. The following example shows how to use SAS proc import to read in a Stata data file hsb2.dta. It is advisable to check the log file and use proc contents to ensure the data have been read correctly. Notice that SAS recognizes the file type to be imported by file extension.
proc import out= hsb2 datafile = "c:\datahsb2.dta"; run; proc contents data=hsb2; run;
2. Using Stat/Transfer
Stat/Transfer can transfer Stata files into SAS format. The process is simple and straightforward.