<?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: comparing date25.6 in SAS release: 9.04.01M4P11092016 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/comparing-date25-6-in-SAS-release-9-04-01M4P11092016/m-p/582210#M165564</link>
    <description>&lt;P&gt;Welcome to the SAS Community &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't see your data, but it seems like CREATE_TIMESTAMP is not a valid SAS date. Find out how this is constructed. If it is a datetime value, then use datepart like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cmarerr;
	set bcccparp.bcc_cmar_subm_event_details_err;
	where ERROR_TREASON like '%Patient Date of Birth is not valid%' and datepart(CREATE_TIMESTAMP) &amp;gt; '01AUG2019'd;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 19 Aug 2019 18:40:08 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-08-19T18:40:08Z</dc:date>
    <item>
      <title>comparing date25.6 in SAS release: 9.04.01M4P11092016</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comparing-date25-6-in-SAS-release-9-04-01M4P11092016/m-p/582207#M165561</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to filter out the records on the basis of a certain cutoff date i.e. I wish to create a subset of data after a certain date, let's say : 1st August 2019.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data cmarerr;&lt;BR /&gt;set bcccparp.bcc_cmar_subm_event_details_err;&lt;BR /&gt;where ERROR_TREASON like '%Patient Date of Birth is not valid%' and CREATE_TIMESTAMP &amp;gt; '01AUG2019'd;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;It produces No errors or warnings but the second condition of date doesn't seem to work as it doesn't filter out other previous entries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 18:30:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comparing-date25-6-in-SAS-release-9-04-01M4P11092016/m-p/582207#M165561</guid>
      <dc:creator>anunick</dc:creator>
      <dc:date>2019-08-19T18:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: comparing date25.6 in SAS release: 9.04.01M4P11092016</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comparing-date25-6-in-SAS-release-9-04-01M4P11092016/m-p/582209#M165563</link>
      <description>&lt;P&gt;Why are you comparing a variable with TIMESTAMP in its name to a DATE value instead of a DATETIME value?&lt;/P&gt;
&lt;P&gt;You are probably just limiting yourself to dates that are after about 6AM on first day in 1960.&lt;/P&gt;
&lt;PRE&gt;1209  data x ;
1210    x='01AUG2019'd;
1211    put x= datetime24.;
1212  run;

x=01JAN1960:06:02:42
&lt;/PRE&gt;
&lt;P&gt;Why not use a datetime literal instead?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;'01AUG2019:00:00'dt&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 18:40:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comparing-date25-6-in-SAS-release-9-04-01M4P11092016/m-p/582209#M165563</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-08-19T18:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: comparing date25.6 in SAS release: 9.04.01M4P11092016</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comparing-date25-6-in-SAS-release-9-04-01M4P11092016/m-p/582210#M165564</link>
      <description>&lt;P&gt;Welcome to the SAS Community &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't see your data, but it seems like CREATE_TIMESTAMP is not a valid SAS date. Find out how this is constructed. If it is a datetime value, then use datepart like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cmarerr;
	set bcccparp.bcc_cmar_subm_event_details_err;
	where ERROR_TREASON like '%Patient Date of Birth is not valid%' and datepart(CREATE_TIMESTAMP) &amp;gt; '01AUG2019'd;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Aug 2019 18:40:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comparing-date25-6-in-SAS-release-9-04-01M4P11092016/m-p/582210#M165564</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-08-19T18:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: comparing date25.6 in SAS release: 9.04.01M4P11092016</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comparing-date25-6-in-SAS-release-9-04-01M4P11092016/m-p/582229#M165572</link>
      <description>&lt;P&gt;Run Proc Contents on your data set bcccparp.bcc_cmar_subm_event_details_err and show us the type and format associated with your variable CREATE_TIMESTAMP&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The most likely issues I see are that your CREATE_TIMESTAMP&amp;nbsp;may be a datetime variable, which would require&lt;/P&gt;
&lt;P&gt;datepart(CREATE_TIMESTAMP) &amp;gt; '01AUG2019'd&lt;/P&gt;
&lt;P&gt;or may be a character variable and need conversion to either a date or datetime variable.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 19:33:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comparing-date25-6-in-SAS-release-9-04-01M4P11092016/m-p/582229#M165572</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-08-19T19:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: comparing date25.6 in SAS release: 9.04.01M4P11092016</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comparing-date25-6-in-SAS-release-9-04-01M4P11092016/m-p/582246#M165580</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked the column properties:&lt;/P&gt;&lt;P&gt;Length: 8&lt;/P&gt;&lt;P&gt;Type: Numeric&lt;/P&gt;&lt;P&gt;Format: DATETIME25.6&lt;/P&gt;&lt;P&gt;InFormat:&amp;nbsp;DATETIME25.6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E.g. of one of the entries in SAS dataset:&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;18AUG2019:01:08:21.000000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Anuvrat&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 20:11:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comparing-date25-6-in-SAS-release-9-04-01M4P11092016/m-p/582246#M165580</guid>
      <dc:creator>anunick</dc:creator>
      <dc:date>2019-08-19T20:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: comparing date25.6 in SAS release: 9.04.01M4P11092016</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comparing-date25-6-in-SAS-release-9-04-01M4P11092016/m-p/582251#M165582</link>
      <description>&lt;P&gt;So your variable does have datetime values (number of seconds since 1960) and not date values (number of days since 1960).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just remember to compare to the proper type of number.&amp;nbsp; So either use datetime literals or use the DATEPART() function to convert the number of seconds your variable has into number of days and then you can compare to date values.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 20:22:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comparing-date25-6-in-SAS-release-9-04-01M4P11092016/m-p/582251#M165582</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-08-19T20:22:13Z</dc:date>
    </item>
  </channel>
</rss>

