BookmarkSubscribeRSS Feed
AbdallahBoodhun
Calcite | Level 5

Hi,

 

I am new to SAS and trying out the send email feature. Please find below my codes and log after running the program.

 

SAS Version: 9.4

 

ERROR: Email: The connection has timed out.

SAS Program:

options 
  emailsys=smtp 
  emailhost="MY-HOST-NAME-HERE"
  emailport=25;

/* Small SAS job to produce some data */
%let origin = Europe;
proc sql;
 create table subset as
  select * from sashelp.cars
  where origin = "&origin.";

 %let count=&sqlobs.;
quit;

/* Email message with dynamic content based on data */
filename msg email 
 to="MY-EMAIL"
 subject = "Created: Cars from &origin.";

data _null_;
 file msg;
 put "%trim(&count.) cars selected, subset from &origin.";
run;

SAS LOG:

1                                                          The SAS System                            13:25 Monday, February 27, 2023

1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='Program';
4          %LET _CLIENTPROCESSFLOWNAME='Standalone Not In Project';
5          %LET _CLIENTPROJECTPATH='';
6          %LET _CLIENTPROJECTPATHHOST='';
7          %LET _CLIENTPROJECTNAME='';
8          %LET _SASPROGRAMFILE='';
9          %LET _SASPROGRAMFILEHOST='';
10         
11         ODS _ALL_ CLOSE;
12         OPTIONS DEV=SVG;
13         GOPTIONS XPIXELS=0 YPIXELS=0;
14         %macro HTML5AccessibleGraphSupported;
15             %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) >= 0 %then ACCESSIBLE_GRAPH;
16         %mend;
17         FILENAME EGHTML TEMP;
18         ODS HTML5(ID=EGHTML) FILE=EGHTML
19             OPTIONS(BITMAP_MODE='INLINE')
20             %HTML5AccessibleGraphSupported
MLOGIC(HTML5ACCESSIBLEGRAPHSUPPORTED):  Beginning execution.
MLOGIC(_SAS_VERCOMP_FV):  Beginning execution.
MLOGIC(_SAS_VERCOMP_FV):  Parameter FMAJOR has value 9
MLOGIC(_SAS_VERCOMP_FV):  Parameter FMINOR has value 4
MLOGIC(_SAS_VERCOMP_FV):  Parameter FMAINT has value 4
MLOGIC(_SAS_VERCOMP_FV):  Parameter VMAJOR has value 0
MLOGIC(_SAS_VERCOMP_FV):  Parameter VMINOR has value 0
MLOGIC(_SAS_VERCOMP_FV):  Parameter VMAINT has value 0
MLOGIC(_SAS_VERCOMP_FV):  %LOCAL  MAJOR
MLOGIC(_SAS_VERCOMP_FV):  %LOCAL  MINOR
MLOGIC(_SAS_VERCOMP_FV):  %LOCAL  MAINT
MLOGIC(_SAS_VERCOMP_FV):  %LOCAL  CURMAJ
MLOGIC(_SAS_VERCOMP_FV):  %LOCAL  CURMIN
MLOGIC(_SAS_VERCOMP_FV):  %LOCAL  CURMNT
MLOGIC(_SAS_VERCOMP_FV):  %LET (variable name is CURMAJ)
SYMBOLGEN:  Macro variable SYSVLONG resolves to 9.04.01M7P080520
SYMBOLGEN:  Macro variable CURMAJ resolves to 9
MLOGIC(_SAS_VERCOMP_FV):  %IF condition %eval(&CurMaj EQ V) is FALSE
MLOGIC(_SAS_VERCOMP_FV):  %LET (variable name is MAJOR)
SYMBOLGEN:  Macro variable FMAJOR resolves to 9
MLOGIC(_SAS_VERCOMP_FV):  %LET (variable name is MINOR)
SYMBOLGEN:  Macro variable FMINOR resolves to 4
MLOGIC(_SAS_VERCOMP_FV):  %LET (variable name is MAINT)
SYMBOLGEN:  Macro variable FMAINT resolves to 4
MLOGIC(_SAS_VERCOMP_FV):  %LET (variable name is CURMIN)
SYMBOLGEN:  Macro variable SYSVLONG resolves to 9.04.01M7P080520
MLOGIC(_SAS_VERCOMP_FV):  %LET (variable name is CURMNT)
SYMBOLGEN:  Macro variable SYSVLONG resolves to 9.04.01M7P080520
SYMBOLGEN:  Macro variable MAJOR resolves to 9
SYMBOLGEN:  Macro variable CURMAJ resolves to 9
MLOGIC(_SAS_VERCOMP_FV):  %IF condition %eval(&major NE &CurMaj) is FALSE
SYMBOLGEN:  Macro variable MINOR resolves to 4
SYMBOLGEN:  Macro variable CURMIN resolves to 04
MLOGIC(_SAS_VERCOMP_FV):  %IF condition %eval(&minor NE &CurMin) is FALSE
SYMBOLGEN:  Macro variable MAINT resolves to 4
MLOGIC(_SAS_VERCOMP_FV):  %IF condition "&maint" = "" is FALSE
SYMBOLGEN:  Macro variable CURMNT resolves to 7
SYMBOLGEN:  Macro variable MAINT resolves to 4
2                                                          The SAS System                            13:25 Monday, February 27, 2023

