BookmarkSubscribeRSS Feed
Florida78
Calcite | Level 5

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?

 

1 REPLY 1
CurtisMackWSIPP
Lapis Lazuli | Level 10

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.

https://documentation.sas.com/?docsetId=lrcon&docsetTarget=n05iwqtqxzvtvun1eyw11nrd9i9r.htm&docsetVe...

 

In EG, it looks like those options have been surfaced in the menus under Tools/Options/Administration.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 831 views
  • 0 likes
  • 2 in conversation