BookmarkSubscribeRSS Feed
Ronein
Onyx | Level 15

Hello

I want to send an email via sas and have text in body email.

I get an email to my outlook but the body is empty.

 

why?????

 


options 
nocenter
emailsys=smtp 
emailhost=smtp.leumi
emailport=25
;
FILENAME mail EMAIL 
TO="<Ron.gggdansk@gmail.com>"
FROM="<Ron.gggdansk@gmail.com>"
SUBJECT="עדכון פאנל העמדות-CS" 
CONTENT_TYPE="text/html" 
encoding="utf-8";
ODS LISTING CLOSE;
ODS HTML BODY=mail;
proc odstext;
 p 'היי,'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  just=R};
 P ' ';
 P ' ';
 P ' ';
 P ' ';
 P ' ';
 p 'בברכה'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  just=R};
 p 'משה   '/Style=Header {fontsize=12pt  color=black  fontstyle=italic  just=R};
run;

 Here is the log

1 The SAS System                                                                                   08:02 Wednesday, October 15, 2025

1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='f_Dynamic_code_V5.sas';
4          %LET _CLIENTPROCESSFLOWNAME='Standalone Not In Project';
5          %LET _CLIENTPROJECTPATH='';
6          %LET _CLIENTPROJECTPATHHOST='';
7          %LET _CLIENTPROJECTNAME='';
8          %LET _SASPROGRAMFILE='M:\a.ריכוז תוכניות\CS\פאנל העמדות_מעודכן-יולי 2025\f_Dynamic_code_V5.sas';
9          %LET _SASPROGRAMFILEHOST='HKSU102561A79';
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
NOTE: The ACCESSIBLE_GRAPH option is pre-production for this release.
21             ENCODING='utf-8'
22             STYLE=HTMLBlue
23             NOGTITLE
24             NOGFOOTNOTE
25             GPATH=&sasworklocation
26         ;
NOTE: Writing HTML5(EGHTML) Body file: EGHTML
27         
28         
29         options
30         nocenter
31         emailsys=smtp
32         emailhost=smtp.leumi
33         emailport=25
34         ;
35         FILENAME mail EMAIL
36         TO="<Ron.Einstein@BankLeumi.co.il>"
37         FROM="<Ron.Einstein@BankLeumi.co.il>"
38         SUBJECT="עדכון פאנל העמדות-CS"
39         CONTENT_TYPE="text/html"
40         encoding="utf-8";
41         ODS LISTING CLOSE;
42         ODS HTML BODY=mail;
NOTE: Writing HTML Body file: MAIL
43         proc odstext;
44          p 'היי,'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  just=R};
45          P ' ';
46          P "פאנל העמדות עודכן עד העמדות בתאריך &max_Haamada_date."/Style=Header {fontsize=12pt  color=black  fontstyle=italic
46       ! fontweight=bold just=R };
47          P ' ';
48          p 'להלן טבלת הפאנל החדשה-'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R
48       ! backgroundcolor=lightYellow};
49          p ' r_r.Panel_Haamadot_CS '/Style=Header {fontsize=12pt  color=black  fontstyle=italic  just=R fontweight=bold
49       ! backgroundcolor=lightYELLOW};
50          P 'הפאנל מתעדכן בכל יום ומהווה טבלה צוברת של העמדות החל מ01.09.2020 ועד יום עסקים אחרון'/Style=Header {fontsize=12pt
50       ! color=black  fontstyle=italic  fontweight=bold just=R };
51          P ' ';
2 The SAS System                                                                                   08:02 Wednesday, October 15, 2025

