Learning SAS? Welcome to the exclusive online community for all SAS learners.

Convert .XPT to SAS Datasets

Reply
New Contributor
Posts: 4

Convert .XPT to SAS Datasets

 

 

Below is my code and i'm using SAS studio.

 

libname sasfile '/folders/myfolders/';
 libname xptfile xport "my folders/dm02.xpt";

 

proc copy in=xptfile out=sasfile ;
 
   run;

 

And below is the error I'm getting.

 

NOTE: Input library XPTFILE is sequential.
ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/my folders/dm02.xpt.
NOTE: Statements not processed because of errors noted above.
NOTE: PROCEDURE COPY used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
 
NOTE: The SAS System stopped processing this step because of errors.

 

Can someone please help me with this?

Thanks

Rashmi. 

Super User
Posts: 19,855

Re: Convert .XPT to SAS Datasets

Posted in reply to rashmirao99

Your second libname looks wrong, did it autocorrect to my folders vs myfolders?

 

 

New Contributor
Posts: 4

Re: Convert .XPT to SAS Datasets

No. It didn't. So, except that does everything looks good?

Super User
Super User
Posts: 7,074

Re: Convert .XPT to SAS Datasets

[ Edited ]
Posted in reply to rashmirao99

Since you did not give the LIBNAME statement a fully qualified filename you told it to look for a file in the current working directory.  The error message is showing that the file you asked for is not in that directory. 

 

Fully qualified filenames on Unix systems need to start with /.

libname xptfile xport "/folders/myfolders/dm02.xpt"; 

 

New Contributor
Posts: 4

Re: Convert .XPT to SAS Datasets

I did change the code. And ran the code. But still it is giving me the same error. Also I'm using SAS UNIVERSITY EDITION. 

Please help.

Super User
Posts: 19,855

Re: Convert .XPT to SAS Datasets

Posted in reply to rashmirao99

Post your full code AND log. 

 

 

New Contributor
Posts: 4

Re: Convert .XPT to SAS Datasets

The Code:

 

libname sasfile '/folders/myfolders/';
 libname xptfile xport '/folders/myfolders/dm02.xpt';

 

proc copy in=xptfile out=sasfile ;
 
   run;

 

And the log:

 

 

libname sasfile '/folders/myfolders/';
NOTE: Libref SASFILE refers to the same physical library as _TEMP3.
NOTE: Libref SASFILE was successfully assigned as follows:
Engine: V9
Physical Name: /folders/myfolders
63 libname xptfile xport '/folders/myfolders/dm02.xpt';
NOTE: Libref XPTFILE was successfully assigned as follows:
Engine: XPORT
Physical Name: /folders/myfolders/dm02.xpt
64
65
66
67 proc copy in=xptfile out=sasfile ;
68
69 run;
 
NOTE: Input library XPTFILE is sequential.
ERROR: Physical file does not exist, /folders/myfolders/dm02.xpt.
NOTE: Statements not processed because of errors noted above.
NOTE: PROCEDURE COPY used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
 
NOTE: The SAS System stopped processing this step because of errors.
Super User
Super User
Posts: 7,074

Re: Convert .XPT to SAS Datasets

Posted in reply to rashmirao99

That error seems clear also. The file does not exist (or at least not with that exact name).

If you can see the file in the SAS/Studio files and folders gui tool then you can select it and ask SAS/studio to show you the properties. That should include the exact name of the file as SAS sees it.  So copy and paste that name into your code.

 

If you cannot find it in the SAS/Studio but it is on your PC then upload it.

Ask a Question
Discussion stats
  • 7 replies
  • 221 views
  • 0 likes
  • 3 in conversation