<?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 New files in automail in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/New-files-in-automail/m-p/740439#M29058</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to send out an automail with a file from a folder from my computer.&lt;/P&gt;
&lt;P&gt;the file will have this name :&amp;nbsp;&lt;/P&gt;
&lt;P class="xmsonormal"&gt;&lt;STRONG&gt;test-test-covid19-DDMMYYYY-xxxx&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="xmsonormal"&gt;&lt;STRONG&gt;where XXXX will be NEW numbers/letters everyday - how can I make a macro that will generate the new file name with the new XXXX everyday without me manually put it in&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 11 May 2021 12:12:41 GMT</pubDate>
    <dc:creator>mmea</dc:creator>
    <dc:date>2021-05-11T12:12:41Z</dc:date>
    <item>
      <title>New files in automail</title>
      <link>https://communities.sas.com/t5/New-SAS-User/New-files-in-automail/m-p/740439#M29058</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to send out an automail with a file from a folder from my computer.&lt;/P&gt;
&lt;P&gt;the file will have this name :&amp;nbsp;&lt;/P&gt;
&lt;P class="xmsonormal"&gt;&lt;STRONG&gt;test-test-covid19-DDMMYYYY-xxxx&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="xmsonormal"&gt;&lt;STRONG&gt;where XXXX will be NEW numbers/letters everyday - how can I make a macro that will generate the new file name with the new XXXX everyday without me manually put it in&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 12:12:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/New-files-in-automail/m-p/740439#M29058</guid>
      <dc:creator>mmea</dc:creator>
      <dc:date>2021-05-11T12:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: New files in automail</title>
      <link>https://communities.sas.com/t5/New-SAS-User/New-files-in-automail/m-p/740542#M29079</link>
      <description>&lt;P&gt;Before you can create a macro program, you need to create a program that works manually.&lt;/P&gt;
&lt;P&gt;Have you already created it? If you have a program, we can advise you on how to make a macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, is XXXX a sequential number?&lt;/P&gt;
&lt;P&gt;This can be done by recording the numbers in an external file or permanent data set.&lt;/P&gt;
&lt;P&gt;Each time you run the program, you can read the number and overwrite it with +1.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;For example, the following program will store a sequential number starting from 0001 in the macro variable "XXXX" every time it is executed.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if %sysfunc(exist(lib.covid))=0 %then %do;
  data lib.covid;
    cnt=0;
  run;
%end; 

data lib.covid;
  set lib.covid;
  cnt=cnt+1;
  call symputx('XXXX',put(cnt,z4.));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The last step is to execute the program in batches.&lt;/P&gt;
&lt;P&gt;If you are using Windows, you can register the following command in the task scheduler.&lt;/P&gt;
&lt;PRE&gt;"C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -sysin "C:\temp\yourprogram.sas"&lt;/PRE&gt;
&lt;P&gt;-sysin is the command to batch submit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 16:44:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/New-files-in-automail/m-p/740542#M29079</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-05-11T16:44:00Z</dc:date>
    </item>
  </channel>
</rss>

