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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 8120 views
  • 0 likes
  • 2 in conversation