<?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: Freq in SAS Email in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Freq-in-SAS-Email/m-p/758121#M239351</link>
    <description>&lt;P&gt;If it were me, I would not try to put the Freq results in the body of the email.&amp;nbsp; If the Freq results are plain text (as in an old .lst file), who knows what font the recipient's email will be displayed in?&amp;nbsp; The results could be so misaligned as to be unreadable.&amp;nbsp; If the results are HTML, you could try it and see if it works, but I would think that simply attaching the Freq results would be more reliable.&amp;nbsp; Again, it's difficult to know what a recipient's email system will do with an email that is part plain-text and part HTML.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
    <pubDate>Thu, 29 Jul 2021 15:06:15 GMT</pubDate>
    <dc:creator>jimbarbour</dc:creator>
    <dc:date>2021-07-29T15:06:15Z</dc:date>
    <item>
      <title>Freq in SAS Email</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Freq-in-SAS-Email/m-p/758109#M239347</link>
      <description>&lt;P&gt;Hi Everyone - I have this preview code from SAS EG with the result shown below. I prefer to send email via SAS (includes 2 excel attachments) and in the body of email I want to include the last cumulative frequency (20726) along with the message. Right now, I type the number in email and attach those two excel files manually. It will make my life a little easier if I can at least automate this process by sending email directly. I have this sample email code and would like to add the number somewhere in data step. Is this even doable or I'm over complicating the idea? Any help or suggestions would be greatly appreciated. Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE VIEW WORK.SORT AS&lt;BR /&gt;SELECT Prod_NM&lt;BR /&gt;FROM WORK.QUERY_FOR_DUPLICATEREMOVAL_0000 as T&lt;BR /&gt;;&lt;BR /&gt;QUIT;&lt;/P&gt;
&lt;P&gt;TITLE;&lt;BR /&gt;TITLE1 "One-Way Frequencies";&lt;BR /&gt;TITLE2 "Results";&lt;BR /&gt;FOOTNOTE;&lt;BR /&gt;FOOTNOTE1 "Generated by the SAS System (&amp;amp;_SASSERVERNAME, &amp;amp;SYSSCPL) on %TRIM(%QSYSFUNC(DATE(), NLDATE20.)) at %TRIM(%SYSFUNC(TIME(), TIMEAMPM12.))";&lt;BR /&gt;PROC FREQ DATA=WORK.SORT&lt;BR /&gt;ORDER=INTERNAL&lt;BR /&gt;;&lt;BR /&gt;TABLES Prod_NM / NOPERCENT SCORES=TABLE;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;Prod_NM Frequency Cumulative Frequency&lt;BR /&gt;Prod1 23 23&lt;BR /&gt;Prod2 6322 6345&lt;BR /&gt;Prod3 40 6385&lt;BR /&gt;Prod4 5673 12058&lt;BR /&gt;Prod5 49 12107&lt;BR /&gt;Prod6 1861 13968&lt;BR /&gt;Prod7 875 14843&lt;BR /&gt;Prod8 4330 19173&lt;BR /&gt;Prod9 1553 20726&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let Todays_Date = %sysfunc(date(), date9.);&lt;BR /&gt;%let Attachment_File = "/sasdata/Tracking.xlsx";&lt;BR /&gt;%let Attachment_Type= "application/xlsx";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options emailsys=xxxxx emailhost=xxxx.com emailport=222;&lt;BR /&gt;filename MailBox email &lt;BR /&gt;to = ( "bbb.aaa@zzz.com")&lt;BR /&gt;&lt;BR /&gt;from = "bbb.aaa@zzz.com"&lt;BR /&gt;subject = "Tracking - &amp;amp;Todays_Date."&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;file MailBox;&lt;BR /&gt;put '!EM_ATTACH! (&amp;amp;attachment_File. content_type=&amp;amp;attachment_Type.)';&lt;BR /&gt;put 'Hey,';&lt;BR /&gt;put ' ';&lt;BR /&gt;put "Attached is the tracking report.";&lt;BR /&gt;put ' ';&lt;BR /&gt;put 'Let us know if you have any questions';&lt;BR /&gt;put ' ';&lt;BR /&gt;put ' ';&lt;BR /&gt;put '-Mmmmmm';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 14:37:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Freq-in-SAS-Email/m-p/758109#M239347</guid>
      <dc:creator>sasuser_sk</dc:creator>
      <dc:date>2021-07-29T14:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Freq in SAS Email</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Freq-in-SAS-Email/m-p/758121#M239351</link>
      <description>&lt;P&gt;If it were me, I would not try to put the Freq results in the body of the email.&amp;nbsp; If the Freq results are plain text (as in an old .lst file), who knows what font the recipient's email will be displayed in?&amp;nbsp; The results could be so misaligned as to be unreadable.&amp;nbsp; If the results are HTML, you could try it and see if it works, but I would think that simply attaching the Freq results would be more reliable.&amp;nbsp; Again, it's difficult to know what a recipient's email system will do with an email that is part plain-text and part HTML.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 15:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Freq-in-SAS-Email/m-p/758121#M239351</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-07-29T15:06:15Z</dc:date>
    </item>
  </channel>
</rss>

