Hello SAS community. I recently developed a process using Enterprise Guide (EG). We use a grid environment on Linux. I worked with another area in our shop to have the SAS programs scheduled and run in a workflow. One of the jobs keeps failing when running in the workflow. It runs fine when I run it using EG.
The error is:
ERROR: Insufficient authorization to access <linux_location>
I have tried to troubleshoot and asked around with no luck. I am hoping someone can point me in the right direction.
The job fails at the point where I open ODS Excel and attempt to write to an excel file. My speculation is the SAS job is attempting to write some output to a location that the job does not have access to. After asking around I got the impression that any output my job writes to the EG results viewer will cause this error. To that end I added a "ODS RESULTS OFF;" statement prior to opening the ODS destination. This does suppress the output from being displayed when running the code in EG, but still errors when running in the workflow.
Any thoughts or suggestions?
Adding this statement to the top of your program should fix it:
ODS listing off;
The scheduled job will be running under a user account that does not have permission to write to that folder. Check with the area who did the scheduling to get this fixed.
Thanks @SASKiwi . The prevailing thought is if the account doesn't have access then the SAS program shouldn't be writing to the location. To clarify, the location that is in the error message is not a location I am explicitly trying to write to in my program. The location of the ODS destination doesn't seem to be a problem. Despite the error the program does create the excel file, but with no data.
I ran into a very similar issue once when my code had a "PROC SQL" step to create a macro variable. I had to add a "NOPRINT" to the step for it to work. Without the "NOPRINT" the program seemed to want to write the value of the macro variable to the location for which the program does not have access. It seems to me that the ODS statement is attempting to write something behind the scenes, giving me the error. Just my guess. If so, then if could there be a way to suppress this output?
Where is the location? If you simply want to stop SAS writing to this location then you will need to post the SAS log of your job causing the problem so we can figure out what is going on and offer advice.
Here is a snippet from the program and corresponding log where the error happens:
proc sql;
create table something as
select a.stuff
from work.location as a
;quit;
/**===================================**/
/** Print reports to excel **/
/**===================================**/
%let run_date = %sysfunc(today(), yymmdd10.);
%put &run_date.;
options nonotes nosource;
filename out "/location/of/excel/file/excel.xlsx";
ods results off;
ods excel close;
ods excel file=out style=excel options( ....
NOTE: PROCEDURE SQL used (Total process time):
real time 0.06 seconds
user cpu time 0.06 seconds
system cpu time 0.04 seconds
memory 18609.67k
OS Memory 47840.00k
Timestamp 10/31/2019 10:43:21 AM
Step Count 61 Switch Count 0
Page Faults 0
Page Reclaims 4000
Page Swaps 0
Voluntary Context Switches 466
Involuntary Context Switches 38
Block Input Operations 0
Block Output Operations 384
2019-10-31
ERROR: Insufficient authorization to access
/location/not/referenced/in/program/work_flow_name.lst.
==> User code completed.
The error happens right after the put statement for &run_date. The excel file gets created, just no data in it. The program runs fine for me in Enterprise Guide.
Adding this statement to the top of your program should fix it:
ODS listing off;
Thanks @SASKiwi , this sees to have solved it. I used ODS listing close; instead of ODS listing off;.
@supp - Sorry yes CLOSE is the correct way - I didn't bother to check.
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.