52          P ' ';
53          P ' ';
54          P ' ';
55          P 'להלן טבלת עזר שבה אפשר לחפש את כל הבקשות באושרו במנוע של לקוח מסויים'/Style=Header {fontsize=12pt  color=black
55       ! fontstyle=italic  fontweight=bold just=R backgroundcolor=lightYellow};
56          P 'זוהי טבלת עזר שתעזור לנו לתחקר מדוע לא נמצאה בקשה תואמת להעמדה בחיתום ממוכן'/Style=Header {fontsize=12pt  color=black
56       !   fontstyle=italic  fontweight=bold just=R };
57          P 'r_r.Engine_Process_Vatik_New'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
58          P 'עדיף לחפש לפי נומרטור דאטא ווורהאוס או לפי תז'/Style=Header {fontsize=12pt  color=black  fontstyle=italic
58       ! fontweight=bold just=R };
59          P ' ';
60          P ' ';
61          P 'לפי הסיומת של השדות אפשר לדעת את מקור הנתונים'/Style=Header {fontsize=12pt  color=black  fontstyle=italic
61       ! fontweight=bold just=R  backgroundcolor=lightYellow };
62          P '_H- שדות מסקור ידוע'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
63          P ' בשדות מסקור ידוע יש שוני בין מקרה שהלקוח לא קים בסקור ידוע לבין מצב שהלקוח קיים והשדה עם ערך ריק'/Style=Header
63       ! {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
64          P '_C- שדות מסקור חודש העמדה '/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
65          P 'מאחר ובתאריך העמדה סקור חודש העמדה לא פורסם עדיין אז עם פרסום סקור חדש נתוני סקור חודש העמדה מתעדכנים
65       ! רטרואקטיבית'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
66          P '_DP-שדות מדיילי פאנל מתאריך העמדה שמייצגים ניצול בסוף יום העסקים של תאריך העמדה'/Style=Header {fontsize=12pt
66       ! color=black  fontstyle=italic  fontweight=bold just=R };
67          P 'ENGINE-שדות מבקשה במנוע שתואמת להעמדה בחיתום ממוכן '/Style=Header {fontsize=12pt  color=black  fontstyle=italic
67       ! fontweight=bold just=R };
68          P ' ';
69          P ' ';
70          P 'Sivug_Loans'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R
70       ! backgroundcolor=lightYellow };
71          P 'סיווג העמדות לחיתום ממוכן או ידני'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R
71       !  };
72          P ' יש לציין שהסיווג איננו מדוייק ב100%'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold
72       ! just=R };
73          P '(A)-חיתום_ממוכן_מבוסס_מנוע '/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
74          P '(B)-חיתום_ממוכן_מבוסס_הכינותי_ללא_מנוע'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold
74       ! just=R };
75          P '(C)-תשלומון/פורס'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
76          P '(D)-קליק_מסחרי '/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
77          P '(E)-חיתום_ידני '/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
78          P ' ';
79          P ' ';
80          P 'hativa_Time_Haamada'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R
80       ! backgroundcolor=lightYellow};
81          P 'חטיבה נכון לתאריך העמדה'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
82          P ' ';
83          P 'mekushar_C'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R
83       ! backgroundcolor=lightYellow};
84          P ' מקושר מסקור חודש העמדה'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
85          P ' ';
86          P 'mekushar_H'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R
86       ! backgroundcolor=lightYellow};
87          P ' מקושר מסקור ידוע'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
88          P ' ';
89          P ' ';
90          P 'אוכלוסיה'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R
90       ! backgroundcolor=lightYellow};
91          P 'העמדות מטי/מטח ללקוחות מחטיבות 833 703 כולל פפר וללא סינון מקושרים וללא סינון דגמי חובב והוצאות משפטיות'/Style=Header
91       !  {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
92          P 'שיוך חטיבתי ל-803,703 בוצע לפי חטיבה אליה שייך הלקוח נכון לתאריך העמדה'/Style=Header {fontsize=12pt  color=black
3 The SAS System                                                                                   08:02 Wednesday, October 15, 2025

92       ! fontstyle=italic  fontweight=bold just=R };
93          P ' ';
94          P ' ';
95          P 'kv_degem'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  just=R fontweight=bold
95       ! backgroundcolor=lightYELLOW};
96          P 'שיוך לקבוצת דגם מנתוני הדאטא וורהאוס'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  just=R};
97          P ' ';
98          P ' ';
99          P ' ';
100         P ' ';
101         P 'בפאנל מוצגות בקשות מאושרות במנוע רק עבור העמדות בחיתום ממוכן מבוסס מנוע'/Style=Header {fontsize=12pt  color=black
101      ! fontstyle=italic  fontweight=bold just=R };
102         P ' ';
103         P 'chosen_Offer_Amnt '/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R
103      ! backgroundcolor=lightYellow };
104         P 'הצעה במנוע שרלבנטית להעמדה שבוצעה בחיתום ממוכן'/Style=Header {fontsize=12pt  color=black  fontstyle=italic
104      ! fontweight=bold just=R };
105         P ' ';
106         P 'Channel_Desc'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R
106      ! backgroundcolor=lightYellow };
107         P 'ערוץ העמדה'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
108         P 'להלן ערוצי העמדה דיגיטלים'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
109         P 'אייפון , אנדרואיד , גלישה ישירה , כספומט חדש ,  עמדת קהל חיצוני , עמדת קהל סניף , מוביל לבנק הדיגיטלי'/Style=Header
109      ! {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
110         P ' ';
111         P ' ';
112        P 'PRODUCTID_ENGINE'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R
112      ! backgroundcolor=lightYellow };
113        P '(MO)-לקוח עם וותק מעל 3 חודשים וללא מחזור נמוך והצעות מרובות-קליק סטודנטים רכב הסדר שכירים'/Style=Header
113      ! {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
114        P '(UL)-לקוח עם וותק מעל 3 חודשים וללא מחזור נמוך והצעה לקליק בלבד '/Style=Header {fontsize=12pt  color=black
114      ! fontstyle=italic  fontweight=bold just=R };
115        P '(AP)-לקוח חדש מזדמן לבקשת הלוואת רכב '/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold
115      ! just=R };
116        P '(CP)-לקוח עם וותק מעל 3 ח עם מחזור נמוך '/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold
116      ! just=R };
117        P '(NC)-לקוח חדש-מזדמן או פתח כבר חן ועברו עד 3 ח '/Style=Header {fontsize=12pt  color=black  fontstyle=italic
117      ! fontweight=bold just=R };
118        P '(BL)-אשראי בקליק מסחרי '/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
119        P ' ';
120        P ' ';
121         P 'ROUTING_ENGINE'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R
121      ! backgroundcolor=lightYellow };
122         P '(ACCEPT)תהליך קליק עבר בהצלחה '/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
123         P '(BUREAU)נוצרה בקשה כפולה עקב פנייה למאגר אשראי '/Style=Header {fontsize=12pt  color=black  fontstyle=italic
123      ! fontweight=bold just=R };
124         P '(DECLINE)תהליך קליק נדח '/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
125         P '(FAILURE)-תקלה בתהליך קליק עקב תקלה במנוע או תקלה בדוח המלא ממאגר אשראי '/Style=Header {fontsize=12pt  color=black
125      ! fontstyle=italic  fontweight=bold just=R };
126         P '(REFER)תהליך קליק הופנה לסניף וזה למעשה כמו דחייה '/Style=Header {fontsize=12pt  color=black  fontstyle=italic
126      ! fontweight=bold just=R };
127         P ' ';
128         P ' ';
129         P 'בפאנל קיימים נתונים מהמקורות הבאים'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold
129      ! just=R  backgroundcolor=lightYellow};
130         P ' א-נתוני העמדה מהדאטא וורהאוס כגון מזהה הסכם הלוואה,תאריך העמדה,שעת העמדה, סכום העמדה,סוג הלוואה, מטבע
130      ! הלוואה,ריבית,מרווח מפריים,מספר תשלומים,תאריך סיום מתוכנן וכו'/Style=Header {fontsize=12pt  color=black  fontstyle=italic
130      !  fontweight=bold just=R };
4 The SAS System                                                                                   08:02 Wednesday, October 15, 2025

