<?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: Time Format in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Time-Format/m-p/69328#M19902</link>
    <description>I think of informats  being for input rather than output, so I find this posting a bit confusing. &lt;BR /&gt;
For input use informat YYMMDD8. and for output read the doc for YYMMDDx. When x=N you get no delimiters.</description>
    <pubDate>Tue, 08 Feb 2011 09:36:13 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2011-02-08T09:36:13Z</dc:date>
    <item>
      <title>Time Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Time-Format/m-p/69324#M19898</link>
      <description>Hey everyone,&lt;BR /&gt;
Quick question.  I searched online, but it seems SAS does not have a time format to omit the colon.  I am in the middle of a program compiling a ton of logs; some are in 24 hour format, some are in 12 hour.  The database I upload it to requires it be in HHMM - no colons, and exactly 4 characters.&lt;BR /&gt;
&lt;BR /&gt;
I got it to 24 hour.  Easy.  9:34am is now 9:34.  However, I can't figure out how to get it to 0934.  Any advice?  Or should I use a PROC SQL statement?&lt;BR /&gt;
&lt;BR /&gt;
Thanks!</description>
      <pubDate>Fri, 04 Feb 2011 19:41:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Time-Format/m-p/69324#M19898</guid>
      <dc:creator>Russell</dc:creator>
      <dc:date>2011-02-04T19:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Time Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Time-Format/m-p/69325#M19899</link>
      <description>These two SAS time INFORMATs appear to behave inconsistently when tested (log below with results): &lt;BR /&gt;
&lt;BR /&gt;
ND8601TM - handles "hhmm"&lt;BR /&gt;
HHMMSS - expects seconds, so must use INPUT function and concatenate "00"&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
time +informat +"hhmm" site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
Usage Note 11206: IS8601* FORMATS and INFORMATS for DATE, TIME, and DATETIME&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/11/206.html" target="_blank"&gt;http://support.sas.com/kb/11/206.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
21   data _null_;&lt;BR /&gt;
22   tm = input('1212',ND8601TM.);&lt;BR /&gt;
23   put tm= time.;&lt;BR /&gt;
24   run;&lt;BR /&gt;
&lt;BR /&gt;
tm=12:12:00&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.01 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
25   data _null_;&lt;BR /&gt;
26   tm = input('1212' !! '00',hhmmss.);&lt;BR /&gt;
27   put tm= time.;&lt;BR /&gt;
28   run;&lt;BR /&gt;
&lt;BR /&gt;
tm=12:12:00&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.00 seconds&lt;BR /&gt;
      cpu time            0.00 seconds</description>
      <pubDate>Fri, 04 Feb 2011 19:51:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Time-Format/m-p/69325#M19899</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2011-02-04T19:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Time Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Time-Format/m-p/69326#M19900</link>
      <description>Just make your own picture format.&lt;BR /&gt;
&lt;BR /&gt;
  proc format;&lt;BR /&gt;
    picture mysdt &lt;BR /&gt;
      low-high = '%0H%0M' (datatype = datetime);&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
  data _null_;&lt;BR /&gt;
    myTime = hms(9,34,30);&lt;BR /&gt;
	format myTime mysdt.;&lt;BR /&gt;
	put myTime;&lt;BR /&gt;
  run;</description>
      <pubDate>Fri, 04 Feb 2011 19:57:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Time-Format/m-p/69326#M19900</guid>
      <dc:creator>CurtisMack</dc:creator>
      <dc:date>2011-02-04T19:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Time Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Time-Format/m-p/69327#M19901</link>
      <description>Thank you both!  Curtis, that format picture worked perfectly!&lt;BR /&gt;
&lt;BR /&gt;
I have another question now... I am trying to get the date in ISO 8601 format (YYYYMMDD).  SAS calls this B8601DAw. as the output informat.  However, there is no similar output format.  The date in the worksheet is in MM/DD/YY format, and I have that properly selected, but SAS just errors out and says "NOTE: Invalid data for date in line 133 136-143." many times over throughout the file.&lt;BR /&gt;
&lt;BR /&gt;
I'm sure this is a really simple solution... Does anybody have a recommendation for a good book for newbies?  I'm sure I could get my company to buy one for me... I just need a good primer.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!</description>
      <pubDate>Mon, 07 Feb 2011 22:48:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Time-Format/m-p/69327#M19901</guid>
      <dc:creator>Russell</dc:creator>
      <dc:date>2011-02-07T22:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Time Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Time-Format/m-p/69328#M19902</link>
      <description>I think of informats  being for input rather than output, so I find this posting a bit confusing. &lt;BR /&gt;
For input use informat YYMMDD8. and for output read the doc for YYMMDDx. When x=N you get no delimiters.</description>
      <pubDate>Tue, 08 Feb 2011 09:36:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Time-Format/m-p/69328#M19902</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-02-08T09:36:13Z</dc:date>
    </item>
  </channel>
</rss>

