BookmarkSubscribeRSS Feed
Hima
Obsidian | Level 7

What I want in the Email?

Data exists for 19AUG2014 on welcome weekly letter data set.


WEEKLY WELCOME DATA

The FREQ Procedure


13AUG2014


281


  1. 15.48

281


  1. 15.48

14AUG2014


307


  1. 16.91

588


  1. 32.40

15AUG2014


484


  1. 26.67

1072


  1. 59.06

18AUG2014


309


  1. 17.02

1381


  1. 76.09

19AUG2014


434


  1. 23.91

1815


  1. 100.00


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;

1 REPLY 1
Jaheuk
Obsidian | Level 7

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 736 views
  • 3 likes
  • 2 in conversation