131         P ' ב-מאפיני לקוח נכון לתאריך העמדה מהדאטא וורהאוס-לקוח, סניף, חטיבה ,מערך וכו'/Style=Header {fontsize=12pt  color=black
131      !   fontstyle=italic  fontweight=bold just=R };
132         P 'ג-מאפיני הלקוח מסקור ידוע כגון עושר ניצול דירוג וכו'/Style=Header {fontsize=12pt  color=black  fontstyle=italic
132      ! fontweight=bold just=R };
133         P 'ד-נתוני קובץ הכינותי קובץ שהיה זמין נכון לתאריך העמדה'/Style=Header {fontsize=12pt  color=black  fontstyle=italic
133      ! fontweight=bold just=R };
134         P 'ה-נתוני בקשה במנוע שקשורה להעמדה שבוצעה וזה רק עבור העמדות בחיתום ממוכן מבוסס מנוע'/Style=Header {fontsize=12pt
134      ! color=black  fontstyle=italic  fontweight=bold just=R };
135         P 'ו-נתוני דיילי פאנל- לשליפת ניצול הלקוח לאחר העמדה לצורך חישוב מיצוי לאחר העמדה '/Style=Header {fontsize=12pt
135      ! color=black  fontstyle=italic  fontweight=bold just=R };
136         P ' ';
137         P ' ';
138         P 'באופן כללי אפשר לחלק את העמדות ל-4 קבוצות'/Style=Header {fontsize=12pt  color=black  fontstyle=italic
138      ! fontweight=bold just=R  backgroundcolor=lightYellow};
139         P 'א-העמדות בחיתום ממוכן שמבוצעות מתוך הגדרה ללא מנוע- תשלומון /פורס'/Style=Header {fontsize=12pt  color=black
139      ! fontstyle=italic  fontweight=bold just=R };
140         P 'ב-העמדות בחיתום ממוכן מבוסס מנוע '/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R
140      !  };
141         P 'ג-העמדות בחיתום ממוכן שבוצעו בהתבסס על הכינותי ללא מנוע בשל תקלה במנוע '/Style=Header {fontsize=12pt  color=black
141      ! fontstyle=italic  fontweight=bold just=R };
142         P 'ד-העמדות בחיתום ידני כלומר  הפקיד בבנק קבע את מאפיני ההלוואה-סכום,מספר תשלומים,ריבית וייתכן שהסתייע גם במנוע אך
142      ! ההחלטה היא של הפקיד'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
143         P ' ';
144         P ' ';
145         P 'חיתום ממוכן יכול להתבצע באופן הבא'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R
145      !   backgroundcolor=lightYellow};
146         P 'א-על ידי הלקוח באממצעים דיגיטליים ללא מגע יד פקיד '/Style=Header {fontsize=12pt  color=black  fontstyle=italic
146      ! fontweight=bold just=R };
147         P 'ב-יש מגע של פקיד בהעמדה אך הפקיד לא מחליט שום דבר והעמדה מתבצעת באופן דיגיטלי לפי מה שהמנוע קבע'/Style=Header
147      ! {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R };
148         P 'ג-יש מגע של פקיד בהעמדה והפקיד חייב לא לחרוג בסכום ומספר תשלומים שקבע המנוע  אך כן יכול לשפר את הריבית שהציע
148      ! המנוע-זהו חיתום ממוכן לא מלא משום שהפקיד שיפר את הריבית לעומת מה שהמנוע קבע'/Style=Header {fontsize=12pt  color=black
148      ! fontstyle=italic  fontweight=bold just=R };
149         P ' אין לנו יכולת לזהות את המקרה הזה'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  fontweight=bold just=R
149      !  };
150         P ' ';
151         P ' ';
152         P ' ';
153         p 'בברכה'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  just=R};
154         p 'רון אינשטין'/Style=Header {fontsize=12pt  color=black  fontstyle=italic  just=R};
155        run;
NOTE: PROCEDURE ODSTEXT used (Total process time):
      real time           0.02 seconds
      user cpu time       0.02 seconds
      system cpu time     0.00 seconds
      memory              924.68k
      OS Memory           34468.00k
      Timestamp           10/15/2025 03:13:53 PM
      Step Count                        788  Switch Count  0
      Page Faults                       0
      Page Reclaims                     211
      Page Swaps                        0
      Voluntary Context Switches        8
      Involuntary Context Switches      3
      Block Input Operations            0
      Block Output Operations           0
      

