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

Hi,

What does the red dot mean next to the files? After trying so much and spending a whole day on this, I am still getting this error PG1.np_summary.DATA does not exist. Can anyone tell me what I am doing wrong?

 

sann123_1-1648825724119.png

sann123_0-1648828823773.png

 

 

sann123_0-1648825605049.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  Thanks for posting that. You are missing some SAS files in your data subfolder. Here are the files that seem to be missing:

Cynthia_sas_0-1649103142395.png

  You're not ready to do any work in Lesson 1 or Lesson 2 until AFTER you can see these files in Windows File Explorer. How do you make these files? You have to follow the instructions to do the data setup. For people who are using their own company or school license for SAS, we provide a zip archive with some files (like the CSV, the XLSX, the JSON and other files). That zip archive also contains a data creation program that you have to run. We have 3 sets of instructions in the Course Overview and Data Setup section of the course for how to work with your own local SAS install. Are you using EG? Are you using SAS Studio? Or are you using Windows Display Manager? The instructions you follow will make a difference. This is the section I'm referring to in Programming 1 -- you need to follow the instructions highlighted in green -- pick the method you're using:

Cynthia_sas_1-1649103547407.png

 

  For example, here's a video that shows how to make the Programming 1 data when you're using Display Manager on Windows:  https://youtu.be/_K4Nd9QNyfg ; and by comparison, here's a video that shows how to make the Programming 1 data when you're using SAS Studio on your C drive: https://youtu.be/GpNAQDvbocc

 

  You will need to follow one of these or the other in order to run the program that makes all the SAS data for Programming 1.

  This troubleshooting might be better handled if you sent email to elearn@sas.com . That way one of the instructors could work with you directly to figure out why you don't have the data. The zip file we give to students does not contain everything you need. You have to do more than unzip the zip file into a folder on your C drive. You MUST run a program to make the rest of the class data.

  I haven't included the Enterprise Guide videos here because it doesn't seem like you're using Enterprise Guide. It would be better to resolve the data creation problem first before tackling the LIBNAME statement issues. Without any SAS datasets in your data folder, none of your PG1 files will be found and you'll always receive errors.

Cynthia

View solution in original post

9 REPLIES 9
AMSAS
SAS Super FREQ

np_info.xlsx is an Excel file
A libname statement creates a reference to a directory on the OS to access SAS Data Files

A quick search and Using the Import Data Utility in SAS Studio


Of course this assumes you are using SAS Studio, there are other methods

Personally I'd export the Excel file as CSV and then read it in that way, as reading raw data is what I know best, hence the quickest solution for me.

Cynthia_sas
SAS Super FREQ

Hi:
NP_INFO.XLSX needs to be read using the XLSX LIBNAME engine. My suggestion is that you go back to the class lectures and revisit the lecture on reading XLSX data. If you are using your own system (which is implied by the C: drive location) then you must be running SAS 9.4 M2 or higher and have SAS/Access for PC Files installed in order to be able to use the XLSX LIBNAME engine.
When working in Programming 2, you will need to always have 1 LIBNAME statement to point to the PG1 library, which will contain all the SAS data sets. Then when reading XLSX files, you will need a second LIBNAME statement to read the XLSX file, such as NP_INFO.XLSX. For example, if I have the class data on my C: drive in a SAS_class folder with an EPG1V2 subfolder, then my PG1 LIBNAME statement would be:
libname PG1 'C:\SAS_Class\EPG1V2\data';
proc contents data=pg1._all_ nods;
run;

But if I needed to import an XLSX file, I might have this:

options validvarname=v7;
libname npx xlsx 'C:\SAS_Class\EPG1V2\data\np_info.xlsx';
proc contents data=npx._all_ nods;
run;

libname npx clear;

Then the first proc contents would show you the SAS datasets in your data folder. The second PROC CONTENTS would show you all the sheets in the NP_INFO.XLSX workbook. As explained in the class videos, the XLSX workbook is treated like a SAS library and each sheet is considered the equivalent of a table or dataset in the library. You can't define 1 library named PG1 to refer to both your SAS data and your Excel workbooks. You'll need different LIBNAME statements for each type of file.

The practices in the course have a Show Solution button, that will usually show you some sample code for solving an activity or practice. The demo videos will show you working examples that are run on the instructor's machine. Usually, in these videos, the instructor's location will be on an S: drive or mapped drive. The only difference between the recorded demos and what you need to do with be to change the path so it matches your storage location for the class folders.
Cynthia

sann123
Fluorite | Level 6

Hi Cynthia,

 

I followed your instructions, but I am still not getting the output. Please see the following errors. What am I doing wrong?

 

sann123_1-1648851664968.png

sann123_2-1648851698793.png

sann123_5-1648851763772.png

 

sann123_3-1648851717561.png

 

 

 

 

Cynthia_sas
SAS Super FREQ

Hi:
  Since you did not show your full log or show how/when you got the popup window, I'm not sure what's happening.

 

  You're getting an error message on PG1.NP_SUMMARY, which should have been created when you ran the data creation program. If you open the class folder for data using Windows File Explorer, do you see np_summary.sas7bdat  data set in the EPG1V2/data subfolder???? If there's no np_summary.sas7bdat data file in the data subfolder, that implies that something went wrong with the data creation program or that perhaps you skipped over running that step.


  It looks like you're running programs using a local copy of SAS. Did you follow the correct set of instructions inside the Programming 1 class? We have specific instructions for using your own SAS on Windows or EG on Windows instead of using SAS OnDemand for Academics.


  At this point, I would recommend that you send mail to elearn@sas.com  that shows a screen shot of your Windows EPG1V2/data folder for the class, so we can see what files you have in the folder. Then, let us know exactly how you're practicing, EG, SAS on Windows with Display Manager or SAS Studio with either local SAS or server SAS. Also useful would be a screen shot of your full log file, that shows ALL the code and ALL the messages.

  It almost looks to me like you've forgotten to put the LIBNAME npx CLEAR, as I showed in my code. The reason for using PROC CONTENTS is to see the names of the sheets in the Excel Workbook. Then you need to actually turn around and import a sheet from that workbook before you try to view it. The LIBNAME engine using XLSX as the engine holds the workbook open for exclusive access. So depending on what you tried to do while the LIBNAME was holding the workbook open might have resulted in the error window you showed. The SAS Viewer will not open the Excel sheet directly. You need to import it first, either into the WORK location of the PG1 location.


