<?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: Need Help! Need to send excel attachments dynamically to respected email in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/516109#M3068</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83078"&gt;@SuryaKiran&lt;/a&gt;, you are absolutely right.&lt;/P&gt;
&lt;P&gt;The call execute bewildered me to think it is executing after the step ends.&lt;/P&gt;
&lt;P&gt;Thank you to remind me.&lt;/P&gt;</description>
    <pubDate>Mon, 26 Nov 2018 20:22:22 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2018-11-26T20:22:22Z</dc:date>
    <item>
      <title>Need Help! Need to send excel attachments dynamically to respected email</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/515728#M2981</link>
      <description>&lt;P&gt;Data demo;&lt;BR /&gt;input part $ manager $10. manager_email $33.;&lt;BR /&gt;cards;&lt;BR /&gt;1055014 ravi ravi@gmail.com&lt;BR /&gt;1472388 ravi ravi@gmail.com&lt;BR /&gt;1515335 ravi ravi@gmail.com&lt;BR /&gt;1606838 ravi ravi@gmail.com&lt;BR /&gt;1788165 hari hari@gmail.com&lt;BR /&gt;2093853 hari hari@gmail.com&lt;BR /&gt;20R7177 hari hari@gmail.com&lt;BR /&gt;20R7235 ramya ramya@gmail.com&lt;BR /&gt;20R7509 bhargavi bhargavi@gmail.com&lt;BR /&gt;20R8560 bhargavi bhargavi@gmail.com&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;i need to send excel attachments to the list of parts associated to&amp;nbsp;the managers dynamically to respected email.&lt;/P&gt;&lt;P&gt;Example :&lt;/P&gt;&lt;P&gt;Partnos 1055014 1472388 1515335 1606838&amp;nbsp; excel has to send to ravi@gmail.com&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Partnos 1788165&lt;/SPAN&gt;&lt;SPAN&gt; 2093853 20R7177&amp;nbsp;excel has to send to hari@gmail.com&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Partnos 20R7235&amp;nbsp;excel has to send to ramya@gmail.com&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Partnos 20R7509&amp;nbsp;20R8560 &amp;nbsp;excel has to send to bhargavi@gmail.com&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Nov 2018 17:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/515728#M2981</guid>
      <dc:creator>Bhargavi221</dc:creator>
      <dc:date>2018-11-24T17:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help! Need to send excel attachments dynamically to respected email</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/515754#M2992</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use call symput() to send email based on the values in a dataset.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Nov 2018 01:03:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/515754#M2992</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-11-25T01:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help! Need to send excel attachments dynamically to respected email</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/515770#M2995</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83078"&gt;@SuryaKiran&lt;/a&gt;&amp;nbsp;Thanks for your replay.&lt;/P&gt;&lt;P&gt;I know i need to use call symput but unfortunately it did not worked for me, can you give me detail explanation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Sun, 25 Nov 2018 06:29:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/515770#M2995</guid>
      <dc:creator>Bhargavi221</dc:creator>
      <dc:date>2018-11-25T06:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help! Need to send excel attachments dynamically to respected email</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/515771#M2996</link>
      <description>&lt;P&gt;Based on&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83078"&gt;@SuryaKiran&lt;/a&gt;&amp;nbsp;suggestion and assuming data is sorted by email then&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   retain no_of_emails 0;
   set demo;
    by manager manager_email;   /* in case two managers have same name */
         length answer $80;   /* adapt to max length expected */

         if first.manager_email then answer = part;
         else answer = catx(' ',answer,part);


         if last.manager_email then do;
            call symput('PARTS',trim(answer));
            call execute(&amp;lt;send letter code using &amp;amp;parts or answer&amp;gt;);
        end;
run;

        &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Nov 2018 06:52:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/515771#M2996</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-11-25T06:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help! Need to send excel attachments dynamically to respected email</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/515773#M2998</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Okay, But how can i send list of parts associated with the respected mangers as a excel attachement dynamically.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Nov 2018 07:01:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/515773#M2998</guid>
      <dc:creator>Bhargavi221</dc:creator>
      <dc:date>2018-11-25T07:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help! Need to send excel attachments dynamically to respected email</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/515775#M2999</link>
      <description>&lt;P&gt;Can you post your code assuming there is &lt;STRONG&gt;only one&lt;/STRONG&gt; email ?&lt;/P&gt;
&lt;P&gt;Then I or someone in the forum will show how to merge it in the suggested code.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Nov 2018 07:14:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/515775#M2999</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-11-25T07:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help! Need to send excel attachments dynamically to respected email</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/515984#M3053</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You cannot use a macro variable reference to retrieve the value of a macro variable in the same program (or step) in which SYMPUT creates that macro variable and assigns it a value.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;            call symput('PARTS',trim(answer));
            call execute(&amp;lt;send letter code using &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&amp;amp;parts&lt;/STRONG&gt;&lt;/FONT&gt; or answer&amp;gt;);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 13:46:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/515984#M3053</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-11-26T13:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help! Need to send excel attachments dynamically to respected email</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/515987#M3055</link>
      <description>&lt;P&gt;What files do you want to attach in the email? Does the attachment files depend on the 'part' numbers for each manager. Then create a dataset that includes the physical path for the attachments and create a macro for sending an email with attachments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this (untested):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data demo;
