Hi,
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.
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;
Cheers from India!
Manjeet