🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 12-01-2021 05:03 PM
(1200 views)
When I run the following logic, the first table doesn't produce a title, but the second one does.
%macro email;
%if &total_obs>0 %then %do;
data _null_;
call symputx("today",put(today()-1,mmddyy10.));
run;
options EMAILSYS=SMTP EMAILID="xxxx.xxxxx@xxxxxxx.com" EMAILHOST="email.xxxx.com";
FILENAME output EMAIL SUBJECT="ERCOT flow count as of &today."
FROM="xxxx.xxxxx@xxxxxxx.com"
TO=("xxxx.xxxxx@xxxxxxx.com" )
type='text/html'
CT ='text/html';
title;
footnote;
ods html3 (id=mail) body=OUTPUT
style=htmlblue;
ods escapechar='^';
ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black} ";
ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}Good morning,";
ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black} ";
ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}See counts below and let me know if you have questions.";
ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}Attached worksheet for reference. ";
ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}Thanks,";
ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}Keegan";
title;
*** New Connects table ***;
proc print data=acq_final noobs
style (table) = [frame=box borderwidth=1 ]
style (data) = {just=c}
style (header) = {just=c};
TITLE "New Connects";
run;
title;
*** All other counts table ***;
proc print data=all_final noobs
style (table) = [frame=box borderwidth=1 ]
style (data) = {just=c}
style (header) = {just=c};
TITLE "Other Flow Counts";
run;
title;
ods html3 (id=mail) close;
%end;
%mend;
%email;
This is the email output:
You'll notice that the title of the second table prints, but not the first. Why is this? What can I do to fix this? @ChrisHemedinger
Thank you for your help!
Keegan
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Testing shows it's the interaction between the ODS TEXT statements and TITLE that is causing the issue. If you switch the ODS TEXT statements to PROC ODSTEXT instead it seems to go away.
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsproc/n06rruvsw8xaqnn17cofvmpz7j31.htm
No idea why or if this is expected behaviour though.
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsproc/n06rruvsw8xaqnn17cofvmpz7j31.htm
No idea why or if this is expected behaviour though.
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Testing shows it's the interaction between the ODS TEXT statements and TITLE that is causing the issue. If you switch the ODS TEXT statements to PROC ODSTEXT instead it seems to go away.
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsproc/n06rruvsw8xaqnn17cofvmpz7j31.htm
No idea why or if this is expected behaviour though.
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsproc/n06rruvsw8xaqnn17cofvmpz7j31.htm
No idea why or if this is expected behaviour though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you! This worked. To clarify, this was the updated syntax:
PROC ODSTEXT; p "^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black} ";
PROC ODSTEXT; p "^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}Good morning,";
PROC ODSTEXT; p "^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black} ";
PROC ODSTEXT; p "^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}See counts below and let me know if you have questions.";
PROC ODSTEXT; p "^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}Attached worksheet for reference. ";
PROC ODSTEXT; p "^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}Thanks,";
PROC ODSTEXT; p "^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}Keegan";
Thank you for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I think you can use only one PROC ODSTEXT statement, you don't need multiple do you? That's one of the benefits of PROC ODSTEXT, it can do texts/paragraphs etc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Right again!
Thank you so much!