<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: sas sending e mail in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sas-sending-e-mail/m-p/616389#M180557</link>
    <description>&lt;P&gt;You may put in a dataset and email as a table in html format. See sample code below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options emailhost=(xxxxxxx);
filename myemail EMAIL TO=(&amp;amp;&amp;amp;MAIL&amp;amp;i) 
		 CONTENT_TYPE="text/html" 
		 subject="MAGAZA BUYUME ORANLARI ";
							

ODS HTML BODY=myemail;
ods html text='&amp;lt;div align="Left"&amp;gt;Hi All,&amp;lt;/div&amp;gt; &amp;lt;BR&amp;gt;';
ods html text='&amp;lt;div align="Left"&amp;gt;Data as below &amp;lt;/div&amp;gt; &amp;lt;BR&amp;gt;';
						
PROC PRINT DATA=YOURDATASETNUMBER1; RUN ;
PROC PRINT DATA=YOURDATASETNUMBER2; RUN ;

ods html text='&amp;lt;BR&amp;gt;&amp;lt;div align="Left"&amp;gt; Any text &amp;lt;/div&amp;gt; &amp;lt;BR&amp;gt;';
ods html text='&amp;lt;div align="Left"&amp;gt;Any text &amp;lt;/div&amp;gt; &amp;lt;BR&amp;gt;';
ods html text='&amp;lt;div align="Left"&amp;gt;Any text &amp;lt;/div&amp;gt; &amp;lt;BR&amp;gt;';
ODS HTML CLOSE; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jan 2020 06:28:45 GMT</pubDate>
    <dc:creator>Pmyosh</dc:creator>
    <dc:date>2020-01-10T06:28:45Z</dc:date>
    <item>
      <title>sas sending e mail</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-sending-e-mail/m-p/611978#M180556</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    /* macro to email a file to a list */
%macro EmailFile;
 
   /* This creates a series of macro variables to send email to 
      individuals. */
   proc sort data=work.TEST1 out=list(keep=ShopName MAIL FISBUYUMESI FISBUYUMESIYTD SATISADETBUYUMESI SATISADETBUYUMESIYTD CIROBUYUMESI CIROBUYUMESIYTD SEPETADETBUYUMESI SEPETADETBUYUMESIYTD CONQUESTBUYUMESI CONQUESTBUYUMESIYTD CONVRATEBUYUMESI CONVRATEBUYUMESIYTD) nodupkey;
      by MGZID;
   run;
 
   data _null_;
      set list end=last;
      call symput(compress('MAIL'||_n_),MAIL);
	  call symput(compress('ShopName'||_n_),ShopName);
	   call symput(compress('FISBUYUMESI'||_n_),PUT(FISBUYUMESI,PERCENTN8.2));
	    call symput(compress('FISBUYUMESIYTD'||_n_),PUT(FISBUYUMESIYTD,PERCENTN8.2));
	  call symput(compress('SATISADETBUYUMESI'||_n_),PUT(SATISADETBUYUMESI,PERCENTN8.2));
	   call symput(compress('SATISADETBUYUMESIYTD'||_n_),PUT(SATISADETBUYUMESIYTD,PERCENTN8.2));
	   call symput(compress('CIROBUYUMESI'||_n_),PUT(CIROBUYUMESI,PERCENTN8.2));
	   call symput(compress('CIROBUYUMESIYTD'||_n_),PUT(CIROBUYUMESIYTD,PERCENTN8.2));
	    call symput(compress('SEPETADETBUYUMESI'||_n_),PUT(SEPETADETBUYUMESI,PERCENTN8.2));
	   call symput(compress('SEPETADETBUYUMESIYTD'||_n_),PUT(SEPETADETBUYUMESIYTD,PERCENTN8.2));
	   call symput(compress('CONQUESTBUYUMESI'||_n_),PUT(CONQUESTBUYUMESI,PERCENTN8.2));
	   call symput(compress('CONQUESTBUYUMESIYTD'||_n_),PUT(CONQUESTBUYUMESIYTD,PERCENTN8.2));
	   call symput(compress('CONVRATEBUYUMESI'||_n_),PUT(CONVRATEBUYUMESI,PERCENTN8.2));
	   call symput(compress('CONVRATEBUYUMESIYTD'||_n_),PUT(CONVRATEBUYUMESIYTD,PERCENTN8.2));
	  
	  
	  
      if last then call symput('tot',trim(left(_n_)));
   run;
 
   /* cycle through the individual emails to send the messages */
   %do i=1 %to &amp;amp;tot;
 
       /* if you want to attach a file use the filename statement
          and the pathname function to capture the location 
          of the file */
       /*filename freq "&amp;amp;fn.crr.csv";
      %let path=%sysfunc(pathname(freq));
      ods csv file=freq;
      proc print data=freqstart noobs;
      run;
      ods csv close;
 
       /* set options for email and use the filename statement
          with the email option to send email */
      
  options emailhost=(xxxxxxx);
 
      filename mymail email "&amp;amp;&amp;amp;MAIL&amp;amp;i"
         subject="MAGAZA BUYUME ORANLARI ";
         /*attach="&amp;amp;path";*/
 
           /* Add some text to the email */
   data _null_;
      file mymail;
      
      put "		Fis Buyumesi:			&amp;amp;&amp;amp;FISBUYUMESI&amp;amp;i ";
	  put "		Fis BuyumesiYTD:		&amp;amp;&amp;amp;FISBUYUMESIYTD&amp;amp;i"/n;
     
	  put "		Satis Buyumesi:			&amp;amp;&amp;amp;SATISADETBUYUMESI&amp;amp;i";
	  put "		Satis BuyumesiYTD:		&amp;amp;&amp;amp;SATISADETBUYUMESIYTD&amp;amp;i"/n;

	  put "		Sepet Buyumesi:		&amp;amp;&amp;amp;SEPETADETBUYUMESI&amp;amp;i";
	  put "		Sepet BuyumesiYTD:		&amp;amp;&amp;amp;SEPETADETBUYUMESIYTD&amp;amp;i"/n;

	  put "		Ciro Buyumesi :			&amp;amp;&amp;amp;CIROBUYUMESI&amp;amp;i";
	  put "		Ciro BuyumesiYTD :		&amp;amp;&amp;amp;CIROBUYUMESIYTD&amp;amp;i"/n;
	
	  put "		Kart Acilis Buyumesi:		&amp;amp;&amp;amp;CONQUESTBUYUMESI&amp;amp;i";
	  put "		Kart Acilis BuyumesiYTD:	&amp;amp;&amp;amp;CONQUESTBUYUMESIYTD&amp;amp;i"/n;

	  put "		Magaza Donusum Buyumesi:	&amp;amp;&amp;amp;CONVRATEBUYUMESI&amp;amp;i";
	  put "		Magaza Donusum BuyumesiYTD:&amp;amp;&amp;amp;CONVRATEBUYUMESIYTD&amp;amp;i"/n;
	    put "	*YTD: Yil icerisindeki toplam buyume degerini temsil etmektedir.";
	
     

	  

	  

	  


	 
	  
	  
	

	  
	  
	  
   run;
