Help using Base SAS procedures

SAS E-MAIL FORMAT PROBLEM

Reply
N/A
Posts: 0

SAS E-MAIL FORMAT PROBLEM

Hi Guys,

Does anyone know how to change the format of the text of e-mail utility of SAS?

I mean i've two different types of email formats, if the procedure i submit is done then i make a condition which sends me the "format1", otherwise sas send the other mail "format2".

But i want to change the font size & font colour of the text which is written in the content of e-mail. I could not find any source in this case. It would be great if you help me.

For example i want: "CONDITION 1 !!!" as written BOLD and RED and for "CONDITION 2 !!!" written as BOLD AND BLUE.

My code is:

DATA libcan.can; if id <= 4 then FILE outmail1;
PUT "CONDITION 1 !!!";
else
FILE outmail2;
PUT "CONDITION 2 !!!";
RUN;
N/A
Posts: 0

Re: SAS E-MAIL FORMAT PROBLEM

DATA libcan.can; if id <= 4 then FILE outmail1;
PUT "CONDITION 1 !!!";
else
FILE outmail2;
PUT "CONDITION 2 !!!";
RUN; Message was edited by: cakcan
SAS Super FREQ
Posts: 8,745

Re: SAS E-MAIL FORMAT PROBLEM

Hi:
When you use < or > symbols in your code, it confuses the forum posting software. So the "fix" is to use &lt; for the < symbol and &gt; for the > symbol or to post your code with LT, LE, GT, GE logical operators.

This previous forum posting is very helpful in explaining other things that you can do to help your postings look better and be more readable:
http://support.sas.com/forums/thread.jspa?messageID=27609毙

Meanwhile, I believe this is the code you wanted to post:
[pre]
DATA libcan.can; if id LE 4 then FILE outmail1;
PUT "CONDITION 1 !!!";
else
FILE outmail2;
PUT "CONDITION 2 !!!";
RUN;
[/pre]

Note that I changed <= to LE in the above code. I see that you do not have a SET statement in your program, so I find myself wondering how the test for ID will work out???? Generally, when you write output with a PUT statement, you are writing to FILE PRINT. You do not have as much control over the font characteristics of the output as you would in a PROC PRINT or a PROC REPORT. Although you could define color coding for a data step program, by using a custom TABLE template or writing the text with their own HTML tags or possibly using STYLE= overrides, if your mail system is set to PLAIN TEXT, there is really nothing you can do to override what the mail system format is - -from inside SAS. You have to play by the rules of the mail system you are using.

IF your mail system allows HTML content and IF you put HTML tags into your PUT statements you might be able to alter the color as you want. But those are 2 big IFs...and even if you SEND HTML e-mail content -- the receiving e-mail system has to allow HTML email content, too. You might want to check with the documentation or Tech Support -- I believe you have to change the content-type for the email engine if you want to send HTML. And, of course, you have to check with your mail administrators to see what they will allow.

cynthia
N/A
Posts: 0

Re: SAS E-MAIL FORMAT PROBLEM

My Code is:

DATA _NULL_;
set libcan.can;
FILE outmail1;
if id not in (8 9) then
do;
PUT "There is an error in the system, please check";
END;
if id in (1 2 3 4) then
do;
end;
PUT "Completed Successfully";

stop;
RUN;
N/A
Posts: 0

Re: SAS E-MAIL FORMAT PROBLEM

So my original code is this which contains set statement. So i can manage the "id" column. Anyway everything works fine in my code except TEXT FORMATS.

As i previously mentions, my only concern is to change the formats of the texts.

There is an error in the system, please check => should be bold and red

Completed Successfully => should be bold and blue

If it is possible, could you please send me the code of how to manipulate text formats in the program. It would be great for me.

Thanx
N/A
Posts: 0

Re: SAS E-MAIL FORMAT PROBLEM

I've checked the link you send me about the topic:
[Off-topic] Forum Markup
and get confused a little bit.
Could you please cleatrify that where can i write this code to my original code that i can see the text as a link:
GOOGLE

(I really need this thing)

I tried to write the code to my PUT statement but nothing happened. Could you please give an example depending on my code.
Super Contributor
Posts: 578

Re: SAS E-MAIL FORMAT PROBLEM

Most modern email clients interpret HTML tags. I know that SAS can send emails as HTML, so you could just use the html tags for font color.
Ask a Question
Discussion stats
  • 6 replies
  • 745 views
  • 0 likes
  • 3 in conversation