DATA Step, Macro, Functions and more

Error running LIBNAME statement

Reply
Occasional Contributor
Posts: 8

Error running LIBNAME statement

When I am creating my own file under Window 7 with extension .sas, stating there :

libname learn '/tutorials/bookdata/learning_sas_by_example';

and load it into PrepGuide into Program space  I am getting error message below.

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


At the same time when I am loading into  PrepGuide a UNIX file like

Learning_sas_by_example, chapter04examples.sas which contains the same statement "libname learn..."

I am not getting errors.

Vladimir Kievsky
vkievsky@hotmail.com

SAS Super FREQ
Posts: 8,868

Re: Error running LIBNAME statement

Hi:

  I suspect that you tried to WRITE to the LEARN library. So the problem isn't your LIBNAME statement. The problem is how you are USING the LIBNAME. See  example #2 in the screen shot. As long as you READ from the LEARN location (example #1, #3), you will be OK. But you do not have WRITE access to any of the data locations on the server. So if there is an example in the book that shows something like:

   

DATA LEARN.NEW;

** some code;

RUN;

   

Then you will have to change it to your user library or to the WORK library to test file creation:

  

DATA WORK.NEW;

** some code;

RUN;

  

  Here is some example code that I used for the attached screen shot. I can replicate your ERROR message just by trying to write to the LEARN library -- which fails because NOBODY has WRITE access to the OnDemand server except to your user folder. You will have to write to your user folder/directory (see Example #4). The tutorial on this web page explains how to use the OnDemand server with Book data.

(SAS OnDemand for Professionals Customer Support tab -- see videos)

  

Cynthia

 

libname learn '/tutorials/bookdata/learning_sas_by_example';

**1) reading FROM the LEARN library;

data test;

  set learn.bicycles;

run;

** 2) trying to write to the LEARN library;

** will generate an error;

data learn.new;

  set sashelp.class;

run;

** 3) again, reading FROM the LEARN library;

proc contents data=learn._all_;

run;

   
**4) write to user directory, called MYPLACE;
libname myplace '~/user';

data myplace.new;
  set learn.bicycles;
run;


cannot_write_to_server_tutorials_loc.pngcan_write_to_user_folder.png
Ask a Question
Discussion stats
  • 1 reply
  • 485 views
  • 0 likes
  • 2 in conversation