SAS 9.4 ERROR: Cannot write image to SurvivalPlot3.png. Please ensure that proper disk permissions are set

Reply
Frequent Contributor
Posts: 82

SAS 9.4 ERROR: Cannot write image to SurvivalPlot3.png. Please ensure that proper disk permissions are set


Hi Everyone,

I run a proc lifetest using SAS 9.4. Then it appears error note:

ERROR: Cannot write image to SurvivalPlot3.png. Please ensure that proper disk permissions are set.

I tried the way previous posted same kind of problem (probably using SAS 9.2 or 9.3), it did not work.

Thanks for your help,

Xinjian

Super User
Posts: 3,250

Re: SAS 9.4 ERROR: Cannot write image to SurvivalPlot3.png. Please ensure that proper disk permissions are set

Where is SAS trying to write the PNG file? You obviously don't have write permission to that disk folder.

Please post your code so we can advise further.

Frequent Contributor
Posts: 82

Re: SAS 9.4 ERROR: Cannot write image to SurvivalPlot3.png. Please ensure that proper disk permissions are set

Here is my code:

proc lifetest data=primary2 plot=(s)censoredsymbol=none ;

Time time*status(0);

strata flowstatus;

run;

It only happened in SAS 9.4 version 14w25. It is ok when I run same code in old version SAS 9.4.

Thanks,

Super User
Posts: 3,250

Re: SAS 9.4 ERROR: Cannot write image to SurvivalPlot3.png. Please ensure that proper disk permissions are set

Is that all? You don't use any ODS statements to direct your PNG output?

Try adding: ods graphics off; at the top of your code.

Frequent Contributor
Posts: 82

Re: SAS 9.4 ERROR: Cannot write image to SurvivalPlot3.png. Please ensure that proper disk permissions are set

Hi SASkiwi,

It works very well. Can you let me know why add 'ods graphics off;'?

Many Thanks,

Super User
Posts: 19,767

Re: SAS 9.4 ERROR: Cannot write image to SurvivalPlot3.png. Please ensure that proper disk permissions are set

Because it's no longer trying to create a graph.

You can try and change your destination path (gpath) and see if it works.

SAS/STAT(R) 9.2 User's Guide, Second Edition

Frequent Contributor
Posts: 82

Re: SAS 9.4 ERROR: Cannot write image to SurvivalPlot3.png. Please ensure that proper disk permissions are set

Hi Reeza,

You tried the way showed in 'SAS/STAT(R) 9.2 User's Guide, Second Edition'

It did not work.

Thanks,

Xinjian

Super User
Posts: 3,250

Re: SAS 9.4 ERROR: Cannot write image to SurvivalPlot3.png. Please ensure that proper disk permissions are set

This is what you need to change to move your PNG files to a writable location:

ods listing gpath="C:\figures";  <=== put your writable location here.

Is this what you tried? As a helpful suggestion, if you say something doesn't work but don't provide the code and error message, then we have to end up guessing what you did......! So that is why it is very helpful to post what you did.

Yes, you can use the ODS graphics editor on LIFETEST, as long as the procedure is producing graphics (ODS graphics on) and you have the ODS graphics editor installed (you should see this listed in the Windows Start button All Programs).

Frequent Contributor
Posts: 82

Re: SAS 9.4 ERROR: Cannot write image to SurvivalPlot3.png. Please ensure that proper disk permissions are set

Hi SASKiwi,

My SAS 9.4 had 'ods graphic editor' option. I opened SAS with 'run as administrator'.

Below is my code. It produce 3 survival graphs: html, PNG, and the third one for 'ods graphics editor'.

When I click the 3rd graph, showed error window: this application does not support your platform'.

241  ods listing gpath="C:\figures";

242  ods listing sge=on style=Listing;

243  ods graphics on;

244  proc lifetest data=primary2 plot=(s)censoredsymbol=none ;

245  time time*status(0);

246  strata flowstatus;

247  run;

Thanks,

Super User
Posts: 19,767

Re: SAS 9.4 ERROR: Cannot write image to SurvivalPlot3.png. Please ensure that proper disk permissions are set

The editor is a separate install. If this is a new install, which it sounds like, it may not have been installed. I believe you should be able to see it in your application list, similar to SAS.

Frequent Contributor
Posts: 82

Re: SAS 9.4 ERROR: Cannot write image to SurvivalPlot3.png. Please ensure that proper disk permissions are set

I have used editor for proc sgplot before. It worked ok.

Frequent Contributor
Posts: 82

Re: SAS 9.4 ERROR: Cannot write image to SurvivalPlot3.png. Please ensure that proper disk permissions are set

Hi SASKiwi,

Is it possible to use 'ods graphic editor' on proc lofetest?

Thanks,

Ask a Question
Discussion stats
  • 11 replies
  • 1916 views
  • 0 likes
  • 3 in conversation