BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am trying to run a means procedure on a dataset i found on icpsr.com. The website gave me a dataset that ends with .xpt. I put the file on my desktop and ran this code:

libname sasdata 'C:\Documents and Settings\econ4961\Desktop\04572-0002-Data.xpt';
data one;
run;
proc means;
run;

It doesn't work and it tells me that the dataset has 0 variables. Is there something else I should be doing? Please help, thanks.
2 REPLIES 2
Andre
Obsidian | Level 7
You encounter a sas table stocked in an xport format (xpt is usually the suffix but not always)
so you need a special manner to recreate a normal sas table

try this

[pre]
libname in xport 'C:\04572-0002-Data.xpt';
libname ou v9 "c:\";
proc copy in=in out=ou; select one;run;
*if you are sure that the dataset name is 'one' ,otherwise dont use the
select and read your log to find the table name;
proc means data=ou.one;
run;
[/pre]

Andre
deleted_user
Not applicable
The following note for Enterprise Guide gives you some code you can use in SAS 9.1 to import the transport file to a library.

http://support.sas.com/kb/16/800.html

You will need to define a library, in the sample code the SASUSER library is used, which may be adequate. To reference the data however, you will need to specify the table. Browse the library, or the log, and you will get a list of table(s) imported for your use.

I am surprised that a website made available a transport file without instructions on its use. I searched the website you specified and couldn't find any assistance there.

Kind regards

David

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2 replies
  • 8885 views
  • 0 likes
  • 2 in conversation