<?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: convert sas numeric time into sas time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/convert-sas-numeric-time-into-sas-time/m-p/830226#M328046</link>
    <description>&lt;P&gt;Create a&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p0n990vq8gxca6n1vnsracr6jp2c.htm" target="_blank" rel="noopener"&gt;PICTURE&lt;/A&gt;&amp;nbsp;format which adds the colons:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
picture colons
  low-high = '00:00:00'
;
run,&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;then use it in a PUT/INPUT:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
time = input(put(time,colons8.),time8.);
format time time8.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Untested, posted from my tablet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: after testing, changed the length of the COLONS format to 8 in the PUT function.&lt;/P&gt;</description>
    <pubDate>Thu, 25 Aug 2022 07:30:56 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-08-25T07:30:56Z</dc:date>
    <item>
      <title>convert sas numeric time into sas time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-sas-numeric-time-into-sas-time/m-p/830223#M328044</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Someone sent me a data set that contain a column called time.&lt;/P&gt;
&lt;P&gt;This column is numeric type ( no sas time/date) and have values of time .&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;value&amp;nbsp;145000&amp;nbsp; means hour:14&amp;nbsp; minutes: 50&amp;nbsp; second:00&amp;nbsp; ( so the format is HH:MM:SS).&lt;/P&gt;
&lt;P&gt;What is the way to convert it into SAS time format?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input time;
cards;
112800
145000
84800
204500
132500
130400
110800
123000
123400
90600
115600
101600
100800
73500
143000
104200
95900
100500
90300
120100
212900
104600
112700
153200
140300
24900
114000
160600
123800
101900
100800
202900
110500
75900
130000
231200
;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Aug 2022 05:21:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-sas-numeric-time-into-sas-time/m-p/830223#M328044</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-08-25T05:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: convert sas numeric time into sas time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-sas-numeric-time-into-sas-time/m-p/830226#M328046</link>
      <description>&lt;P&gt;Create a&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p0n990vq8gxca6n1vnsracr6jp2c.htm" target="_blank" rel="noopener"&gt;PICTURE&lt;/A&gt;&amp;nbsp;format which adds the colons:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
picture colons
  low-high = '00:00:00'
;
run,&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;then use it in a PUT/INPUT:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
time = input(put(time,colons8.),time8.);
format time time8.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Untested, posted from my tablet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: after testing, changed the length of the COLONS format to 8 in the PUT function.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 07:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-sas-numeric-time-into-sas-time/m-p/830226#M328046</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-08-25T07:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: convert sas numeric time into sas time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-sas-numeric-time-into-sas-time/m-p/830244#M328053</link>
      <description>&lt;P&gt;Alternatively, you can use the SAS-supplied &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/p09lpr3kmbh8fen1qepuv6zc1ldd.htm" target="_blank" rel="noopener"&gt;Z6. format&lt;/A&gt;&amp;nbsp;(to add the missing leading zero to values such as 84800) and &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n0tx8gqdnl4undn11upjn4les9k2.htm" target="_blank" rel="noopener"&gt;B8601TM. informat&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;FONT size="4"&gt;time=input(put(time,&lt;STRONG&gt;z6.&lt;/STRONG&gt;),&lt;STRONG&gt;b8601tm.&lt;/STRONG&gt;);
&lt;FONT color="#999999"&gt;format time time8.;
&lt;/FONT&gt;&lt;/FONT&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Aug 2022 08:23:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-sas-numeric-time-into-sas-time/m-p/830244#M328053</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-08-25T08:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: convert sas numeric time into sas time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-sas-numeric-time-into-sas-time/m-p/830252#M328056</link>
      <description>&lt;P&gt;Perfect!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 09:44:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-sas-numeric-time-into-sas-time/m-p/830252#M328056</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-08-25T09:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: convert sas numeric time into sas time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-sas-numeric-time-into-sas-time/m-p/830262#M328060</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
input time;
want=hms(int(time/10000),int(mod(time,10000)/100),mod(time,100));
format want tod8.;
cards;
112800
145000
84800
204500
132500
130400
110800
123000
123400
90600
115600
101600
100800
73500
143000
104200
95900
100500
90300
120100
212900
104600
112700
153200
140300
24900
114000
160600
123800
101900
100800
202900
110500
75900
130000
231200
;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Aug 2022 11:44:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-sas-numeric-time-into-sas-time/m-p/830262#M328060</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-08-25T11:44:13Z</dc:date>
    </item>
  </channel>
</rss>

