BookmarkSubscribeRSS Feed
THaney
Calcite | Level 5

Hi,

 

I'm brand new to SAS so apologies if this is an easily solvable issue. I'm trying to extract an XPT file to a SAS file. The file locations are all correct, and the file is named correctly in the TEMP folder. I've been playing around with this for quite some time and just can't get it to work.

 

Here is my code:

libname NH "C:\SAS\NewData";
libname XP xport "C:\SAS\TEMP\wb.xpt";
proc copy in=XP out=NH;
run;

 

Here is the log:

NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
24
25 GOPTIONS ACCESSIBLE;
26 libname NH "C:\SAS\NewData";
NOTE: Library NH does not exist.
27 libname XP xport "C:\SAS\TEMP\wb.xpt";
NOTE: Libref XP was successfully assigned as follows:
Engine: XPORT
Physical Name: C:\SAS\TEMP\wb.xpt


28 proc copy in=XP out=NH;
29 run;

WARNING: Library NH does not exist.
NOTE: Input library XP is sequential.
ERROR: Physical file does not exist, C:\SAS\TEMP\wb.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.

 

If anyone has any good ideas that would be great! Thanks!

9 REPLIES 9
Reeza
Super User

Is there a folder called NewData?

Can you show a screenshot of those folders?

 

"C:\SAS\NewData"

 

Usually SAS is pretty correct about the folders not existing or the paths being incorrect.

 


@THaney wrote:

Hi,

 

I'm brand new to SAS so apologies if this is an easily solvable issue. I'm trying to extract an XPT file to a SAS file. The file locations are all correct, and the file is named correctly in the TEMP folder. I've been playing around with this for quite some time and just can't get it to work.

 

Here is my code:

libname NH "C:\SAS\NewData";
libname XP xport "C:\SAS\TEMP\wb.xpt";
proc copy in=XP out=NH;
run;

 

Here is the log:

NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
24
25 GOPTIONS ACCESSIBLE;
26 libname NH "C:\SAS\NewData";
NOTE: Library NH does not exist.
27 libname XP xport "C:\SAS\TEMP\wb.xpt";
NOTE: Libref XP was successfully assigned as follows:
Engine: XPORT
Physical Name: C:\SAS\TEMP\wb.xpt


28 proc copy in=XP out=NH;
29 run;

WARNING: Library NH does not exist.
NOTE: Input library XP is sequential.
ERROR: Physical file does not exist, C:\SAS\TEMP\wb.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.

 

If anyone has any good ideas that would be great! Thanks!


 

THaney
Calcite | Level 5

Sure! Here are some screenshots.

SAS folder.PNGTEMP folder.PNG

Reeza
Super User
Is SAS running locally or on a server?
THaney
Calcite | Level 5

How would I go about checking this? I am very, very new to SAS. Ran into this issue trying to follow the first step of a tutorial.

THaney
Calcite | Level 5

Never mind, found it. Connected to a server.

Reeza
Super User
Which means that it's not seeing your desktop so the C drive of your desktop is not what it's accessing, it's accessing the server's C drive. So you need to move your files to the server OR see if you can run it locally.
THaney
Calcite | Level 5

Ah. I see. That makes sense. Thanks for the help, I'll work on seeing if I can get the files on the server or if I can run SAS locally.

Tom
Super User Tom
Super User

When you first make the libref for the XPORT file SAS doesn't know whether you are going to use it to read or write.  So this line works whether the files is there or not.

27 libname XP xport "C:\SAS\TEMP\wb.xpt";
NOTE: Libref XP was successfully assigned as follows:
Engine: XPORT
Physical Name: C:\SAS\TEMP\wb.xpt

If you tried to WRITE to that libref then SAS would create the file.

But when you tried READ from that file SAS complains because there isn't really a file with that name.

 

THaney
Calcite | Level 5

Hmmm I see. But there is a file with that name, or at least, I can see one with that name. It seems like SAS can't for some reason.

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

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 9 replies
  • 2498 views
  • 0 likes
  • 3 in conversation