<?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: converting char to num not working in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/converting-char-to-num-not-working/m-p/167173#M43285</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;fmttime = input(time, time8.);&lt;/P&gt;&lt;P&gt;This will create a time value that can be manipulated with the time functions such as INTNX or INTCK and a format of time8. would display as a time value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your attempts failed because the f8. format can't handle :&lt;/P&gt;&lt;P&gt;the multiple failed because it can't handle : either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Aug 2014 16:58:13 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2014-08-19T16:58:13Z</dc:date>
    <item>
      <title>converting char to num not working</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/converting-char-to-num-not-working/m-p/167172#M43284</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;Please forgive this newbie question.&amp;nbsp; I have looked online extensively and have not been able to solve it.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a variable, 'time', that contains timestamps that look like this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;0:00:01&lt;/P&gt;&lt;P&gt;0:00:16&lt;/P&gt;&lt;P&gt;15:53:46&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This variable is currently in character format ($8).&amp;nbsp; I have tried the recommended tricks to convert it to numeric. Here are some examples of what I have tried:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data file1; set file;&lt;/P&gt;&lt;P&gt;infile ".........";&lt;/P&gt;&lt;P&gt;input time $8;&lt;/P&gt;&lt;P&gt;fmttime=input(time,8.);&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 file1; set file;&lt;/P&gt;&lt;P&gt;fmttime=time * 1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data file1; set file;&lt;/P&gt;&lt;P&gt;fmttime=put(time,12.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;None of these are working. How would others go about doing this conversion? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2014 16:20:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/converting-char-to-num-not-working/m-p/167172#M43284</guid>
      <dc:creator>grayab</dc:creator>
      <dc:date>2014-08-19T16:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: converting char to num not working</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/converting-char-to-num-not-working/m-p/167173#M43285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;fmttime = input(time, time8.);&lt;/P&gt;&lt;P&gt;This will create a time value that can be manipulated with the time functions such as INTNX or INTCK and a format of time8. would display as a time value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your attempts failed because the f8. format can't handle :&lt;/P&gt;&lt;P&gt;the multiple failed because it can't handle : either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Aug 2014 16:58:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/converting-char-to-num-not-working/m-p/167173#M43285</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-08-19T16:58:13Z</dc:date>
    </item>
  </channel>
</rss>

