BookmarkSubscribeRSS Feed
Mushy
Quartz | Level 8

Hello All,

Following is the program that sends an email...The issue is that I would like to see the proc print below the texts without any line/breaks in the mail, so that in the mail you see every sentence in the next line:

 

FILENAME OUTPUT EMAIL
SUBJECT = "Test email SUBJECT"
TO=('abc')
type='text/html'
;
ODS LISTING CLOSE;

ods html body=OUTPUT
;
title;


proc odstext;
p "test1";
p "test2";
run;

proc print data=sashelp.class; where name='Alfred';
run;
proc print data=sashelp.class; where name='Alfred';
run;
proc odstext;
p "test3";
p "test4";
run;
ods html close;

 

Mushy_0-1642837354107.png

 

3 REPLIES 3
yabwon
Amethyst | Level 16

According to this: https://support.sas.com/kb/23/630.html

that seems to be doing the job:

ods all close;

ods html file='temp.html' headtext="<style>p,hr {display:none}</style>"
style=htmlblue
;

proc odstext;
p "test1";
p "test2";
run;

proc print data=sashelp.class; where name='Alfred';
run;
proc print data=sashelp.class; where name='Alfred';
run;
proc odstext;
p "test3";
p "test4";
run;

 

[EDIT]

For html5 try this: https://support.sas.com/kb/57/526.html

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



Mushy
Quartz | Level 8

Hello Bart,

 

Thanks for the mail.

But I still see the horizontal line in the email:

Mushy_0-1642864677685.png

 

 

Thanks

Mushy

Mushy
Quartz | Level 8

Hello,

 

I managed to find the solution by updating the pagebreakhtml option in a custom style:

 

proc template;
define style styles.nobreak;
parent=styles.htmlblue;
style body from body /
pagebreakhtml=_undef_;
end;

 

Thanks

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
  • 3 replies
  • 1685 views
  • 2 likes
  • 2 in conversation