you can modify the formatting of your email content to ensure that the date and page number are placed correctly.
OPTION smtpclass=B smtpwriter=CSSMTP smtpatsign=@,
mt=`&mailto`,
from=`&mailfrom`,
mfs=3;
data _null_;
file cssmtp;
/* Email header and introductory message */
put "Subject: Your Subject";
put "Content-Type: text/plain";
put;
put "Dear Recipient,";
put;
/* TopTitle block */
put 'The following message is very long so I used a TopTitle and';
put 'Title and SubTitle. I am sending this report in an email';
put ' ';
/* Report content block */
newlist type=RACF_ACCESS,
tt=' ', /* Add an empty line after the TopTitle */
t='Undefined user ID in 1st qualifier of profile';
/* Close the data step to flush the output */
run;
/* Rest of your existing code for the report generation */
newlist type=RACF_ACCESS,
tt=' ',
t='Undefined user ID in 1st qualifier of profile'
select class=surrogat profile=USERID.SUBMIT
sortlist profile class;
or use use the ODS ESCAPECHAR method
like this
/* Set ODS ESCAPECHAR to control formatting */
ods escapechar='^';
/* Define macro variables for date and page number */
%let today = %sysfunc(today(), date9.);
%let pageno = 1;
/* Generate report */
ods listing close;
ods html file=_webout style=htmlblue;
title1 j=l "^S={preimage=''}^S={just=l font_weight=bold}The following message is very long so I used a TopTitle and";
title2 j=l "^S={preimage=''}^S={just=l font_weight=bold}Title and SubTitle. I am sending this report in an email";
proc print data=sashelp.class;
run;
/* Include date and page number in the report */
ods text="^S={preimage=''}^S={just=l font_weight=bold}&today. ^S={preimage=''}^S={just=r font_weight=bold}page &pageno.";
ods html close;
ods listing;
/* Reset ODS ESCAPECHAR */
ods escapechar='^';
------------------------------
Zimba toki
------------------------------
Original Message:
Sent: Thu December 21, 2023 04:50 PM
From: Scott Lahner
Subject: Sending Email with long message but Date and Page number interfering with message.
I am trying to draft an email with a long message in a Carla report the following: Note the Carla query is not the important thing here, although I am using TYPE=RACF_ACCESS. My main concern is my long message in the email having the Date and Page Number in the middle of it.
OPTION smtpclass=B smtpwriter=CSSMTP smtpatsign=@,
mt=`&mailto`,
from=`&mailfrom`,
mfs=3
newlist type=RACF_ACCESS,
tt='The following message is very long so I used a TopTitle and',
t='Title and SubTitle. I am sending this report in an email',
st='Undefined user ID in 1st qualifier of profile'
select class=surrogat profile=USERID.SUBMIT
sortlist profile class
When I receive the email the Date and Page number are finding their way right in the middle of my message. Is there a way to keep the TopTitle, Title and SubTitle but get rid of the Date and Page Number in the report?
Below is what my email looks like, notice the Date and Page Number.
The following message is very long so I used a TopTitle and 21 Dec 2023 15:31 page
1
Title and SubTitle. I am sending this report in an email
Undefined user ID in 1st qualifier of profile
This also happens if I use a short TopTitle message, the number of the page wraps to the 2nd line in the email.
Alert 21 Dec 2023 15:47 page
1
Title and SubTitle. I am sending this report in an email, More text to write can I do this with just a title.
Undefined user ID in 1st qualifier of profile
Profile Class
USERIDA.SUBMIT SURROGAT
------------------------------
Scott Lahner
------------------------------