BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
sathya66
Barite | Level 11

Hi All,

Recently we have upgraded our env to M8. Below code works fine in old env but in M8, it is not sending the graph via email properly. It is sending just info but not in the form of graph. do we need to update any option in below code. Could you please advise.

 

ods graphics / imagefmt=png height=1000 width=1000;

filename send EMAIL 
	TO=( 
"xxxx"
)
 subject="test"
 type="text/html";

ods html5 (id=mail) file=send style=pearlj
 options(bitmap_mode="inline") gtitle;
 title "test";
proc gchart DATA=sashelp.class ; 
 	VBAR 
	 sex
 /
 SUMVAR=height
 DISCRETE
	CLIPREF
FRAME	
	COUTLINE=BLACK
 ;   
run;

	ods html5 (id=mail) close; 

code should send an email like this

 

sathya66_0-1757412259331.png

instead, it is ending below info via email

sathya66_1-1757412308248.png

Thanks,

SS

 

1 ACCEPTED SOLUTION

Accepted Solutions
sathya66
Barite | Level 11

Resolved it by adding goption

goptions reset=all device=png gsfname=graphout;

 

 

 

goptions reset=all device=png gsfname=graphout;

ods graphics / imagefmt=png height=1000 width=1000;

filename send EMAIL 
	TO=( 
"xxxx"
)
 subject="test"
 type="text/html";

ods html5 (id=mail) file=send style=pearlj
 options(bitmap_mode="inline") gtitle;
 title "test";
proc gchart DATA=sashelp.class ; 
 	VBAR 
	 sex
 /
 SUMVAR=height
 DISCRETE
	CLIPREF
FRAME	
	COUTLINE=BLACK
 ;   
run;

	ods html5 (id=mail) close; 

View solution in original post

8 REPLIES 8
Kathryn_SAS
SAS Employee

Your code works with the ODS HTML destination. With ODS HTML5, PROC SGPLOT works successfully. Are either of these an option for you?

sathya66
Barite | Level 11

Above code works fine without ERRORs  but not sending the proper output via email. Any option would work for me.

 

I tried with ods html. I am getting below ERROR. 

ERROR: Insufficient authorization to access /config/Lev1/SASApp/gchart4.svg.

 

Kathryn_SAS
SAS Employee

This code works for me and does not generate an error in 9.4M8. If you have problems with this, please send the complete log.

ods graphics / imagefmt=png height=1000 width=1000;

filename send EMAIL 
	TO=( 
"aaa@bbb.com"
)
 subject="test"
 type="text/html";

ods _all_ close;
ods html (id=mail) file=send style=pearlj
 options(bitmap_mode="inline") gtitle;
 title "test";
proc gchart DATA=sashelp.class ; 
 	VBAR 
	 sex
 /
 SUMVAR=height
 DISCRETE
	CLIPREF
FRAME	
	COUTLINE=BLACK
 ;   
run;
quit;
	ods html (id=mail) close; 
	ods listing;
sathya66
Barite | Level 11
27         
28         ods graphics / imagefmt=png height=1000 width=1000;
29         
30         filename send EMAIL
31         	TO=(
32         "xxxxxxx"
33         )
34          subject="test"
35          type="text/html";
36         
37         ods _all_ close;
38         ods html (id=mail) file=send style=pearlj
39          options(bitmap_mode="inline") gtitle;
NOTE: Writing HTML(MAIL) Body file: SEND
40          title "test";
41         proc gchart DATA=sashelp.class ;
42          	VBAR
43         	 sex
44          /
45          SUMVAR=height
46          DISCRETE
47         	CLIPREF
48         FRAME	
49         	COUTLINE=BLACK
50          ;
51         run;

ERROR: Insufficient authorization to access /config/Lev1/SASApp/gchart.svg.
52         quit;

NOTE: There were 19 observations read from the data set SASHELP.CLASS.
2                                                          The SAS System                    Tuesday, September  9, 2025 12:10:00 PM

NOTE: PROCEDURE GCHART used (Total process time):
      real time           0.10 seconds
      cpu time            0.11 seconds
      

53         	ods html (id=mail) close;
Message sent
      To:          "xxxx"
      Cc:          
      Bcc:         
      Subject:     test
      Attachments: 
54         	ods listing;
55         

I am getting above ERROR.

Kathryn_SAS
SAS Employee

Try adding the following to see if that makes a difference:

goptions device=PNG;

/* before this statement */
ods _all_ close;

sathya66
Barite | Level 11

No, giving the same ERROR


2 The SAS System Tuesday, September 9, 2025 12:10:00 PM

ERROR: Insufficient authorization to access /config/Lev1/SASApp/gchart3.png.
ERROR: Physical file does not exist, /config/Lev1/SASApp/gchart3.png.
56 quit;

sathya66
Barite | Level 11

Seen this post

 

https://communities.sas.com/t5/Graphics-Programming/Saving-PROC-GPLOT-graph-to-folder/td-p/147397

 

but it doesn't resolve my issue. code is not sending the output properly via email.

sathya66
Barite | Level 11

Resolved it by adding goption

goptions reset=all device=png gsfname=graphout;

 

 

 

goptions reset=all device=png gsfname=graphout;

ods graphics / imagefmt=png height=1000 width=1000;

filename send EMAIL 
	TO=( 
"xxxx"
)
 subject="test"
 type="text/html";

ods html5 (id=mail) file=send style=pearlj
 options(bitmap_mode="inline") gtitle;
 title "test";
proc gchart DATA=sashelp.class ; 
 	VBAR 
	 sex
 /
 SUMVAR=height
 DISCRETE
	CLIPREF
FRAME	
	COUTLINE=BLACK
 ;   
run;

	ods html5 (id=mail) close; 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 259 views
  • 1 like
  • 2 in conversation