<?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: Send Dynamically email to individual Person by SAS Code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Send-Dynamically-email-to-individual-Person-by-SAS-Code/m-p/841618#M332787</link>
    <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/17460"&gt;@ManoharNath&lt;/a&gt;&amp;nbsp;- First, review this excellent library article about sending email from SAS by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-send-email-using-SAS/ta-p/746523" target="_self"&gt;Tip: How to send email using SAS&lt;/A&gt; with particular emphasis on the section titled "Sending a customized message to multiple addresses". I've stolen the code from the macro used there as a starter for your solution.&amp;nbsp;The rest is just simple conditional programming. Here is a pseudo-code template to get you started:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; data _null_;
	set customer_list;
	array vids[6] video:;
	array vidlink[6] $400 _temporary_ 
		('Collection Stratigies: https://www.youtube.com/watch?v=6TK20Y5oD9s,
		 ... LIST THE REST OF THE LINKS AND DESCRIPTIONS HERE ...);
	FILE outbox
		to=(EMAIL_ADDRESS ) 
		subject="Your video links";
	Salutation =cats(catx(" ","Dear",first_name),',');
	put Salutation;
	put;
	put "Here are your video links:"; 
	do I=1 to dim(vids);
		if lowcase(vids[i])='yes' then
		put vidlink[i];
	end;
	put;
	put "All the best,";
	put "Me";
  run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;Mark&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 31 Oct 2022 12:18:14 GMT</pubDate>
    <dc:creator>SASJedi</dc:creator>
    <dc:date>2022-10-31T12:18:14Z</dc:date>
    <item>
      <title>Send Dynamically email to individual Person by SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Send-Dynamically-email-to-individual-Person-by-SAS-Code/m-p/841579#M332762</link>
      <description>&lt;P&gt;Hi Everyone, I need one help related to SAS automated email which send email to every other individuals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Task is : There is 6 unique segments of videos link and its description which need to be send to customers.&lt;/P&gt;
