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

Hello,

 

I've just done:

 

Write a LIBNAME statement to create a library named NP that reads np_info.xlsx in the course data as follows:

  • SAS Studio: Specify the full path to your EPG194/data folder and the complete file name.

It says its been assigned successfully, but when I look at my NP library there are NO files showing - let alone the 3 in the answer?

 

Perhaps it's late and I've had a long day, or I'm completely stupid (probably the latter!)

 

Anyone else had this and if so could anyone help please?

 

Thanks,

 

Stu44 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

HI:
You need the FULL path in your LIBNAME statement in order to see what is in the workbook with PROC CONTENTS. If you don't see data, it might be because you specified the path incorrectly or because you specified the LIBNAME engine incorrectly.

 

For example, on my Windows machine with a local install of SAS, my FULL path to that file is
'c:\sas_class\EPG194\data\np_info.xlsx'

 

but, on SAS University Edition, the FULL path is
'/folders/myfolders/EPG194/data/np_info.xlsx'

 

and, in SAS OnDemand for Academics, the FULL path is
'/home/<myuserid>/EPG194/data/np_info.xlsx'

 

If you go back to the Activity in Lesson 2 and click "Show Answer" you'll

see that you are supposed to use PROC CONTENTS on NP.PARK and review the log to find out which column names
have been modified to follow SAS naming conventions when you use VALIDVARNAME=V7. So, in order for PROC CONTENTS to work, you need to use the XLSX engine with the LIBNAME statement to read the NP_INFO.XLSX workbook.

 

If I run the code on my University Edition machine, then I would submit THIS code:

libname np xlsx "/folders/myfolders/EPG194/data/np_info.xlsx";

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

 

The Activity does intend for you to use the XLSX engine in order to allow SAS to read the Excel sheet and run a PROC CONTENTS.

 

Hope this helps,

Cynthia

View solution in original post

11 REPLIES 11
PeterClemmensen
Tourmaline | Level 20

Haven't taken this course. Are there any actual SAS Data sets in the path that the library points to? A .xlsx will not show up .

Stu44
Fluorite | Level 6
Thanks, I've been putting in xlxs so will try using a SAS dataset and see if that does it.

Cheers,

Stu
Cynthia_sas
SAS Super FREQ

HI:
You need the FULL path in your LIBNAME statement in order to see what is in the workbook with PROC CONTENTS. If you don't see data, it might be because you specified the path incorrectly or because you specified the LIBNAME engine incorrectly.

 

For example, on my Windows machine with a local install of SAS, my FULL path to that file is
'c:\sas_class\EPG194\data\np_info.xlsx'

 

but, on SAS University Edition, the FULL path is
'/folders/myfolders/EPG194/data/np_info.xlsx'

 

and, in SAS OnDemand for Academics, the FULL path is
'/home/<myuserid>/EPG194/data/np_info.xlsx'

 

If you go back to the Activity in Lesson 2 and click "Show Answer" you'll

see that you are supposed to use PROC CONTENTS on NP.PARK and review the log to find out which column names
have been modified to follow SAS naming conventions when you use VALIDVARNAME=V7. So, in order for PROC CONTENTS to work, you need to use the XLSX engine with the LIBNAME statement to read the NP_INFO.XLSX workbook.

 

If I run the code on my University Edition machine, then I would submit THIS code:

libname np xlsx "/folders/myfolders/EPG194/data/np_info.xlsx";

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

 

The Activity does intend for you to use the XLSX engine in order to allow SAS to read the Excel sheet and run a PROC CONTENTS.

 

Hope this helps,

Cynthia

Stu44
Fluorite | Level 6

Cynthia,

 

You are a legend!

 

It worked, thank you for providing such a comprehensive answer to my question.

 

All the best and thanks again,

 

Stu

 

 

lmills3
Calcite | Level 5

Cynthia

I tried what you have listed and at first attempt I was accessing the NP in libraries and nothing was in it, such as the original post.

 

Then I tried your "university edition" option, no success. It told me that NP doesn't exist.

 

Laurel

Cynthia_sas
SAS Super FREQ

Hi:

  The first thing to determine is how you are using SAS:

1) SAS University Edition in a Virtual Machine

2) SAS OnDemand for Academics on our server

3) SAS on Windows as a local install

4) SAS Enterprise Guide with local SAS or server SAS

5) SAS Studio with local SAS or server SAS

 

  Then the next thing to determine is whether you followed the instructions for how to make the data for class. We have explicit instructions for how to make the Programming 1 data files. You can see ALL the methods here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-access-data-for-SAS-Programming-1-cour... and the bottom line is that you cannot go forward to Lesson 2 until you are absolutely sure that you have successfully created the data following the instructions for YOUR method of using SAS.

 

  Finally, you're in Lesson 2. What happened in Lesson 1? Did any of the programs or exercises in Lesson 1 work for you?

 

  How do you log onto SAS -- from the Start Menu? Do you Start Enterprise Guide? Do you open VMWare or Virtual Box? Do you log onto the SAS Control Center for SAS OnDemand? How you answer will determine the answer to question #1. From there, you can figure out whether you have successfully made the data and then once you have successfully made the data, we should be able to help you figure out how to get over the problem you're having.

 

  One recommendation is to go back to the beginning and just repeat the data creation setup steps -- all the steps for your method of using SAS. That would refresh all the data files used in the class.

 

Cynthia

lmills3
Calcite | Level 5

Cynthia

I went into my createdatapg1_oda.sas

and it states at the very top that this will not run on z/OS.

 

The video you sent for the SAS Studio does not match my screen. I login to the On demand to get to the studio.

I am frustrated and confused as to how I went wrong.

I did setup the Virtual box.

 

My path: I login to Canvas through my university, then I click on the link to open the SAS training, then I login to the studio via the ondemand academics. I followed the path and setup as directed. I finished lesson 1 without any issues. Now I am not able to complete the activity in lesson 2: accessing data through libraries.

 

Laurel

Cynthia_sas
SAS Super FREQ

Hi:

  If you are using Virtual Box, then you are using SAS University Edition NOT SAS OnDemand for Academics. The SAS OnDemand for Academics set up program will NOT work with SAS University Edition and Virtual Box.

 

Cynthia

Cynthia_sas
SAS Super FREQ
Hi:
Initially, there are NOT any SAS datasets in the EPG194/data folder. Students have to run programs to MAKE all the SAS datasets. When they first open the folder, it just contains CSV, XLSX and other "raw" data files. AFTER they run the program, as instructed, THEN there are SAS datasets in the path. But for this activity, the goal is to use PROC CONTENTS on an XLSX file.
Cynthia
Reeza
Super User

Can you please verify you rant he start up program correctly and ran the code to generate all the data sets needed for the course?

It's part of the 'Required' section in the initial set up instructions.

 


@Stu44 wrote:

Hello,

 

I've just done:

 

Write a LIBNAME statement to create a library named NP that reads np_info.xlsx in the course data as follows:

  • SAS Studio: Specify the full path to your EPG194/data folder and the complete file name.

It says its been assigned successfully, but when I look at my NP library there are NO files showing - let alone the 3 in the answer?

 

Perhaps it's late and I've had a long day, or I'm completely stupid (probably the latter!)

 

Anyone else had this and if so could anyone help please?

 

Thanks,

 

Stu44 


 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 11 replies
  • 6945 views
  • 6 likes
  • 6 in conversation