Desktop productivity for business analysts and programmers

User does not have appropiate authorization level for libary WC000001

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

User does not have appropiate authorization level for libary WC000001

Hi, 

I'm new at SAS so I hope my description is accurrate. I'm using SAS Enterprise Guide 9.4. 

I'm working with databases available in a remote server, and I am trying to calculate an average on two variables. 

Here is my code: 

 

proc sql; 

create table "AVG1" as 

SELECT *, AVG(RMEANIMT+LMEANIMT) AS AVG1

FROM WORK.QUERY_FOR_APPEND_TABLE; 

QUIT; 

 

 

Here is the log: 

proc sql

CREATE TABLE "AVG 1" AS 

SELECT *, AVG(RMEANIMT+LMEANIMT) AS AVG1

FROM WORK.QUERY_FOR_APPEND_TABLE; 

 

NOTE: The query requieres remerging summary statistics back with the original data

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

 

However I don't have any library with that name. My guess is that it comes from the WORK library but I'm not sure how to reference it. 

Thank you!.

 


Accepted Solutions
Solution
‎03-07-2018 03:16 PM
Super User
Posts: 23,232

Re: User does not have appropiate authorization level for libary WC000001

You probably need to talk to your IT area or SAS administrator. Your code doesn't have any errors so that's fine, its some other issue.

 

You can verify if the code below will also give you an error:

proc sql; 
create table average1 as 
SELECT *, AVG(RMEANIMT+LMEANIMT) AS AVG1
FROM WORK.QUERY_FOR_APPEND_TABLE; 
QUIT; 
 

View solution in original post


All Replies
Solution
‎03-07-2018 03:16 PM
Super User
Posts: 23,232

Re: User does not have appropiate authorization level for libary WC000001

You probably need to talk to your IT area or SAS administrator. Your code doesn't have any errors so that's fine, its some other issue.

 

You can verify if the code below will also give you an error:

proc sql; 
create table average1 as 
SELECT *, AVG(RMEANIMT+LMEANIMT) AS AVG1
FROM WORK.QUERY_FOR_APPEND_TABLE; 
QUIT; 
 
New Contributor
Posts: 3

Re: User does not have appropiate authorization level for libary WC000001

Apparently that was the whole problem, I changed the code and it ran
perfectly. Thank you very much.
Community Manager
Posts: 3,378

Re: User does not have appropiate authorization level for libary WC000001

[ Edited ]

Update: Now I see, as @Astounding pointed out, the quoted table name was the cause.  This told SAS to consider the table as a file name, not a member of a SAS library, and that's where the WCnnnnn libref came from.  

The "WC000001" tells me that a preceding step used a SAS data set directly from the file system, rather than via a library that you explicitly defined.   This technique causes SAS to assign a temporary libname behind the scenes, and the name looks like "WCnnnnnn". Instead of opening/adding a sas7bdat file directly in EG, you should first use a LIBNAME statement to define a library that maps to the folder.  That step can be in code or using the Assign Library wizard in EG.

 

Then, when you run the next step in the flow, the library definition will already be in place.

Super User
Posts: 6,626

Re: User does not have appropiate authorization level for libary WC000001

Why the weird data set name?  Get rid of the quotes, get rid of the space between AVG and 1, and just:

 

create table AVG1 as ...........

Super User
Posts: 23,232

Re: User does not have appropiate authorization level for libary WC000001

If you really want table names like that you can add an N to the end, this is known as a name literal.

 

proc sql; 
create table "AVG1"n as 
SELECT *, AVG(weight) AS AVG1
FROM sashelp.class; 
QUIT; 

I don't recommend doing that though, because then you have to type more (3 extra characters) per data set name and it makes it harder to use short cut references to data sets.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 224 views
  • 1 like
  • 4 in conversation