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!
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!
Sure! Here are some screenshots.
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.
Never mind, found it. Connected to a server.
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.
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.
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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.