<?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: how to select a given file with select if there is date in the name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-select-a-given-file-with-select-if-there-is-date-in-the/m-p/771578#M244884</link>
    <description>&lt;P&gt;Yes, I think this is possible, but I have some questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(1) Do the files have the same naming convention (e.g., "BH_D_ZAB_X_ALOK")?&lt;/P&gt;
&lt;P&gt;(2) Are the files in this directory the same kind of file? Or are there other files in the directory that don't contain the same information?&lt;/P&gt;
&lt;P&gt;(3) Do you only want the most recent file for the given month/year? Or do you want all files that have the current month?&lt;/P&gt;</description>
    <pubDate>Fri, 01 Oct 2021 13:06:16 GMT</pubDate>
    <dc:creator>maguiremq</dc:creator>
    <dc:date>2021-10-01T13:06:16Z</dc:date>
    <item>
      <title>how to select a given file with select if there is date in the name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-select-a-given-file-with-select-if-there-is-date-in-the/m-p/771576#M244883</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gieorgie_0-1633092903149.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64292iE3CAA53E8C3C648E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gieorgie_0-1633092903149.png" alt="Gieorgie_0-1633092903149.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As above, I have tables, each is uploaded monthly after the year and date 20203, eg Is it possible to select a file automatically, e.g. if it is September, it will select a file from September in select or you have to do it manually in the code each time.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 12:58:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-select-a-given-file-with-select-if-there-is-date-in-the/m-p/771576#M244883</guid>
      <dc:creator>Gieorgie</dc:creator>
      <dc:date>2021-10-01T12:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to select a given file with select if there is date in the name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-select-a-given-file-with-select-if-there-is-date-in-the/m-p/771578#M244884</link>
      <description>&lt;P&gt;Yes, I think this is possible, but I have some questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(1) Do the files have the same naming convention (e.g., "BH_D_ZAB_X_ALOK")?&lt;/P&gt;
&lt;P&gt;(2) Are the files in this directory the same kind of file? Or are there other files in the directory that don't contain the same information?&lt;/P&gt;
&lt;P&gt;(3) Do you only want the most recent file for the given month/year? Or do you want all files that have the current month?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 13:06:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-select-a-given-file-with-select-if-there-is-date-in-the/m-p/771578#M244884</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2021-10-01T13:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to select a given file with select if there is date in the name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-select-a-given-file-with-select-if-there-is-date-in-the/m-p/771580#M244886</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/401093"&gt;@Gieorgie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As above, I have tables, each is uploaded monthly after the year and date 20203, eg Is it possible to select a file automatically, e.g. if it is September, it will select a file from September in select or you have to do it manually in the code each time.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do you really mean: "if it is September &lt;FONT color="#FF0000"&gt;2021&lt;/FONT&gt;, it will select the file from September &lt;FONT color="#FF0000"&gt;2021&lt;/FONT&gt;"??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, then this will work to create a macro variable &amp;amp;thismonth with the value 202110, since today is October 1, 2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let thismonth=%sysfunc(putn(%sysfunc(today()),yymmn6.));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;so you would want to use the data set named&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;BH_D_ZAB_X_ALOK_&amp;amp;thismonth&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 13:10:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-select-a-given-file-with-select-if-there-is-date-in-the/m-p/771580#M244886</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-10-01T13:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to select a given file with select if there is date in the name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-select-a-given-file-with-select-if-there-is-date-in-the/m-p/771582#M244887</link>
      <description>You are best ! have a nice weekend</description>
      <pubDate>Fri, 01 Oct 2021 13:18:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-select-a-given-file-with-select-if-there-is-date-in-the/m-p/771582#M244887</guid>
      <dc:creator>Gieorgie</dc:creator>
      <dc:date>2021-10-01T13:18:18Z</dc:date>
    </item>
  </channel>
</rss>

