Data visualization with SAS programming

Sas 9.4 graphs

Reply
Contributor
Posts: 50

Sas 9.4 graphs

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

Grand Advisor
Posts: 17,325

Re: Sas 9.4 graphs

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. 

Respected Advisor
Posts: 3,061

Re: Sas 9.4 graphs

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

Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: Sas 9.4 graphs

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.

Contributor
Posts: 50

Re: Sas 9.4 graphs

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

SAS Super FREQ
Posts: 3,406

Re: Sas 9.4 graphs

[ Edited ]

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?

Contributor
Posts: 50

Re: Sas 9.4 graphs

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

Grand Advisor
Posts: 10,210

Re: Sas 9.4 graphs


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.

Contributor
Posts: 50

Re: Sas 9.4 graphs

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
Grand Advisor
Posts: 10,210

Re: Sas 9.4 graphs


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.

Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: Sas 9.4 graphs

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.

Ask a Question
Discussion stats
  • 10 replies
  • 218 views
  • 0 likes
  • 6 in conversation