5 The SAS System                                                                                   08:02 Wednesday, October 15, 2025

156        
157        %LET _CLIENTTASKLABEL=;
158        %LET _CLIENTPROCESSFLOWNAME=;
159        %LET _CLIENTPROJECTPATH=;
160        %LET _CLIENTPROJECTPATHHOST=;
161        %LET _CLIENTPROJECTNAME=;
162        %LET _SASPROGRAMFILE=;
163        %LET _SASPROGRAMFILEHOST=;
164        
165        ;*';*";*/;quit;run;
166        ODS _ALL_ CLOSE;
Message sent
      To:          "<Ron.Einstein@BankLeumi.co.il>"
      Cc:          
      Bcc:         
      Subject:     עדכון פאנל העמדות-CS
      Attachments: 
167        
168        
169        QUIT; RUN;
170        
8 REPLIES 8
JOSELEt
Calcite | Level 5

hi good explaniation

Ronein
Onyx | Level 15
What change should I do in code?
Kurt_Bremser
Super User

Start with something simple:

filename m email
  to="redacted"
  subject="Test from SAS"
  content_type="text/html"
  encoding="utf-8"
;

ods _all_ close;

ods html body=m;

proc odstext;
p "test message";
run;

ods html close;

and expand from there.

This code worked for me from SAS On Demand, sent to a gmail account and received with mail on Mac OSX. The body is also there in gmail on Android.