Cynthia

sann123
Fluorite | Level 6

Hi,

 

I do not see np_summary.sas7bdat  data set in the EPG1V2/data subfolder. How could I have skipped over running that step. I have attached the code I wrote in the previous picture that I had attached. 

I did enter this LIBNAME npx CLEAR but having this or not did not make much difference. 

I have included Proc import as well libname npx clear now. It is opening excel in the viewtable but I am still shown Error in the log.

sann123_1-1649047009729.pngsann123_2-1649047029669.pngsann123_3-1649047046456.pngsann123_4-1649047174136.png

 

 

 

sann123_0-1649046333022.png

 

Cynthia_sas
SAS Super FREQ

Hi:

  Thanks for posting that. You are missing some SAS files in your data subfolder. Here are the files that seem to be missing:

Cynthia_sas_0-1649103142395.png

  You're not ready to do any work in Lesson 1 or Lesson 2 until AFTER you can see these files in Windows File Explorer. How do you make these files? You have to follow the instructions to do the data setup. For people who are using their own company or school license for SAS, we provide a zip archive with some files (like the CSV, the XLSX, the JSON and other files). That zip archive also contains a data creation program that you have to run. We have 3 sets of instructions in the Course Overview and Data Setup section of the course for how to work with your own local SAS install. Are you using EG? Are you using SAS Studio? Or are you using Windows Display Manager? The instructions you follow will make a difference. This is the section I'm referring to in Programming 1 -- you need to follow the instructions highlighted in green -- pick the method you're using:

Cynthia_sas_1-1649103547407.png

 

  For example, here's a video that shows how to make the Programming 1 data when you're using Display Manager on Windows:  https://youtu.be/_K4Nd9QNyfg ; and by comparison, here's a video that shows how to make the Programming 1 data when you're using SAS Studio on your C drive: https://youtu.be/GpNAQDvbocc

 

  You will need to follow one of these or the other in order to run the program that makes all the SAS data for Programming 1.

  This troubleshooting might be better handled if you sent email to elearn@sas.com . That way one of the instructors could work with you directly to figure out why you don't have the data. The zip file we give to students does not contain everything you need. You have to do more than unzip the zip file into a folder on your C drive. You MUST run a program to make the rest of the class data.

  I haven't included the Enterprise Guide videos here because it doesn't seem like you're using Enterprise Guide. It would be better to resolve the data creation problem first before tackling the LIBNAME statement issues. Without any SAS datasets in your data folder, none of your PG1 files will be found and you'll always receive errors.

Cynthia

sann123
Fluorite | Level 6
Thank you so much. It works now.

There is just one tiny problem. Anytime I add something new, like I want to run proc univariate or proc freq, it doesnt update it under Results. I have to exit Sas then reopen my file and run to see the difference. Why does this happen?
Cynthia_sas
SAS Super FREQ

Hi:
  That's very odd behavior. But it's still not clear to me whether you're using SAS Studio on Windows or whether you're using SAS Display Manager or SAS EG on Windows. Results will be updated differently in each interface. Results in SAS Studio and EG should always be replaced when you run the same code a second (or third or fourth ) time. But, the Results window in SAS Display Manager is more of a cumulative window and unless you clear or delete the Results Window, you should be able to scroll to the bottom of the Results window and see the output. Or, for many of our programs, there are some programs like DATA step programs that don't create visible output, so there would not be anything in the results.


  But with PROC UNIVARIATE, assuming you do NOT have error or warning messages in the log, you should see results at the bottom of the Results window in Display Manager. If you job runs successfully (meaning no errors in the log that stopped the results) and you still don't see updated results, that is something to check with Tech Support because there might be something different about how SAS has been installed on your machine.
I'd recommend starting simple with something like this that doesn't need a LIBNAME statement:
proc print data=sashelp.class;
title '1) PROC PRINT';
run;

then after that runs, look in the Results Window. You should have 1 link for that step in the Results window. Now go back to the Editor window and at the bottom of the PROC PRINT code, add this:
proc univariate data=sashelp.class;
title '2) PROC UNIVARIATE';
var height;
run;
title;

 

  Now if you did not clear the results window after the first submission, you should now see more links in the Results window. The first link will only have the PROC PRINT step and the second link will have the PROC PRINT and the PROC UNIVARIATE, like this screen shot:

Cynthia_sas_0-1649271689270.png

 

If your experience is the same as what I illustrated above, then the Results window is working as designed. Without more information from you and a look at your SAS log, it's not really possible to make more concrete suggestions.

  Are there other people at your company that use SAS? Perhaps someone could watch what you're doing and help you figure out what might be happening with your results.
Cynthia

sann123
Fluorite | Level 6
Thank you so much. I am running the software from company on windows. Seems to be working fine at times. Hoping it continues to function. Thanks

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

LIBNAME 101

Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 2793 views
  • 2 likes
  • 3 in conversation