1
votes

I'm trying to import a Stata version 13 file in my SAS 9.4 - but keep getting the error message

For Stata, Release flags of 103 to 115 are supported. You had -> 60 Requested Input File Is Invalid ERROR: Import unsuccessful. See SAS Log for details.

Folliwing code does not work:

proc import out = uw14 datafile = "C:\User\KE14_hhld.dta"; run; 

Neither does this: proc import out = uw14 datafile = "C:\User\KE14_hhld.dta" dbms = stata replace; run;

I've found out that SAS 9.4 does not read Stata version 13 files. SAS 9.4 only reads Stata 12 files (or earlier).

One solution could be to save the Stata 13 file as an older version - but I only have Stata 12 on my computer and it's unable to open the version 13 file. Another solution could be to save it as a CSV file in R - this done by following code:

proc import out = uw14 datafile = "C:\User\KE14_hhld.csv"; run; 

But I've tried this and the transformation sets an unmanageable amount of my variables as characteristics instead of numeric and kills all formats.

Any other ideas?

(I'm not able to download other versions than SAS9.4 and Stata12) Thanks

2
Please post code attempt. Are you using proc import? And why use R for CSV file, both Stata and SAS have such facilities.Parfait
My code in SAS: proc import out = uw12 datafile = "C:\User\KE12_hhld.dta"; run; I was using R as this was the only thing a had that could read the Stata 13 file. Neither my SAS (version 9.4) or my Stata (version 12) were able to.Stine
Post your code in your question, using the EDIT functionality, not in the comments.Reeza
Your code as shown doesn't specify the DBMS, make sure you do that.Reeza
Folliwing code does not work... is not helpful. Please post log error message. Did you try dbms = dta?Parfait

2 Answers

0
votes

You can try to use R as a kind of third party. You can transform your dta into R data.frame and then write out the data.frame into .sas7bdat.

You can do all of this using the Haven package if I recall correctly. 2 or 3 lines of code should be sufficient:

Haven documentation

0
votes

You can use stat/transfer for most type of data conversions: https://stattransfer.com