BookmarkSubscribeRSS Feed
Kiteulf
Quartz | Level 8

 

 

Hi i am trying get this to work with some text with some macros and some tables below or in between preferably:

 

Now I am getting two emails... 

 


ods _all_ close;
ods listing close;
options emailsys=smtp emailhost=smtprelay emailport=25;
filename mail email from="yourname@@yourdomai.no"
to="yourname@yourdomain.no"
subject="Topic &Periode"

ods msoffice2k file=mymail
style = sasweb ;
*proc report code below...;
data _null_;
file mail;
put "Hei,";
put ;
put "Fra og med starten av 2016 så har vi &Tot_apps søk fordelt på &Tot_apps_dir";
put;
put;

proc report data = paidoutratio_m;
proc report data = direct_paidout;
put;"I &Periode var andelen søk fra direkte &Tot_apps_dir_m%, satt opp mot perioden &Periode1";
proc report data = indirect_paidout;
run ;
ods msoffice2k close;

 

3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
I recommend you search the forum or Tech Support notes. Typically, you do something like this:
1) make a "report" file using ODS
2) create your FILENAME EMAIL statement with an ATTACH= option that points to the file created in #1
3) use a DATA step to send a message via email that tells them what report you are sending.

So, bottom line, the ODS file gets sent as an attachment. Please see the example on page 7 in this paper: http://support.sas.com/resources/papers/proceedings11/300-2011.pdf and the explanation that follows on page 8.

cynthia
Kiteulf
Quartz | Level 8

ods _all_ close;

ods listing close;

options emailsys=smtp emailhost=smtprelay emailport=25;
filename mail email from="xx@xx.no"
to="xx@xx.no"
subject="Automatiseringsgrad og service effektivitet &Periode"


content_type="text/html";
ods msoffice2k file=mail
style = sasweb ;
*proc report code below...;

data _null_;
     file print;
     put "Hei,";
     put ;
     put "Vedlagt finner du excelarket for periode &Periode med alle data. ";
	 put;
     put "Fra og med starten av 2016 så har vi &Tot_apps søk fordelt på &Tot_apps_dir(&direkte_vs_indirekte%) fra direkte og &tot_apps_indir fra indirekte. ";
	 put;
	 put;
	 put "I &Periode var andelen søk fra direkte &direkte_vs_indirekte_m%, versus perioden &Periode1 der vi hadde &direkte_vs_indirekte_m1%";
	 put;
	 put "AUTOMATIKK:";
	 put;
	 put"Fra Januar 2016 har vi hatt &auto_sys_pct% som har gått automatisk";
	 put;
	 put "I &Periode har vi hatt &auto_sys_pct_m% og i &Periode1 var det &auto_sys_pct_m1%";
	 
	
run;

data _null_;
     file print;
	 	 put;
	 put"TABELL 1: PAYOUT RATIO, Direkte og Indirekte:";
run;

proc report data = paidoutratio_m;


data _null_;
     file print;

	 put"APPROVALRATE:";
	 put;
	 put "Fra Januar 2016 har vi hatt &auto_sys_approval_pct% som har gått utenom scoring";
	 put;
	 put "I &Periode har vi hatt &auto_sys_approval_pct_m% og i &Periode1 var det &auto_sys_approval_pct_m1%";
	 put;
	 put"UTEN SCORING:";
	 put;
	 put "Fra Januar 2016 har vi hatt &kein_score% som har gått utenom scoring";
	 put;
	 put "I &Periode har vi hatt &kein_score_m% og i &Periode1 var det &kein_score_m1%";
     put ;
	 put"INVESTIGATE:";
	 put;
	 put "Fra Januar 2016 har vi hatt &auto_sys_invest_pct% som har gått til investigate";
	 put;
	 put "I &Periode har vi hatt &auto_sys_invest_pct_m% og i &Periode1 var det &auto_sys_invest_pct_m1%";


	
run;

data _null_;
     file print;
	 	 put;
	 put"TABELL 2: Direkte sin tidseffektivitet:";
run;

proc report data = direct_paidout;


data _null_;
     file print;
	 put;
	 put"TABELL 3: Indirekte sin tidseffektivtet:";
proc report data = indirect_paidout;
run ;
ods msoffice2k close;
Kiteulf
Quartz | Level 8

APPROVALRATE:                                                                                                                       Fra Januar 2016 har vi hatt 43.52% som har gått direkte til approval                                                                I 102016 har vi hatt 41.81% og i 092016 var det 42.50%                                                                               INVESTIGATE:                                                                                                                        =   Fra Januar 2016 har vi hatt 41.52% som har gått til investigate                                                                     I 102016 har vi hatt 42.17% og i 092016 var det 42.24%                                                                              

 

in the mail a "=" is written , why, and how do I get rid of it?

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!

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.

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