BookmarkSubscribeRSS Feed
theponcer
Quartz | Level 8

I am encountering a confusing issue. After creating a folder manually, I then tried to export the results of a SAS program to it. Strangely, this worked for all but one table. That table gave me this error: 

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

Thinking that the table itself was the problem, I altered the code and tried again. The same thing happened - everything exported except for one table.

I would expect that if I did not have authorization that I would not be able to access the filepath via windows explorer, create it in the first place, or export other SAS tables here. I noticed that a lot of people have run into this error before, but it looks like they weren't able to write anything out. Does anyone know what the issue is?  

Here is the code for the current table that is not exporting:

 

data adher_c.numerator adher_c.denominator;

if 0 then set roll_weights;

if _n_=1 then do;

dcl hash weights(dataset:"roll_weights");
weights.definekey("ID");
weights.definedata("weight");
weights.definedone();

end;

call missing(weight);

set counts;

rc_weights = weights.find();

if count gt 0 then output adher_c.numerator;
output adher_c.denominator;

run;

Strangely, when I ran the code outside of the normal macro process, it did work and did not throw this error. Now I'm even more confused! I am reaching out to IT internally, but wanted to see if anyone has already encountered this issue. Could there be a lag between when Windows recognizes a new file path and when SAS does? 

2 REPLIES 2
ballardw
Super User

@theponcer wrote:

Strangely, when I ran the code outside of the normal macro process, it did work and did not throw this error. Now I'm even more confused! I am reaching out to IT internally, but wanted to see if anyone has already encountered this issue. Could there be a lag between when Windows recognizes a new file path and when SAS does? 


What does "outside of the normal macro process" mean?

 

If that is supposed to mean the program is part of macro coding then the code you show is likely not what is going on as there are no macro references. I would suggest setting Options Mprint before running the "normal" process and see if the log shows anything going on, possibly before the shown data step.

s_lassen
Meteorite | Level 14

Sounds like the problem is with the macro code somewhere, for instance if you have code like

%let dsid=%sysfunc(open(adher_c.numerator));

and the code to close the data set handle (dsid) is somewhere below your code to recreate that table. Then the dataset handle will stop you from recreating the data set.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 419 views
  • 0 likes
  • 3 in conversation