%end;
%mend;
 
%EmailFile&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;FONT size="3"&gt;hi ,&lt;/FONT&gt;&lt;/P&gt;&lt;PRE class="tw-data-text tw-text-large tw-ta"&gt;&lt;FONT size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: #222222; background: #F8F9FA;"&gt;&lt;FONT size="3"&gt;&lt;SPAN style="line-height: 1.2;"&gt;I want to design a code that will mail each store their own growth rates. the code works as follows. but we also want to add the number of baskets to the seller. I want to send two different data with a single mail. I can't join because the lines are multiplied. but my ID field is common in both tables.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: #222222; background: #F8F9FA;"&gt;how can I do it. my first table is based on a single line, while my second table should send rows with all employees working in that store.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial',sans-serif; color: #222222; background: #F8F9FA;"&gt;thank you:)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 09:01:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-sending-e-mail/m-p/611978#M180556</guid>
      <dc:creator>gizemetus</dc:creator>
      <dc:date>2019-12-16T09:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: sas sending e mail</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-sending-e-mail/m-p/616389#M180557</link>
      <description>&lt;P&gt;You may put in a dataset and email as a table in html format. See sample code below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options emailhost=(xxxxxxx);
filename myemail EMAIL TO=(&amp;amp;&amp;amp;MAIL&amp;amp;i) 
		 CONTENT_TYPE="text/html" 
		 subject="MAGAZA BUYUME ORANLARI ";
							

ODS HTML BODY=myemail;
ods html text='&amp;lt;div align="Left"&amp;gt;Hi All,&amp;lt;/div&amp;gt; &amp;lt;BR&amp;gt;';
ods html text='&amp;lt;div align="Left"&amp;gt;Data as below &amp;lt;/div&amp;gt; &amp;lt;BR&amp;gt;';
						
PROC PRINT DATA=YOURDATASETNUMBER1; RUN ;
PROC PRINT DATA=YOURDATASETNUMBER2; RUN ;

ods html text='&amp;lt;BR&amp;gt;&amp;lt;div align="Left"&amp;gt; Any text &amp;lt;/div&amp;gt; &amp;lt;BR&amp;gt;';
ods html text='&amp;lt;div align="Left"&amp;gt;Any text &amp;lt;/div&amp;gt; &amp;lt;BR&amp;gt;';
ods html text='&amp;lt;div align="Left"&amp;gt;Any text &amp;lt;/div&amp;gt; &amp;lt;BR&amp;gt;';
ODS HTML CLOSE; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 06:28:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-sending-e-mail/m-p/616389#M180557</guid>
      <dc:creator>Pmyosh</dc:creator>
      <dc:date>2020-01-10T06:28:45Z</dc:date>
    </item>
  </channel>
</rss>

