<?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: sas date and time in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114316#M6012</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know which SAS time format to use for this date and time column. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 17 Aug 2013 22:50:40 GMT</pubDate>
    <dc:creator>SASUserWhoNeedHelp</dc:creator>
    <dc:date>2013-08-17T22:50:40Z</dc:date>
    <item>
      <title>sas date and time</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114315#M6011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 323px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="17" width="323"&gt;Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;2013-07-05 00:10:52&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;2013-07-05 00:10:50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;2013-07-05 00:10:49&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;2013-07-04 22:04:44&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;2013-07-04 22:04:42&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;2013-07-04 22:04:39&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;2013-07-04 22:04:36&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;2013-07-04 22:04:34&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;2013-07-04 22:04:10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;2013-07-04 21:06:19&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to keep the rows with date and time after 2013-07-04 21:06:19 in SAS? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Aug 2013 22:35:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114315#M6011</guid>
      <dc:creator>SASUserWhoNeedHelp</dc:creator>
      <dc:date>2013-08-17T22:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: sas date and time</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114316#M6012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know which SAS time format to use for this date and time column. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Aug 2013 22:50:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114316#M6012</guid>
      <dc:creator>SASUserWhoNeedHelp</dc:creator>
      <dc:date>2013-08-17T22:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: sas date and time</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114317#M6013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are these numeric values (with a SAS format) or text?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Aug 2013 22:51:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114317#M6013</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2013-08-17T22:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: sas date and time</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114318#M6014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif'; color: #1f497d;"&gt;This column was&amp;nbsp; imported from Excel file, text only, $19..&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Aug 2013 22:54:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114318#M6014</guid>
      <dc:creator>SASUserWhoNeedHelp</dc:creator>
      <dc:date>2013-08-17T22:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: sas date and time</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114319#M6015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ideally, you should convert the text values to actual date values. However, something like the following should work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let mydate = 2013-07-04 21:06:19;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set your-file-name ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where date &amp;gt;= "&amp;amp;mydate";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Aug 2013 22:59:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114319#M6015</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2013-08-17T22:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: sas date and time</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114320#M6016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as you mentioned that the date time values are in text format(characters). It is important to convert them into numeric format to make them work in the if condition. and at the same time the date with which you are going to use as the condition (2013-07-04 21:06:19) should also be in numeric.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so please try the below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mydate=&amp;nbsp;&amp;nbsp;&amp;nbsp; input("2013-07-04 21:06:19",ANYDTDTM20.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput("mydate",mydate);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put &amp;amp;mydate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the above code will create the macro variable which youare going to use as the condition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the have dataset has the date times in text format, which i am converting into numeric format in another dataset, and passing the if condition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input date &amp;amp; $20.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;2013-07-05 00:10:52&lt;/P&gt;&lt;P&gt;2013-07-05 00:10:50&lt;/P&gt;&lt;P&gt;2013-07-05 00:10:49&lt;/P&gt;&lt;P&gt;2013-07-04 22:04:44&lt;/P&gt;&lt;P&gt;2013-07-04 22:04:42&lt;/P&gt;&lt;P&gt;2013-07-04 22:04:39&lt;/P&gt;&lt;P&gt;2013-07-04 22:04:36&lt;/P&gt;&lt;P&gt;2013-07-04 22:04:34&lt;/P&gt;&lt;P&gt;2013-07-04 22:04:10&lt;/P&gt;&lt;P&gt;2013-07-04 21:06:19&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ndate=input(date,ANYDTDTM20.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ndate datetime20.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if &amp;amp;mydate &amp;lt; ndate ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jagadish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Aug 2013 02:53:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114320#M6016</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2013-08-18T02:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: sas date and time</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114321#M6017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The text-based comparison should still work in this case, provided all of the dates have a consistent form (YYYY-MM-DD HH:MM:SS) and the where clause contains a text value that is in the same form. But, I agree, a date conversion is preferable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Aug 2013 03:14:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114321#M6017</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2013-08-18T03:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: sas date and time</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114322#M6018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, i believe text cannot be used to subset the condition especially when the subsetting condition is related to date time. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Aug 2013 03:18:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114322#M6018</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2013-08-18T03:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: sas date and time</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114323#M6019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The text comparison should work in this case (number-like). There are no letters that would mess it up (for example: JAN, AUG). The ASCII and EBCDIC collating sequences will both evaluate the comparison correctly, I believe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Aug 2013 03:39:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/sas-date-and-time/m-p/114323#M6019</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2013-08-18T03:39:59Z</dc:date>
    </item>
  </channel>
</rss>

