<?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: Filtre on date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Filtre-on-date/m-p/717586#M221938</link>
    <description>&lt;P&gt;We need much more info tu understand/help.&lt;/P&gt;
&lt;P&gt;Were is your data located?&lt;/P&gt;
&lt;P&gt;Looks like in your saswork, but is that on your local computer or remote (what specs does your PC/server have).&lt;/P&gt;
&lt;P&gt;How large is the source data set?&lt;/P&gt;
&lt;P&gt;Please provide a log with options FULLSTIMER and MSGLEVEL=I set.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Feb 2021 15:12:12 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2021-02-08T15:12:12Z</dc:date>
    <item>
      <title>Filtre on date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtre-on-date/m-p/717581#M221933</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't run this code, it takes a long time. I'm wondering if my code is right. Thank you.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA TBT; 
set TBM; 
     (where=((D_VALO&amp;gt;='31DEC2019:00:00:00'dt)
                and (D_VALO &amp;lt;='31DEC2020:00:00:00'dt)));
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Feb 2021 14:57:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtre-on-date/m-p/717581#M221933</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2021-02-08T14:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Filtre on date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtre-on-date/m-p/717584#M221936</link>
      <description>&lt;P&gt;Can you show us a portion of the data set TBM, showing the variable D_VALO for a few records?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you say it is taking too long, how big is the data set?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What happens if you change the code to this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA TBT; 
set TBM /* Note I removed a semicolon here */
     (where=((D_VALO&amp;gt;='31DEC2019:00:00:00'dt)
                and (D_VALO &amp;lt;='31DEC2020:00:00:00'dt)));
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 15:09:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtre-on-date/m-p/717584#M221936</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-02-08T15:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Filtre on date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtre-on-date/m-p/717585#M221937</link>
      <description>&lt;P&gt;Try picking one of these:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;DATA TBT; 
/* where as a DATASET OPTION*/
set TBM  (where=((D_VALO&amp;gt;='31DEC2019:00:00:00'dt)
                and (D_VALO &amp;lt;='31DEC2020:00:00:00'dt)));
run; &lt;/LI-CODE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;DATA TBT; 
set TBM; 
/* Where statement*/
 where  (D_VALO&amp;gt;='31DEC2019:00:00:00'dt)
                and (D_VALO &amp;lt;='31DEC2020:00:00:00'dt);
run; &lt;/LI-CODE&gt;
&lt;P&gt;It shouldn't make much difference in run time by you can use a single comparison like&lt;/P&gt;
&lt;PRE&gt;'31DEC2019:00:00:00'dt &amp;lt;=  D_VALO  &amp;lt;= '31DEC2020:00:00:00'dt&lt;/PRE&gt;
&lt;P&gt;Which is at least a little easier to type and see the logic involved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How many records are in the TBM data set and how long is "too long"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 15:11:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtre-on-date/m-p/717585#M221937</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-08T15:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Filtre on date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtre-on-date/m-p/717586#M221938</link>
      <description>&lt;P&gt;We need much more info tu understand/help.&lt;/P&gt;
&lt;P&gt;Were is your data located?&lt;/P&gt;
&lt;P&gt;Looks like in your saswork, but is that on your local computer or remote (what specs does your PC/server have).&lt;/P&gt;
&lt;P&gt;How large is the source data set?&lt;/P&gt;
&lt;P&gt;Please provide a log with options FULLSTIMER and MSGLEVEL=I set.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 15:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtre-on-date/m-p/717586#M221938</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2021-02-08T15:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Filtre on date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtre-on-date/m-p/717587#M221939</link>
      <description>&lt;P&gt;One issue is your semi-colon placement on the SET statement. Your WHERE condition should be applied to the SET statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA TBT; 
set TBM (where=((D_VALO&amp;gt;='31DEC2019:00:00:00'dt)
                and (D_VALO &amp;lt;='31DEC2020:00:00:00'dt)));
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Alternatively, you could do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA TBT; 
set TBM; 
where D_VALO&amp;gt;='31DEC2019:00:00:00'dt and D_VALO &amp;lt;='31DEC2020:00:00:00'dt;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I don't really work with date literals like this, let alone date-time literals. Nor can I know if this works without some example data. If possible, post some reproducible code or data in a DATALINES statement.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 15:15:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtre-on-date/m-p/717587#M221939</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2021-02-08T15:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Filtre on date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtre-on-date/m-p/717662#M221965</link>
      <description>Thank you, the problem is that my data is very huge. &lt;BR /&gt;I'm wondering if there is another way to write the data step. When I'm using this code my programm is running the hours &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; Thank you !</description>
      <pubDate>Mon, 08 Feb 2021 17:24:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtre-on-date/m-p/717662#M221965</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2021-02-08T17:24:46Z</dc:date>
    </item>
  </channel>
</rss>

