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
instead, it is ending below info via email
Thanks,
SS
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;
Your code works with the ODS HTML destination. With ODS HTML5, PROC SGPLOT works successfully. Are either of these an option for you?
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.
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;
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.
Try adding the following to see if that makes a difference:
goptions device=PNG;
/* before this statement */
ods _all_ close;
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;
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.
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;
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!
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.
Ready to level-up your skills? Choose your own adventure.