MLOGIC(_SAS_VERCOMP_FV):  Ending execution.
MLOGIC(HTML5ACCESSIBLEGRAPHSUPPORTED):  %IF condition %_SAS_VERCOMP_FV(9,4,4, 0,0,0) >= 0 is TRUE
MPRINT(HTML5ACCESSIBLEGRAPHSUPPORTED):   ACCESSIBLE_GRAPH
MLOGIC(HTML5ACCESSIBLEGRAPHSUPPORTED):  Ending execution.
21             ENCODING='utf-8'
22             STYLE=HTMLBlue
23             NOGTITLE
24             NOGFOOTNOTE
25             GPATH=&sasworklocation
SYMBOLGEN:  Macro variable SASWORKLOCATION resolves to 
            "/apps/sas/saswork/SAS_work20C20027A8D3_s01vl9974558/SAS_work74E80027A8D3_s01vl9974558/"
26         ;
NOTE: Writing HTML5(EGHTML) Body file: EGHTML
27         
28         options
29           emailsys=smtp
30           emailhost="MY-HOST-NAME-HERE"
31           emailport=25;
32         
33         /* Small SAS job to produce some data */
34         %let origin = Europe;
35         proc sql;
36          create table subset as
37           select * from sashelp.cars
38           where origin = "&origin.";
SYMBOLGEN:  Macro variable ORIGIN resolves to Europe
NOTE: Compressing data set WORK.SUBSET increased size by 100.00 percent. 
      Compressed is 2 pages; un-compressed would require 1 pages.
NOTE: Table WORK.SUBSET created, with 123 rows and 15 columns.

39         
40          %let count=&sqlobs.;
SYMBOLGEN:  Macro variable SQLOBS resolves to 123
41         quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

42         
43         /* Email message with dynamic content based on data */
44         filename msg email
45          to="MY-EMAIL"
SYMBOLGEN:  Macro variable ORIGIN resolves to Europe
46          subject = "Created: Cars from &origin.";
47         
48         data _null_;
49          file msg;
MLOGIC(TRIM):  Beginning execution.
MLOGIC(TRIM):  This macro was compiled from the autocall file /apps/sas/Engines/SASFoundation/9.4/sasautos/trim.sas
SYMBOLGEN:  Macro variable COUNT resolves to 123
50          put "%trim(&count.) cars selected, subset from &origin.";
MLOGIC(TRIM):  Parameter VALUE has value 123
MLOGIC(TRIM):  %LOCAL  I
SYMBOLGEN:  Macro variable VALUE resolves to 123
MLOGIC(TRIM):  %DO loop beginning; index variable I; start value is 3; stop value is 1; by value is -1.  
SYMBOLGEN:  Macro variable VALUE resolves to 123
SYMBOLGEN:  Macro variable I resolves to 3
3                                                          The SAS System                            13:25 Monday, February 27, 2023

MLOGIC(TRIM):  %IF condition %qsubstr(&value,&i,1) ne   is TRUE
MLOGIC(TRIM):  %GOTO TRIMMED (label resolves to TRIMMED).
SYMBOLGEN:  Macro variable I resolves to 3
MLOGIC(TRIM):  %IF condition &i>0 is TRUE
SYMBOLGEN:  Macro variable VALUE resolves to 123
SYMBOLGEN:  Macro variable I resolves to 3
MLOGIC(TRIM):  Ending execution.
SYMBOLGEN:  Macro variable ORIGIN resolves to Europe
51         run;

NOTE: The file MSG is:
      E-Mail Access Device

ERROR: Email: The connection has timed out.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           2:12.22
      cpu time            0.00 seconds
      

52         
53         %LET _CLIENTTASKLABEL=;
54         %LET _CLIENTPROCESSFLOWNAME=;
55         %LET _CLIENTPROJECTPATH=;
56         %LET _CLIENTPROJECTPATHHOST=;
57         %LET _CLIENTPROJECTNAME=;
58         %LET _SASPROGRAMFILE=;
59         %LET _SASPROGRAMFILEHOST=;
60         
61         ;*';*";*/;quit;run;
62         ODS _ALL_ CLOSE;
63         
64         
65         QUIT; RUN;
66         

Please note that these two variables below has been intentionally changed to post in this forum:

  • emailhost="MY-HOST-NAME-HERE"
  • to="MY-EMAIL"

 

Can you help me understand why i am getting error:

ERROR: Email: The connection has timed out.

1 REPLY 1
SASKiwi
PROC Star

Talk to your SAS administrator and ask them if email is enabled on your SAS server and if so are your email settings correct.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 960 views
  • 0 likes
  • 2 in conversation