Ronein
Onyx | Level 15

I run your code in my sas program and still get emty body text in email.

When I open a new sas program and run same code then I see the body text in email.

My question-

Why in my current program I dont see the body text in email????????

 

Here is the code I run

filename m email
  to="Ron.xxx@gmail.com"
  subject="Test from SAS"
  content_type="text/html"
  encoding="utf-8"
;
ods _all_ close;
ods html body=m;
proc odstext;
p "test message";
run;
ods html close;
Quentin
Super User

In your simple example, does it still work if you replace the ODS text with:

P 'הפאנל מתעדכן בכל יום ומהווה טבלה צוברת של העמדות החל מ01.09.2020 ועד יום עסקים אחרון'/Style=Header {fontsize=12pt color=black  fontstyle=italic  fontweight=bold just=R };

?

 

It's great that you have an example that works, and an example that doesn't work.

 

Typically I would start with the example that doesn't work, cut it down to be much simpler (just one or two lines in the email).  And see if it works. Then I would make that example even simpler, in iterative steps, to see if it starts working.  So you could remove the style format, then remove the non-Latin characters, etc.  The hope is that as you make your non-working example more and more like the working example, you'll find the issue.

 

Or alternatively, you can take your working example, and add complexity to it, to see if it will break.

Ronein
Onyx | Level 15

Both examples are same .

I run it in two different sas programs.

First program is a program with long code that I run previous to send email code.

Second program is a program with only send to email code.

In the First program I recieve email without text in body email.

In the Second program I recieve email with text in body email.

Kurt_Bremser
Super User
ballardw
Super User

You say that this runs:

 


 

Here is the code I run

filename m email
  to="Ron.xxx@gmail.com"
  subject="Test from SAS"
  content_type="text/html"
  encoding="utf-8"
;
ods _all_ close;
ods html body=m;
proc odstext;
p "test message";
run;
ods html close;

You do not have an ODS HTML CLOSE; in the long program instead using an ODS _ALL_ CLOSE;

There is a chance that the behavior of the _all_ is different with the ODS Close. Easy try would be to insert an ODS HTML CLOSE; after the Proc ODSTEXT; to see if that changes the behavior.

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 273 views
  • 0 likes
  • 5 in conversation