What I want in the Email?
Data exists for 19AUG2014 on welcome weekly letter data set.
WEEKLY WELCOME DATA |
The FREQ Procedure
13AUG2014 | 281 |
| 281 |
|
14AUG2014 | 307 |
| 588 |
|
15AUG2014 | 484 |
| 1072 |
|
18AUG2014 | 309 |
| 1381 |
|
19AUG2014 | 434 |
| 1815 |
|
I am getting the proc freq results but not the text "Data exists for 19AUG2014 on welcome weekly letter data set.". I am missing something and want help on this. Below is my code.
%LET CURDT1=%EVAL(%SYSFUNC(TODAY())-1);
%LET WEEK1=%SYSFUNC(PUTN(%EVAL(&CURDT1.),DATE9.));
MAILBOX EMAIL TO=("XXXX.XXXXX@XXXXX.COM") TYPE='text/html' SUBJECT='Data on Welcome Weekly Letter Data Set';
HTML BODY=MAILBOX RS=NONE;
DATA _NULL_;
SET TEST;
IF MAX_OPEN_DATE EQ TODAY()-1 THEN
PUT "DATA EXISTS FOR &WEEK1. ON WELCOME WEEKLY LETTER DATA SET.";
ELSE PUT "DATA MISSING FOR &WEEK1. ON WELCOME WEEKLY LETTER DATA SET.";
FREQ DATA=JK.WELCOME_LETTER_WEEKLY;
TABLES OPEN_DATE;
RUN;
ODS HTML CLOSE;
try to run it in a macro, so you can build TITLE statement
%MACRO DO_IT;
%LET A=05;
%LET B=02;
filename MAILBOX EMAIL TO=("herman.jacobs@axa.be") TYPE='text/html' SUBJECT='test test' ;
%if &a GE &b %then %let text=' A >= B';
%else %let text=' A <= B';
title;
title ">>>> &text";
ODS HTML BODY=MAILBOX RS=NONE ;
proc FREQ DATA=sashelp.class ;
TABLES sex;
RUN;
ODS HTML CLOSE;
%MEND;
%DO_IT;
HERMAN
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.