BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Alexo2025
Fluorite | Level 6

LIBNAME NP XLSX "S:/EPG1V2/data/np_info.xlsx";
run;

options validvarname=v7;
proc contents data=np.parks;
run;
libname np clear;

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

If it says DATA does not exist, then the data set you are looking for does not exist. Perhaps you have spelled the name wrong, or you have the wrong LIBNAME statement.


From now on, when you have an error in the log, please show us the ENTIRE log for that PROC or for that DATA step. We need to see the ENTIRE log, not selected parts, not the parts you want to show us, all of it, every single line, for that PROC or DATA step.

--
Paige Miller

View solution in original post

7 REPLIES 7
PaigeMiller
Diamond | Level 26

If it says DATA does not exist, then the data set you are looking for does not exist. Perhaps you have spelled the name wrong, or you have the wrong LIBNAME statement.


From now on, when you have an error in the log, please show us the ENTIRE log for that PROC or for that DATA step. We need to see the ENTIRE log, not selected parts, not the parts you want to show us, all of it, every single line, for that PROC or DATA step.

--
Paige Miller
Alexo2025
Fluorite | Level 6
Thank you for your immediate response.
Okay. I will show the LOG.

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 LIBNAME NP XLSX "S:/EPG1V2/data/np_info.xlsx";
NOTE: Libref NP was successfully assigned as follows:
Engine: XLSX
Physical Name: S:/EPG1V2/data/np_info.xlsx
74 run;
75
76 options validvarname=v7;
77 proc contents data=np.parks;
ERROR: File NP.parks.DATA does not exist.
78 run;
Tom
Super User Tom
Super User

Just because the LIBNAME statement works it does not mean that the XLSX file exists.  SAS does not know when you run the LIBNAME statement if your intent was to read from an existing workbook or make a new one.

 

And even if the XLSX file does exists that does not mean that there is necessarily a sheet in it named PARKS.

john_mccall
SAS Employee

Hi.  Do you have the correct path?   For example, you are referencing the S drive.

I tried running your program and it worked okay referencing the file on my local drive.    If your path is correct, can you share the full SAS log?

Thanks.

john_mccall
SAS Employee

Your Libname statement looks fine per the SAS log notes.  I suggest opening the workbook and verifying the name Parks hasn't been inadvertently over written.   

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 575 views
  • 1 like
  • 4 in conversation