BookmarkSubscribeRSS Feed
michael971
Calcite | Level 5

This code does not work.

nocenter nonumber;


libname lsbex '/tutorials/bookdata/learning_sas_by_example';

data lsbex.dailyprices;

run;

proc  print   data=lsbex.dailyprices;

run;

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:

  How does the program "not work"? Do you get an error message that says you do NOT have write access to LSBEX library? Something like this:

     

ERROR: User does not have appropriate authorization level for library LSBEX.

     

  This is because you CANNOT write to the folder with the book data. It is read only. And, your program does not have a SET statement, so if your program had worked, you would have created an empty dataset -- but luckily the folder location for this data is READ ONLY, so you can't accidentally write over the data. Your LIBNAME statement is good. If you try something a bit different, you should be successful. Here's some code to try. My log from running the code in SAS OnDemand for Professionals is shown in the attached screen shot.

  If you want to write to a permanent location, then read the SAS OnDemand documentation about setting up your user location. The second screen shot shows an example of making a copy of LSBEX.DAILYPRICES in the user folder. The tilde symbol (~) in the LIBNAME statement is a shortcut reference for the longer path name /home/your_username/user folder. I like using the reference ~/user because it is shorter.

         

Cynthia

      
libname lsbex  '/tutorials/bookdata/learning_sas_by_example';

  

** will get ERROR message with this;

data lsbex.new;

run;

  

** this will make a WORK copy of the DAILYPRICES data;

data work.dailyprices;

  set lsbex.dailyprices;

run;

  

** this will show all the datasets in the library;

proc contents data=lsbex._all_;

run;


sodp_cody_book_libname.pngsodp_write_user_folder.png

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 883 views
  • 0 likes
  • 2 in conversation