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
Diamond | Level 26
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?

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 5106 views
  • 0 likes
  • 2 in conversation