Desktop productivity for business analysts and programmers

Assigning libname for SASondemand for profeesionals

Reply
Occasional Contributor
Posts: 7

Assigning libname for SASondemand for profeesionals

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;

SAS Super FREQ
Posts: 8,716

Re: Assigning libname for SASondemand for profeesionals

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;

Attachment
Attachment
Ask a Question
Discussion stats
  • 1 reply
  • 200 views
  • 0 likes
  • 2 in conversation