&lt;P&gt;suppose AAA customer is receiving 1&amp;nbsp; videos link and 1 video description and others can receive 2 or more videos link with its description for every customers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Others customers can not see others email, it has to be send to every individual or row wise.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;I appreciate the help and I am able to solve the problem and now I am getting only one problem.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;I can see video link and its description but for some customers whom we don't have videos, for that its resolving to "" and coming in email. I am looking to avoid this "" in email. can you please suggest how to overcome this problem&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;for 1st customer it have 1st segment video link and description and I am getting that information, but for rest segment it don't have video segment as expected and it has to be missing but getting "" "" "" this.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output I am getting:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Take a look at the short video&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF9900"&gt;&lt;STRONG&gt;Collections Strategies&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF9900"&gt;&lt;STRONG&gt;" " " " " " " " " "&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Now trying to avoid or compress this (&lt;FONT color="#FF9900"&gt;&lt;STRONG&gt;" " " " " " " " " ) from the email.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example;&lt;/P&gt;
&lt;P&gt;Link Desc: Collection Stratigies&lt;/P&gt;
&lt;P&gt;Link:&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=6TK20Y5oD9s" target="_blank" rel="noopener"&gt;https://www.youtube.com/watch?v=6TK20Y5oD9s&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;need help to write sas code which can send email to this customers dynamically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="92px"&gt;
&lt;P&gt;&lt;STRONG&gt;first_name&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="148px"&gt;
&lt;P&gt;&lt;STRONG&gt;EMAIL_ADDRESS&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;
&lt;P&gt;&lt;STRONG&gt;Video_segment1&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;
&lt;P&gt;&lt;STRONG&gt;Video_segment2&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;
&lt;P&gt;&lt;STRONG&gt;Video_segment3&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="86px"&gt;
&lt;P&gt;&lt;STRONG&gt;Video_segment4&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="86px"&gt;
&lt;P&gt;&lt;STRONG&gt;Video_segment5&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="86px"&gt;
&lt;P&gt;&lt;STRONG&gt;Video_segment6&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="92px"&gt;
&lt;P&gt;AAA&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="148px"&gt;
&lt;P&gt;&lt;U&gt;&lt;A href="mailto:AAA@COM" target="_blank" rel="noopener"&gt;AAA@COM&lt;/A&gt;&lt;/U&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;
&lt;P&gt;Yes&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="138px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="86px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="86px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="86px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="92px"&gt;
&lt;P&gt;BBB&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="148px"&gt;
&lt;P&gt;&lt;U&gt;&lt;A href="mailto:BBB@COM" target="_blank" rel="noopener"&gt;BBB@COM&lt;/A&gt;&lt;/U&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;
&lt;P&gt;Yes&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;
&lt;P&gt;yes&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="86px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="86px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="86px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="92px"&gt;
&lt;P&gt;CCC&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="148px"&gt;
&lt;P&gt;&lt;U&gt;&lt;A href="mailto:CCC@COM" target="_blank" rel="noopener"&gt;CCC@COM&lt;/A&gt;&lt;/U&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;
&lt;P&gt;Yes&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;
&lt;P&gt;yes&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;
&lt;P&gt;yes&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="86px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="86px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="86px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="92px"&gt;
&lt;P&gt;DDD&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="148px"&gt;
&lt;P&gt;&lt;U&gt;&lt;A href="mailto:DDD@COM" target="_blank" rel="noopener"&gt;DDD@COM&lt;/A&gt;&lt;/U&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;
&lt;P&gt;Yes&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="138px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="86px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="86px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="86px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="92px"&gt;
&lt;P&gt;EEE&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="148px"&gt;
&lt;P&gt;&lt;U&gt;&lt;A href="mailto:EEE@COM" target="_blank" rel="noopener"&gt;EEE@COM&lt;/A&gt;&lt;/U&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="138px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="138px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="86px"&gt;
&lt;P&gt;Yes&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="86px"&gt;
&lt;P&gt;yes&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="86px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="92px"&gt;
&lt;P&gt;FFF&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="148px"&gt;
&lt;P&gt;&lt;U&gt;&lt;A href="mailto:FFF@COM" target="_blank" rel="noopener"&gt;FFF@COM&lt;/A&gt;&lt;/U&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;
&lt;P&gt;Yes&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;
&lt;P&gt;Yes&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;
&lt;P&gt;Yes&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="86px"&gt;
&lt;P&gt;Yes&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="86px"&gt;
&lt;P&gt;Yes&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="86px"&gt;
&lt;P&gt;Yes&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="92px"&gt;
&lt;P&gt;GGG&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="148px"&gt;
&lt;P&gt;&lt;U&gt;&lt;A href="mailto:GGG@COM" target="_blank" rel="noopener"&gt;GGG@COM&lt;/A&gt;&lt;/U&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;
&lt;P&gt;Yes&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="86px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="86px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="86px"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Mon, 31 Oct 2022 19:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Send-Dynamically-email-to-individual-Person-by-SAS-Code/m-p/841579#M332762</guid>
      <dc:creator>ManoharNath</dc:creator>
      <dc:date>2022-10-31T19:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: Send Dynamically email to individual Person by SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Send-Dynamically-email-to-individual-Person-by-SAS-Code/m-p/841618#M332787</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/17460"&gt;@ManoharNath&lt;/a&gt;&amp;nbsp;- First, review this excellent library article about sending email from SAS by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-send-email-using-SAS/ta-p/746523" target="_self"&gt;Tip: How to send email using SAS&lt;/A&gt; with particular emphasis on the section titled "Sending a customized message to multiple addresses". I've stolen the code from the macro used there as a starter for your solution.&amp;nbsp;The rest is just simple conditional programming. Here is a pseudo-code template to get you started:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; data _null_;
	set customer_list;
	array vids[6] video:;
	array vidlink[6] $400 _temporary_ 
		('Collection Stratigies: https://www.youtube.com/watch?v=6TK20Y5oD9s,
		 ... LIST THE REST OF THE LINKS AND DESCRIPTIONS HERE ...);
	FILE outbox
		to=(EMAIL_ADDRESS ) 
		subject="Your video links";
	Salutation =cats(catx(" ","Dear",first_name),',');
	put Salutation;
	put;
	put "Here are your video links:"; 
	do I=1 to dim(vids);
		if lowcase(vids[i])='yes' then
		put vidlink[i];
	end;
	put;
	put "All the best,";
	put "Me";
  run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;Mark&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 12:18:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Send-Dynamically-email-to-individual-Person-by-SAS-Code/m-p/841618#M332787</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2022-10-31T12:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Send Dynamically email to individual Person by SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Send-Dynamically-email-to-individual-Person-by-SAS-Code/m-p/841662#M332814</link>
      <description>&lt;P&gt;I appreciate the help and I am able to solve the problem and now I am getting only one problem.&lt;BR /&gt;I can see video link and its description but for some customers whom we don't have videos, for that its resolving to "" and coming in email. I am looking to avoid this "" in email. can you please suggest how to overcome this problem&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for 1st customer it have 1st segment video link and description and I am getting that information, but for rest segment it don't have video segment as expected and it has to be missing but getting "" "" "" this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output I am getting:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Take a look at the short video&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF9900"&gt;&lt;STRONG&gt;Collections Strategies&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF9900"&gt;&lt;STRONG&gt;" " " " " " " " " "&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Now trying to avoid or compress this (&lt;FONT color="#FF9900"&gt;&lt;STRONG&gt;" " " " " " " " " ) from the email.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 15:00:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Send-Dynamically-email-to-individual-Person-by-SAS-Code/m-p/841662#M332814</guid>
      <dc:creator>ManoharNath</dc:creator>
      <dc:date>2022-10-31T15:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Send Dynamically email to individual Person by SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Send-Dynamically-email-to-individual-Person-by-SAS-Code/m-p/846020#M334459</link>
      <description>&lt;P&gt;Once again, I'd suggest conditional coding for that line of the email. For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	if find(lowcase(cats(of vids[*])), 'yes') then do;
		put "Here are your video links:"; 
		do I=1 to dim(vids);
			if lowcase(vids[i])='yes' then
			put vidlink[i];
		end;
	end;
	else put "You have no videos to view";
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Mark&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 20:33:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Send-Dynamically-email-to-individual-Person-by-SAS-Code/m-p/846020#M334459</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2022-11-23T20:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Send Dynamically email to individual Person by SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Send-Dynamically-email-to-individual-Person-by-SAS-Code/m-p/846369#M334603</link>
      <description>&lt;P&gt;Sorry for delay in response and thank you everyone for your revert.&lt;/P&gt;
&lt;P&gt;I was able to solve the prolem by using %if and %len method.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This resolved the problem.&lt;/P&gt;
&lt;P&gt;%if %length(&lt;STRONG&gt;Video_segment1) &amp;gt; 0 %then %do;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%put &amp;amp;Video_segment1.;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%put &amp;amp;Video_Desc.;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2022 19:38:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Send-Dynamically-email-to-individual-Person-by-SAS-Code/m-p/846369#M334603</guid>
      <dc:creator>ManoharNath</dc:creator>
      <dc:date>2022-11-25T19:38:19Z</dc:date>
    </item>
  </channel>
</rss>

