BookmarkSubscribeRSS Feed
Mar1ene
Obsidian | Level 7

Hello from South Africa,

 

Please help me to organize my email layout.  My code below:

 

/*EMAIL SUMMARY VIEW AND EXCEPTION REPORTS*/
/*-------------------------------------------------------------------------------*/
options emailsys=smtp emailhost= localhost emailport=25;

FILENAME OUTPUT EMAIL
SUBJECT = "Trying to find a better email layout"
attach=("Path/File_Name.xlsx" content_type="application/xlsx")
FROM = "Mar1ene@email.co.za"
TO=('Mar1ene@email.co.za')
type='text/html'
CT ='text/html';

ods html3 body=OUTPUT

 

/*EMAIL BODY*/
/*-------------------------------------------------------------------------------*/
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}Hello,";
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}Please help me to space my body text and output tables better";
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}Thank you,";
ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black}Mar1ene";
ODS TEXT="^S={font_face='Calibri' font_size=3 fontweight=Medium foreground=black} ";
ODS TEXT="^S={font_face='Calibri' font_size=5 fontweight=Medium foreground=black}SUMMARY CATEGORY 3";

 

/*CATEGORY 3*/
proc print data=Table_Name
(rename=(Var1=Var_1 Var2=Var_2 Var3=Var_3))
style (table) = [frame=box borderwidth=1] noobs;
VAR Var_1 Var_2  Var_3 Amount N;
format Amount comma20.;
TITLE "Fancy output Title to impress people";
Footnote1 "Explain my summary table above a little, just for fun;
run;

 

proc print data=Table_Name2
(rename=(Var4=Var_4 Var5=Var_5 Var6=Var_6)) 
style (table) = [frame=box borderwidth=1] noobs;
VAR Var_4 Var_5 Var_6 Amount N;
format Amount comma20.;
TITLE "Fancy output Title... again...";
Footnote1 "Explain my summary table above a little, because i can;
run;

 

ODS TEXT="^S={font_face='Calibri' font_size=5 fontweight=Medium foreground=black}SUMMARY CATEGORY 4";

 

/*CATEGORY 4*/
proc print data=Table_Name3
(rename=(Var7=Var_7 Var8=Var_8 Var9=Var_9)) 
style (table) = [frame=box borderwidth=1] noobs;
VAR Var_7 Var_8 Var_9 Amount N;
format Amount comma20.;
TITLE "Title Blah Blah Blah";
Footnote1 "I love texting here...;
run;

 

/*CATEGORY 5*/
/*CATEGORY 11*/

 

ods html3 close;

 

**bleep** output below:  (LOL!!  can't believe I got "bleeped"!!)

...okay... "DARN" output below:

Photo1 the table heading is above the body text... why?

 

 

 

OUPUT1.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Category 4 is directly under the Cat3 table, instead of above the Cat4 table?

OUPUT2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Thank you,

Marlene

1 REPLY 1
MartinMincey
SAS Employee

Hello,

 

It turns out that by default, the ODS TEXT statement does not force a new page break and does not force SAS to automatically go to a new "page" like a procedure step does.  One work around is to replace the ODS TEXT statement with a regular TITLE1 statement (and make your current TITLE1 statement a TITLE2 statement).  The following section of code illustrates this work around:

 

TITLE1 J=L "^S={font_face='Calibri' font_size=5 just=L fontweight=Medium foreground=black}SUMMARY CATEGORY 4";

TITLE2 "Title Blah Blah Blah";

Footnote1 "I love texting here...";

 

/*CATEGORY 4*/

proc print data=sashelp.class;

where sex="F";

run;

 

I also noticed that in your code, you are missing a few ending quotes from around some of your FOOTNOTE statements (but this might have just happened when you copied and pasted the code).  

 

When you have time, see if the work around above is an option for you.

 

Regards,

Martin Mincey

SAS Technical Support 

 

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1542 views
  • 1 like
  • 2 in conversation