BookmarkSubscribeRSS Feed
SASSLICK001
Obsidian | Level 7

Hi all 

I'm getting an error sas cannot write a png file to the disk and it says I don't have acces . I am running this on enterprise and on unix server. I know how to solve this problem based on 

http://support.sas.com/kb/49/421.html

ods _all_ close;
ods html path='c:\temp' (url=none) file='sastest.html';

/* Your SAS procedure code goes here */

ods _all_ close;
ods listing;

 

im running this in macro code. I had to run through this macro multiple times as they are different sets of population. Whenever I run through batch mode the first iteration does not throw out any error but successive iterations will gives above error. But when I run one by one individually I don't see any error 

can some one please help,me

10 REPLIES 10
Reeza
Super User

If you're on a Unix server it's unlikely your server has a C:\temp location and its not likely to have access to your C drive at all. 

Talk to your SAS administrators or colleagues regarding what locations you do have access to and where you can save files and then download them to your system. 

SASKiwi
PROC Star

Posting your actual log with the error, rather than the code fix from the SAS note would be helpful.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Unix does not have paths such as "c:\temp", this is a Windows style pathing system.  Use a path valid per Unix, and one that you actually have access rights to.

SASSLICK001
Obsidian | Level 7

Sorry I was not clear in my message:

 

I used the following not the one i said earlier ,

 

ods listing close;
ods html path="%sysfunc(pathname(work))" ;

 

proceedure..

 

ods html close;

ods listing;

 

the actual error

 

error.PNG

Rick_SAS
SAS Super FREQ

Please run the following and post the log:

 

%let path="%sysfunc(pathname(work))" ;
%put &=path;

 

Also, are you running from EG? SAS Studio? Are you using a remote SAS server?

SASSLICK001
Obsidian | Level 7

Please see the path from log

 

"/sas/work004/SAS_work1F8400001C76_uctvp021/SAS_workF34A00001C76_uctvp021"

 

I am running this on SAS EG and connecting to SAS 9.4 unix server

ballardw
Super User

@SASSLICK001 wrote:

Please see the path from log

 

"/sas/work004/SAS_work1F8400001C76_uctvp021/SAS_workF34A00001C76_uctvp021"

 

I am running this on SAS EG and connecting to SAS 9.4 unix server


The / indicates that path is likely on the server and your session likely does not have write permissions there.

SASSLICK001
Obsidian | Level 7
When I run one macro then it doesnot show this error, but when i run the multiple macros in batch then except first one, rest of the macro iteration start giving this error
ballardw
Super User

@SASSLICK001 wrote:
When I run one macro then it doesnot show this error, but when i run the multiple macros in batch then except first one, rest of the macro iteration start giving this error

I might suggest then that at the start of the batch that you get one macro variable for the path:

 

%let mypath=%sysfunc(pathname(work)) ;

 

And then use

ODS Html path="&mypath";

 

There could be something in repeated calls to the function that is changing the actual path value between macros. But multiple macros also implies multiple other places for things to break. You might also try running the batch job with Options MPRINT SYMBOLGEN MLOGIC; and then wade through a lot of log. The log is more likelyt to show which specific lines are causing problems. You may want the MPRINTNEST option if you have macros calling macros and SOURCE2 if using %Include files.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Ah, you might want to read this article:

http://stackoverflow.com/questions/21208680/turn-off-automatic-graph-saving-in-sas-9-4

 

And then before your code put:

ods listing gpath="%sysfunc(getoption(work))";

 

It seems that HTML needs to save the png somewhere and that is set to something, but either doesn't exist or you don't have access to it.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 10 replies
  • 1528 views
  • 0 likes
  • 6 in conversation