<?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 AM/PM to military time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/AM-PM-to-military-time/m-p/317812#M287519</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to convert AM/PM into military time. I've looked through past&amp;nbsp;inquiries into this and the code is not working for me. As a couple of examples, the times are 7:00 AM and 5:55 AM. They are currently stored as character variables and the format that they are currently in is $9. Here's the code that I've been trying to get working:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data psqi3;&lt;BR /&gt;set psqi;&lt;BR /&gt;up_time=input(up_time, TIME8.);&lt;BR /&gt;format up_time time8.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1065&lt;BR /&gt;1066 data psqi3;&lt;BR /&gt;1067 set psqi;&lt;BR /&gt;1068 up_time=input(up_time, TIME8.);&lt;BR /&gt;1069 format up_time time8.;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;------&lt;BR /&gt;48&lt;BR /&gt;ERROR 48-59: The format $TIME was not found or could not be loaded.&lt;/P&gt;&lt;P&gt;1070 run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any thoughts on what I'm doing wrong here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 09 Dec 2016 06:37:17 GMT</pubDate>
    <dc:creator>chavens</dc:creator>
    <dc:date>2016-12-09T06:37:17Z</dc:date>
    <item>
      <title>AM/PM to military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AM-PM-to-military-time/m-p/317812#M287519</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to convert AM/PM into military time. I've looked through past&amp;nbsp;inquiries into this and the code is not working for me. As a couple of examples, the times are 7:00 AM and 5:55 AM. They are currently stored as character variables and the format that they are currently in is $9. Here's the code that I've been trying to get working:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data psqi3;&lt;BR /&gt;set psqi;&lt;BR /&gt;up_time=input(up_time, TIME8.);&lt;BR /&gt;format up_time time8.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1065&lt;BR /&gt;1066 data psqi3;&lt;BR /&gt;1067 set psqi;&lt;BR /&gt;1068 up_time=input(up_time, TIME8.);&lt;BR /&gt;1069 format up_time time8.;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;------&lt;BR /&gt;48&lt;BR /&gt;ERROR 48-59: The format $TIME was not found or could not be loaded.&lt;/P&gt;&lt;P&gt;1070 run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any thoughts on what I'm doing wrong here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2016 06:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AM-PM-to-military-time/m-p/317812#M287519</guid>
      <dc:creator>chavens</dc:creator>
      <dc:date>2016-12-09T06:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: AM/PM to military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AM-PM-to-military-time/m-p/317814#M287520</link>
      <description>&lt;P&gt;You can't use the same variable Name, you need to create a new variable to hold the numeric value of time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise it should work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is because you can't change a variable type in SAS.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2016 06:58:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AM-PM-to-military-time/m-p/317814#M287520</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-09T06:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: AM/PM to military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AM-PM-to-military-time/m-p/317815#M287521</link>
      <description>&lt;P&gt;You input is defined as $9 then try&amp;nbsp;&lt;SPAN&gt;up_time=input(up_time, TIME&lt;STRONG&gt;9&lt;/STRONG&gt;.);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have run next code as test :&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;data _NULL_;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;length tmx $9;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tmx = '7:30 PM';&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tm = input(tmx, time9.);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;put tm time5.;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;log showed: 19:30&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2016 06:58:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AM-PM-to-military-time/m-p/317815#M287521</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-12-09T06:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: AM/PM to military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AM-PM-to-military-time/m-p/317816#M287522</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;is right.&lt;/P&gt;
&lt;P&gt;The cause to error is not the length.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2016 07:02:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AM-PM-to-military-time/m-p/317816#M287522</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-12-09T07:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: AM/PM to military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/AM-PM-to-military-time/m-p/317817#M287523</link>
      <description>Right. Fixing that silly error fixed it. Thanks.</description>
      <pubDate>Fri, 09 Dec 2016 07:18:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/AM-PM-to-military-time/m-p/317817#M287523</guid>
      <dc:creator>chavens</dc:creator>
      <dc:date>2016-12-09T07:18:54Z</dc:date>
    </item>
  </channel>
</rss>

