HI,
I created a SAS a chart line with code below : (I would like to send by email using SAS Code) but I am getting error
-------------------------------------------------------------------------------------------------------
%_eg_conditional_dropds(WORK.SORTTempTableSorted);
/* -------------------------------------------------------------------
Sort data set WORK.FINALREPORT
------------------------------------------------------------------- */
PROC SORT
DATA=WORK.FINALREPORT(KEEP=Date ABCPercentage)
OUT=WORK.SORTTempTableSorted
;
BY Date;
RUN;
%_sas_pushchartsize(1200,500);
GOPTIONS CBACK=WHITE;
SYMBOL1
INTERPOL=JOIN
POINTLABEL
HEIGHT=10pt
FONT=MARKER
VALUE=P
CV=BLUE
CO=BLUE
LINE=1
WIDTH=2
CI=BLUE
;
SYMBOL2
INTERPOL=JOIN
POINTLABEL
HEIGHT=10pt
VALUE=DOT
CV=RED
LINE=1
WIDTH=2
;
Legend1
FRAME
LABEL=(HEIGHT=11pt )
;
Axis1
STYLE=1
WIDTH=1
ORDER=(0 TO 1000 BY 100)
MINOR=NONE
;
Axis2
STYLE=1
WIDTH=1
Major = ( NUMBER=14
)
MINOR=NONE
LABEL=(HEIGHT=11pt )
;
Axis3
STYLE=1
WIDTH=1
ORDER=(0 TO 100 BY 10)
MINOR=NONE
LABEL=(FONT='/b' )
;
TITLE;
TITLE1 "Days REPORT";
FOOTNOTE;
FOOTNOTE1 "Generated by the SAS System on %TRIM(%QSYSFUNC(DATE(), NLDATE20.)) at %TRIM(%SYSFUNC(TIME(), TIMEAMPM12.))";
PROC GPLOT DATA = WORK.SORTTempTableSorted
;
PLOT CDE * Date /
OVERLAY
VAXIS=AXIS1
HAXIS=AXIS2
FRAME LVREF=1
CVREF=CXDBDBDB
AUTOVREF
LEGEND=LEGEND1
;
PLOT2 ABCPercentage * Date = 2 /
OVERLAY
VAXIS=AXIS3
OVERLAY
LEGEND=LEGEND1
;
/* -------------------------------------------------------------------
End of task code
------------------------------------------------------------------- */
RUN; QUIT;
%_eg_conditional_dropds(WORK.SORTTempTableSorted);
TITLE; FOOTNOTE;
%_sas_popchartsize;
GOPTIONS CBACK=;
GOPTIONS RESET = SYMBOL;
-------------------------------------------------------------------------------------
ods _ALL_ close;
ods listing gpath="&workdir";
ods graphics / reset=index outputfmt=PNG imagename='email';
title1 'Graph output emailed using SAS';
proc sgplot data=WORK.SORTTempTableSorted;
/* bubble x=horsepower y=mpg_city size=cylinders;*/
run;
filename sendmail email to=("mmm@mail.com") from=("mmm@mail.com")
/* attach=("&workdir./email.png" inlined='sgplot')*/
type='text/html' subject="Emailing graphics output";
data _null_;
file sendmail;
put '<html>';
put '<body>';
put '<img src=cid:sgplot>';
put '</body>';
put '</html>';
run;
filename sendmail clear;
------------------------------------------------------------------
can someone help me?
Have you set up an email server?
In traditional SAS this can be done by adding EMAILHOST and other options to your config file or to the command that starts your SAS sessions.
In EG, it looks like those options have been surfaced in the menus under Tools/Options/Administration.
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.