<?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: Sending Emails to users with filenames in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sending-Emails-to-users-with-filenames/m-p/448159#M112708</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the below sample code to send emails to the users, first we set your input dataset, lets call it -' have', the code will create a script in temp loation named(email_snd), which will be called using %inc and email will be sent based on data provided in the have data-set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;filename email_snd temp;

data _NULL_;
set have; /*put you input dataset name here*/

length 
rec1 $50. rec2 $50. rec3 $30. rec4 $30. rec5 $30. rec6 $30. rec7 $30.;

rec1 = %nrstr("filename mymail email '#email_id#@site.com' subject='Delete Big Files';");
rec1 = tranwrd(rec1, '#email_id#', User_name);
rec2 = %nrstr("data _null_;");
rec3 = %nrstr("file mymail;");
rec4 = %nrstr("put 'Hi #usr_id#';");
rec4 = tranwrd(rec4, '#usr_id#',User_name);
rec5 = %nrstr("put 'Please delete unnecessary files.';");
rec6 = %nrstr("put 'You may look at following files:';");
rec7 = %nrstr("put '#file_name#' ;");
rec7= tranwrd(rec7, '#file_name#', File_name);

file email_snd;
put 
rec1 /
rec2 /
rec3 /
rec4 /
rec5 /
rec6 /
rec7;

run;

%inc email_snd;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Mar 2018 13:59:46 GMT</pubDate>
    <dc:creator>mnjtrana</dc:creator>
    <dc:date>2018-03-23T13:59:46Z</dc:date>
    <item>
      <title>Sending Emails to users with filenames</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sending-Emails-to-users-with-filenames/m-p/132869#M27028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;My question is related to send emails to users. I have a data set user_details which has variable user_name and another dataset file_details which has list of big files (over 10gb )against those users. I need to send emails to all of them asking to delete unnecessary files. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sample user_details table :&lt;/P&gt;&lt;P&gt;User_name&lt;/P&gt;&lt;P&gt;L01234&lt;/P&gt;&lt;P&gt;M09677&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample file_details:&lt;/P&gt;&lt;P&gt;User_name File_name Size&lt;/P&gt;&lt;P&gt;L01234 c:\test1.txt 12&lt;/P&gt;&lt;P&gt;L01234 c:\test2.txt 11&lt;/P&gt;&lt;P&gt;M09677 d:\sample1.txt 34&lt;/P&gt;&lt;P&gt;M09677 d:\ sample2.txt 17&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I need to send emails to users L01234 and M09677.&amp;nbsp; Email should be something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi L01234,&lt;/P&gt;&lt;P&gt;Please delete unnecessary files. &lt;/P&gt;&lt;P&gt;You may look at following files:&lt;/P&gt;&lt;P&gt;C:\test1.txt&lt;/P&gt;&lt;P&gt;C:\test2.txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similar mail should be sent to user M09677&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on how to accomplish this ? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 13:19:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sending-Emails-to-users-with-filenames/m-p/132869#M27028</guid>
      <dc:creator>yashpande</dc:creator>
      <dc:date>2013-11-05T13:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sending Emails to users with filenames</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sending-Emails-to-users-with-filenames/m-p/448159#M112708</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the below sample code to send emails to the users, first we set your input dataset, lets call it -' have', the code will create a script in temp loation named(email_snd), which will be called using %inc and email will be sent based on data provided in the have data-set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;filename email_snd temp;

data _NULL_;
set have; /*put you input dataset name here*/

length 
rec1 $50. rec2 $50. rec3 $30. rec4 $30. rec5 $30. rec6 $30. rec7 $30.;

rec1 = %nrstr("filename mymail email '#email_id#@site.com' subject='Delete Big Files';");
rec1 = tranwrd(rec1, '#email_id#', User_name);
rec2 = %nrstr("data _null_;");
rec3 = %nrstr("file mymail;");
rec4 = %nrstr("put 'Hi #usr_id#';");
rec4 = tranwrd(rec4, '#usr_id#',User_name);
rec5 = %nrstr("put 'Please delete unnecessary files.';");
rec6 = %nrstr("put 'You may look at following files:';");
rec7 = %nrstr("put '#file_name#' ;");
rec7= tranwrd(rec7, '#file_name#', File_name);

file email_snd;
put 
rec1 /
rec2 /
rec3 /
rec4 /
rec5 /
rec6 /
rec7;

run;

%inc email_snd;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 13:59:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sending-Emails-to-users-with-filenames/m-p/448159#M112708</guid>
      <dc:creator>mnjtrana</dc:creator>
      <dc:date>2018-03-23T13:59:46Z</dc:date>
    </item>
  </channel>
</rss>

