<?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 read file with date stamp for previous day if today's file is missing/not available in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/793651#M32765</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was talking about datasets (also excel files). With macro date $Date function datasets are created or read. However I am re-thinking as it is not straightforward because I realize that some days files are missing or date gap, so I can leave as is for now.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you all for offering support&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jan 2022 23:55:04 GMT</pubDate>
    <dc:creator>bijayadhikar</dc:creator>
    <dc:date>2022-01-31T23:55:04Z</dc:date>
    <item>
      <title>How to read file with date stamp for previous day if today's file is missing/not available</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/790924#M32552</link>
      <description>&lt;P&gt;Is there a way to read file with date stamp for previous day if today's file is missing/not available? I do read file with date with date stamp with macro code as below for current day (or day's file). It does work whether to read to day's file or any previous day (with subtraction in date). However, my question is: how to read yesterday's file &lt;STRONG&gt;IF&lt;/STRONG&gt; today's file is missing/not exist.&lt;/P&gt;
&lt;P&gt;This is a Unix environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let Date = %sysfunc(date(),Date9.);&lt;BR /&gt;%put &amp;amp;Date;&lt;BR /&gt;libname dat '/.........../folder_name';&lt;/P&gt;
&lt;P&gt;data new;&lt;BR /&gt;set dat._&amp;amp;Date._merged_line_list;&amp;nbsp;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 15:47:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/790924#M32552</guid>
      <dc:creator>bijayadhikar</dc:creator>
      <dc:date>2022-01-19T15:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to read file with date stamp for previous day if today's file is missing/not available</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/790927#M32553</link>
      <description>&lt;P&gt;What if neither dataset exists?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 15:54:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/790927#M32553</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-19T15:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to read file with date stamp for previous day if today's file is missing/not available</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/790934#M32556</link>
      <description>&lt;P&gt;Basic steps: Determine if the file exists. The SAS function FEXIST does this if used correctly for EXTERNAL files or EXIST to check on the existence of a SAS data set or view.&lt;/P&gt;
&lt;P&gt;If that does not exist then generate the name for the "previous day" file. Check if it exists.&lt;/P&gt;
&lt;P&gt;&amp;lt;Repeat as needed&amp;gt;&lt;/P&gt;
&lt;P&gt;When you have verified the file exist then process. If none of the desired files exist then write some output that says so and terminate that portion of your program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 16:12:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/790934#M32556</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-19T16:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to read file with date stamp for previous day if today's file is missing/not available</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/791141#M32577</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;good question, yes it is possible that someday a file may not be available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;Thank you for offering this logics. I will try to see if I can figure out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 13:58:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/791141#M32577</guid>
      <dc:creator>bijayadhikar</dc:creator>
      <dc:date>2022-01-20T13:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to read file with date stamp for previous day if today's file is missing/not available</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/791147#M32578</link>
      <description>&lt;P&gt;So could we rephrase your question as: read the latest dataset available, going back from a certain date (today)?&lt;/P&gt;
&lt;P&gt;Or should we, if neither today's and yesterday's dataset is available, issue an error message and terminate?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 14:04:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/791147#M32578</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-20T14:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to read file with date stamp for previous day if today's file is missing/not available</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/791198#M32585</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Exactly that's what I wanted. Read the latest file from a folder. File name structure is e.g. 19JAN2022_report&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 16:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/791198#M32585</guid>
      <dc:creator>bijayadhikar</dc:creator>
      <dc:date>2022-01-20T16:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to read file with date stamp for previous day if today's file is missing/not available</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/791242#M32589</link>
      <description>&lt;P&gt;A name that starts with a digit is not valid for SAS datasets; are we talking datasets or files?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 19:17:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/791242#M32589</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-20T19:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to read file with date stamp for previous day if today's file is missing/not available</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/793651#M32765</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was talking about datasets (also excel files). With macro date $Date function datasets are created or read. However I am re-thinking as it is not straightforward because I realize that some days files are missing or date gap, so I can leave as is for now.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you all for offering support&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 23:55:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/793651#M32765</guid>
      <dc:creator>bijayadhikar</dc:creator>
      <dc:date>2022-01-31T23:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to read file with date stamp for previous day if today's file is missing/not available</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/793661#M32766</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/346623"&gt;@bijayadhikar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;Exactly that's what I wanted. Read the latest file from a folder. File name structure is e.g. 19JAN2022_report&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Word of advice, do not use DATE (or MDY or DMY order ) style dates in filenames.&amp;nbsp; They will NOT sort properly.&lt;/P&gt;
&lt;P&gt;Use YMD order date strings in names.&amp;nbsp; Then the filenames will sort in chronological order.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 03:29:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/793661#M32766</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-02-01T03:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to read file with date stamp for previous day if today's file is missing/not available</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/793679#M32768</link>
      <description>&lt;P&gt;Excel files are&amp;nbsp;&lt;STRONG&gt;NOT&lt;/STRONG&gt;&amp;nbsp;SAS datasets.&lt;/P&gt;
&lt;P&gt;By defining a LIBNAME for an Excel file, it is possible to use spreadsheets in that file like datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So please describe in detail where you need to apply that date.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 07:21:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-read-file-with-date-stamp-for-previous-day-if-today-s/m-p/793679#M32768</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-01T07:21:06Z</dc:date>
    </item>
  </channel>
</rss>