input part $ manager :$10. manager_email :$33. attachment :$50.;
cards;
1055014 ravi ravi@gmail.com test1.xlsx
1472388 ravi ravi@gmail.com test2.xlsx
1515335 ravi ravi@gmail.com test3.xlsx
1606838 ravi ravi@gmail.com test4.xlsx
1788165 hari hari@gmail.com test5.xlsx
2093853 hari hari@gmail.com test6.xlsx
20R7177 hari hari@gmail.com test7.xlsx
20R7235 ramya ramya@gmail.com test8.xlsx
20R7509 bhargavi bhargavi@gmail.com test9.xlsx
20R8560 bhargavi bhargavi@gmail.com test10.xlsx
;
run;
proc sort data=demo;
by manager manager_email;
run;


%Macro email_out(to=,subject=,attach=);
filename mymail email 
	to=&amp;amp;to.
   	subject="Attachemnts for parts &amp;amp;subject."
   	attach=(&amp;amp;attach.);

data _null_;
   file mymail;
   put 'Hi,';
   put 'This is my SAS email file.';
run;

%mend email_out;


data _null_;
format partnos attach $50.;
do until(last.manager);
set demo;
by manager manager_email;
attach=catx(" ",attach,quote(strip(attachment)));
partnos=catx(' ',partnos,part);
end;
call execute(cats("%email_out(to=",quote(strip(manager_email)),",subject=",partnos,"attach=",attach,")"));
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Nov 2018 14:14:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/515987#M3055</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-11-26T14:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help! Need to send excel attachments dynamically to respected email</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/516109#M3068</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83078"&gt;@SuryaKiran&lt;/a&gt;, you are absolutely right.&lt;/P&gt;
&lt;P&gt;The call execute bewildered me to think it is executing after the step ends.&lt;/P&gt;
&lt;P&gt;Thank you to remind me.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 20:22:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/516109#M3068</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-11-26T20:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help! Need to send excel attachments dynamically to respected email</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/516253#M3110</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83078"&gt;@SuryaKiran&lt;/a&gt;&amp;nbsp;The code Logic looks fine. But its throwing error even though declaration of positional parameters are fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS Log:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;25 GOPTIONS ACCESSIBLE;&lt;BR /&gt;26 data _null_;&lt;BR /&gt;27 format partnos attach $50.;&lt;BR /&gt;28 do until(last.manager);&lt;BR /&gt;29 set demo;&lt;BR /&gt;30 by manager manager_email;&lt;BR /&gt;31 attach=catx(" ",attach,quote(strip(attachment)));&lt;BR /&gt;32 partnos=catx(' ',partnos,part);&lt;BR /&gt;33 end;&lt;BR /&gt;34 call execute(cats("%email_out(to=",quote(strip(manager_email)),",subject=",partnos,"attach=",attach,")"));&lt;BR /&gt;ERROR: All positional parameters must precede keyword parameters.&lt;BR /&gt;34 call execute(cats("%email_out(to=",quote(strip(manager_email)),",subject=",partnos,"attach=",attach,")"));&lt;BR /&gt;___________&lt;BR /&gt;49&lt;BR /&gt;NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space&lt;BR /&gt;between a quoted string and the succeeding identifier is recommended.&lt;/P&gt;&lt;P&gt;34 call execute(cats("%email_out(to=",quote(strip(manager_email)),",subject=",partnos,"attach=",attach,")"));&lt;BR /&gt;______&lt;BR /&gt;22&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, *, **, +, ',', -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;&amp;lt;, &amp;gt;=, AND, EQ, GE,&lt;BR /&gt;GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, ^=, |, ||, ~=.&lt;/P&gt;&lt;P&gt;35 run;&lt;BR /&gt;36&lt;BR /&gt;37 GOPTIONS NOACCESSIBLE;&lt;BR /&gt;38 %LET _CLIENTTASKLABEL=;&lt;BR /&gt;39 %LET _CLIENTPROCESSFLOWNAME=;&lt;BR /&gt;40 %LET _CLIENTPROJECTPATH=;&lt;BR /&gt;41 %LET _CLIENTPROJECTPATHHOST=;&lt;BR /&gt;42 %LET _CLIENTPROJECTNAME=;&lt;BR /&gt;43 %LET _SASPROGRAMFILE=;&lt;BR /&gt;44 %LET _SASPROGRAMFILEHOST=;&lt;BR /&gt;2 The SAS System 03:02 Tuesday, November 27, 2018&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;______________________________&lt;BR /&gt;22&lt;BR /&gt;200&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, ), *, **, +, ',', -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;&amp;lt;, &amp;gt;=, AND, EQ, GE,&lt;BR /&gt;GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.&lt;/P&gt;&lt;P&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/P&gt;&lt;P&gt;45&lt;BR /&gt;46 ;*';*";*/;quit;run;&lt;BR /&gt;____&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;47 ODS _ALL_ CLOSE;&lt;BR /&gt;48&lt;BR /&gt;49&lt;BR /&gt;50 QUIT; RUN;&lt;BR /&gt;51&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 09:14:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/516253#M3110</guid>
      <dc:creator>Bhargavi221</dc:creator>
      <dc:date>2018-11-27T09:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help! Need to send excel attachments dynamically to respected email</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/516323#M3120</link>
      <description>&lt;P&gt;This should work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
format partnos attach $1000.;
do until(last.manager);
set demo;
by manager manager_email;
attach=catx(" ",attach,quote(strip(attachment)));
partnos=catx(' ',partnos,part);
end;
call execute(cat('%email_out(to=',quote(strip(manager_email)),', subject=',strip(partnos),', attach=',strip(attach),')'));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Make sure the value inside the CALL EXECUTE is resolved as required.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 14:48:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-Help-Need-to-send-excel-attachments-dynamically-to/m-p/516323#M3120</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-11-27T14:48:08Z</dc:date>
    </item>
  </channel>
</rss>

