<?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: DATETIME22.3 to yyyy-mm-dd time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128897#M26312</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;We use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; picture mydt low-high='%Y-%0m-%0dT%0H:%0M:%0S' (datatype=datetime);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then job put the value using that format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Oct 2013 18:56:20 GMT</pubDate>
    <dc:creator>OS2Rules</dc:creator>
    <dc:date>2013-10-30T18:56:20Z</dc:date>
    <item>
      <title>DATETIME22.3 to yyyy-mm-dd time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128893#M26308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to convert a date column that has value like 21JUN2013:00:00:00.000 to 2013-06-21 00:00:00.000?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 16:17:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128893#M26308</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2013-10-30T16:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME22.3 to yyyy-mm-dd time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128894#M26309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;b=put(input(substr(a,1,9),date9.),yymmdd10.)||substr(a,11);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 17:28:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128894#M26309</guid>
      <dc:creator>sandyming</dc:creator>
      <dc:date>2013-10-30T17:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME22.3 to yyyy-mm-dd time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128895#M26310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the data type is num and format and informat are datetime22.3&lt;/P&gt;&lt;P&gt;The above string doesnt seem to work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 17:39:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128895#M26310</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2013-10-30T17:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME22.3 to yyyy-mm-dd time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128896#M26311</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;Is the following what you want?:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;char_dt=cat(put(datepart(num_dt),yymmdd10.),' ',put(timepart(num_dt),time12.3));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 18:18:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128896#M26311</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2013-10-30T18:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME22.3 to yyyy-mm-dd time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128897#M26312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;We use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; picture mydt low-high='%Y-%0m-%0dT%0H:%0M:%0S' (datatype=datetime);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then job put the value using that format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 18:56:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128897#M26312</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2013-10-30T18:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME22.3 to yyyy-mm-dd time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128898#M26313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/24/621.html" title="http://support.sas.com/kb/24/621.html"&gt;24621 - Create custom datetime format using PROC FORMAT with PICTURE&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create your own format, change the / in the code to - I think.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 19:00:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128898#M26313</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-10-30T19:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME22.3 to yyyy-mm-dd time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128899#M26314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PROC FORMAT with PICTURE and DATETIME directive is a good option, but does not seem to provide a method for displaying the decimal portion of the seconds.&amp;nbsp; Except for Amir's solution, is there a way to get PROC FORMAT to display the decimal portion of the seconds?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An enhancement to Amir's solution (the time. format does not include leading zeroes on the Hour).&lt;/P&gt;&lt;P&gt;char_dt = cat(put(datepart(num_dt),yymmdd10.),' ',translate(put(timepart(num_dt),time12.3),'0',' '));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2013 14:33:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128899#M26314</guid>
      <dc:creator>advoss</dc:creator>
      <dc:date>2013-11-01T14:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME22.3 to yyyy-mm-dd time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128900#M26315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have SAS 9.3 or newer then you can use %s directive for fractional seconds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc format;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; picture mydt low-high='%Y-%0m-%0d %0H:%0M:%0s' (datatype=datetime);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2013 15:11:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128900#M26315</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-11-01T15:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME22.3 to yyyy-mm-dd time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128901#M26316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unless there is a hotfix for SAS 9.3, the %s directive doesn't appear to be available until SAS 9.4.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2013 16:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128901#M26316</guid>
      <dc:creator>advoss</dc:creator>
      <dc:date>2013-11-01T16:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME22.3 to yyyy-mm-dd time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128902#M26317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works fine in 9.3 TS1M2 (it doesn't zero pad properly, for some reason, though).&amp;nbsp; You need the decimal in the used part (and at least in 9.3 it only gives 2 places, not 4).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; picture mydt low-high='%Y-%0m-%0d %0H:%0M:%0s' (datatype=datetime);&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;data _test_;&lt;/P&gt;&lt;P&gt;now = datetime()+.05156;&lt;/P&gt;&lt;P&gt;put now= mydt.4;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2013 16:33:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128902#M26317</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2013-11-01T16:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME22.3 to yyyy-mm-dd time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128903#M26318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am seeing the missing leading zero with SAS 9.3 (TS1M2). I do not have 9.4 to test if it is fixed in that version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;25&amp;nbsp;&amp;nbsp; data _test_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;26&amp;nbsp;&amp;nbsp; now = dhms(today(),1,2,3.05156);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;27&amp;nbsp;&amp;nbsp; put now= mydt23.3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;28&amp;nbsp;&amp;nbsp; put now= mydt19.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;29&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;now=2013-11-01 01:02: 3.052&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;now=2013-11-01 01:02: 3&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2013 16:57:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128903#M26318</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-11-01T16:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME22.3 to yyyy-mm-dd time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128904#M26319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I stand corrected on the SAS 9.3 issue.&amp;nbsp; lowercase %0s directive works to provide decimals, but does not have leading 0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2013 17:09:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128904#M26319</guid>
      <dc:creator>advoss</dc:creator>
      <dc:date>2013-11-01T17:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME22.3 to yyyy-mm-dd time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128905#M26320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="active_link" href="http://support.sas.com/kb/47/182.html" style="font-size: 10pt; line-height: 1.5em;" title="http://support.sas.com/kb/47/182.html"&gt;47182 - Adding a leading zero to the %s directive in a PICTURE statement in PROC FORMAT does not insert a leading zero as documented&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nope, not fixed (I tested in 9.4).&amp;nbsp; Surprised it hasn't been yet, it's been 3 months since it was reported...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2013 17:44:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/128905#M26320</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2013-11-01T17:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME22.3 to yyyy-mm-dd time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/328061#M73225</link>
      <description>&lt;P&gt;I&amp;nbsp;had a lab date like this inside this variable "&lt;SPAN&gt;llab_dt_int&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;16SEP2015:00:00:00.000&lt;/P&gt;&lt;P&gt;and wanted&lt;/P&gt;&lt;P&gt;2015-09-16T00:00:00&lt;/P&gt;&lt;P&gt;... so similar to yours, I found this worked - where time is 00:00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;attrib blah format=$25.;&lt;/P&gt;&lt;P&gt;blah=strip(put(datepart(llab_dt_int),yymmdd10.))||'T00:00:00';&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 16:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/328061#M73225</guid>
      <dc:creator>SASuserAtPharma</dc:creator>
      <dc:date>2017-01-27T16:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME22.3 to yyyy-mm-dd time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/331817#M74633</link>
      <description>&lt;P&gt;Thanks everyone for all your suggestions. &amp;nbsp;With your help, I finally figured this out and have copied the code in the attached word file. &amp;nbsp;rfortin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2017 14:17:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/331817#M74633</guid>
      <dc:creator>rfortin</dc:creator>
      <dc:date>2017-02-11T14:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: DATETIME22.3 to yyyy-mm-dd time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/331886#M74661</link>
      <description>&lt;P&gt;I want to apologize for my last post. &amp;nbsp; I mistakenly responded to this threaded topic that was similar to one I had posted. &amp;nbsp; rfortin&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2017 23:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATETIME22-3-to-yyyy-mm-dd-time/m-p/331886#M74661</guid>
      <dc:creator>rfortin</dc:creator>
      <dc:date>2017-02-11T23:12:12Z</dc:date>
    </item>
  </channel>
</rss>

