Tuesday, September 26, 2017

SAS: ERROR: Insufficient authorization to access C:\Windows\system32\sasgraph.jpg



Edit 2017-12-05.

Was all that (below) really necessary?
I think I might have just been missing

ODS GRAPHICS ON;
GOPTIONS RESET=ALL border hsize=14in vsize=8in;



_____________________________________________________________________________




Re: ERROR: Insufficient authorization to access C:\Windows\system32\sasgraph.jpg




Hello Bill,

This is in regard to SAS tracking number 7612237223, where in your last email to this track, you wrote:

>At this point I really don’t care how or where the graph is created: I just want the code (which I inherited) to run. If you look at the source, it’s clear that the code is generated from an EG wizard. And yet it has this error. I see this error throughout this particular EG project. Have Googled it. This helped in SOME cases, but not this one.

If you are submitting actual code to SAS via Enterprise Guide, modify the following statements in the code:

ODS _ALL_ CLOSE;
GOPTIONS RESET=ALL;
OPTIONS DEV=PNG;
GOPTIONS XPIXELS=0 YPIXELS=0;
GOPTIONS ACCESSIBLE;
ODS OUTPUT;
ODS GRAPHICS ON;
ODS LISTING GPATH="%sysfunc(getoption(WORK))";

So that they now look like this:

ODS _ALL_ CLOSE;
ODS LISTING;

FILENAME GRAFOUT  "%sysfunc(pathname(work))/sasreport.png";

GOPTIONS RESET=ALL DEVICE=PNG GSFNAME=GRAFOUT;


As you can see, Enterprise Guide adds a lot of extra statements to the code that are not actually needed.  The statements above will allow the code to run fine and will write the PNG graph file to the temporary SAS WORK location.  Instead, if you prefer to right the graph to a permanent directory on your hard drive, replace  %sysfunc(pathname(work))  above with an actual existing directory on your hard drive, such as:

FILENAME GRAFOUT  "C:/Temp/sasreport.png";

Regards,


SAS Technical Support
http://www.sas.com
http://support.sas.com

SAS ... THE POWER TO KNOW







No comments:

Post a Comment