BookmarkSubscribeRSS Feed
comeon2019
Calcite | Level 5

Hi,

I used to use the following code to export SAS data into Stata and it worked.

 

proc export data=WORK.US_rd39 outfile= "C:\Users\Desktop\research\projects\R&D\data1st\us_rd39.dta";

run;

 

But now it says 

*ERROR: Unable to determine datasource type.  Please use the DBMS= option.;

 

I used DBMS=Stata like below:

 

PROC EXPORT DATA= WORK.US_rd39

            FILE= "C:\Users\Desktop\research\projects\R&D\data1st\us_rd39.dta"

            DBMS=STATA REPLACE;

     PUTNAMES=YES;

RUN;

 

But the ERROR message said DBMS type STATA not valid for export.

 

Could anyone please help me to look into this issue? Thank you.

 

 

 

8 REPLIES 8
SASKiwi
PROC Star

According to the documentation DBMS = DTA is the correct option for exporting to STATA: https://documentation.sas.com/?docsetId=acpcref&docsetTarget=p1d0tocg3njhmfn1d4ld2covlwm0.htm&docset...

 

You will find answers a lot quicker if you search the documentation first.

comeon2019
Calcite | Level 5

Thanks SASKiwi.

I had a look at the documentation and tried DBMS = DTA, but it still shows the following error message

 

ERROR: DBMS type DTA not valid for export.

 

I don't know why.

SASKiwi
PROC Star

DTA is a valid option only if you have SAS/ACCESS to PC Files licensed and installed. PROC SETINIT will show if it is in your licence and PROC PRODUCT_STATUS will show if it is installed.

comeon2019
Calcite | Level 5

Thank you SASKiwi. 

As I checked, it seems “SAS/ACCESS Interface to PC Files” is not licensed or installed.

IT people in my organization helped me with the renewal of SAS last month. I am not sure how if he has installed all the components that we are entitled to, but I would personally reckon that he should have installed all the components by default.

According to your knowledge, do we need to purchase additional component?

Thank you.

 

SASKiwi
PROC Star

Applying a SAS licence doesn't involve installing products unless the licence has changed to require it. Comparing your current SAS licence with the previous one should confirm if anything has changed. If nothing has then I'm mystified as to why STATA exports used to work but now don't.

jcheng
Calcite | Level 5

Hi,

 I also has the problem when I use sas(sas eg) import proc to import .dta file into sas. It either has the error"the physical file does not exist "

ballardw
Super User

@comeon2019 wrote:

Hi,

I used to use the following code to export SAS data into Stata and it worked.

 

proc export data=WORK.US_rd39 outfile= "C:\Users\Desktop\research\projects\R&D\data1st\us_rd39.dta";

run;

 

But now it says 

*ERROR: Unable to determine datasource type.  Please use the DBMS= option.;

So when did you "use to use" that code? Before a SAS license change, on a different SAS install, different computer?

Something has changed and will likely point to the reason code doesn't work.

 

 

comeon2019
Calcite | Level 5

Thank you ballardw.

I used that code early this year. It worked.

I renewed SAS last month after it was expired. 

I not sure if the components in the licence have changed or not during the renewal. 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 3943 views
  • 0 likes
  • 4 in conversation