<?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 Date and Time formats in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-and-Time-formats/m-p/643634#M192128</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset in csv format and I can import it to SAS data, but there is particular variable for date and time in the format of 200428202835 (which is YYMMDDHHMMSS). I wanted to read this variable as in proper format like date9. and time5. Is there any option to get above formatted date and time in this format.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Sairam&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Apr 2020 15:00:34 GMT</pubDate>
    <dc:creator>Sairampulipati</dc:creator>
    <dc:date>2020-04-28T15:00:34Z</dc:date>
    <item>
      <title>Date and Time formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-and-Time-formats/m-p/643634#M192128</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset in csv format and I can import it to SAS data, but there is particular variable for date and time in the format of 200428202835 (which is YYMMDDHHMMSS). I wanted to read this variable as in proper format like date9. and time5. Is there any option to get above formatted date and time in this format.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Sairam&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 15:00:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-and-Time-formats/m-p/643634#M192128</guid>
      <dc:creator>Sairampulipati</dc:creator>
      <dc:date>2020-04-28T15:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Date and Time formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-and-Time-formats/m-p/643642#M192130</link>
      <description>&lt;P&gt;One way:&lt;/P&gt;
&lt;PRE&gt;data example;
   x = '200428202835';
   date = input(x,yymmdd6.);
   time = input(substr(x,7), hhmmss.);
   format date date9. time time8.;
run;&lt;/PRE&gt;
&lt;P&gt;You will likely need to read the value as character and then parse because this is a pretty non-typical format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And talk to whoever is using 2 digit years. Did they not learn anything from Y2K?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 15:16:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-and-Time-formats/m-p/643642#M192130</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-04-28T15:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Date and Time formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-and-Time-formats/m-p/643661#M192137</link>
      <description>&lt;P&gt;Thank you very much for the resolution. I would reach to my data manager to check the Y2K.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 15:42:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-and-Time-formats/m-p/643661#M192137</guid>
      <dc:creator>Sairampulipati</dc:creator>
      <dc:date>2020-04-28T15:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Date and Time formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-and-Time-formats/m-p/643664#M192138</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/143413"&gt;@Sairampulipati&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming that you are using the most recommended technique for reading CSV files, a DATA step with INPUT statement(s), you can mix input styles and switch to formatted input for just the date part of this particular field.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile cards dsd;
input seqno name $ date yymmdd6. time :hhmmss. amt :dollar.;
format date date9. time time8.;
cards;
1,John Doe,200428202835,$1234.56
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Apr 2020 15:45:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-and-Time-formats/m-p/643664#M192138</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-04-28T15:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Date and Time formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-and-Time-formats/m-p/643669#M192139</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/143413"&gt;@Sairampulipati&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you very much for the resolution. I would reach to my data manager to check the Y2K.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you can get the century digits included then your strings will match the B8601DJ informat.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=leforinforref&amp;amp;docsetTarget=n1hj2e5ozbucufn1laeoghx9pb6r.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=leforinforref&amp;amp;docsetTarget=n1hj2e5ozbucufn1laeoghx9pb6r.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 16:00:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-and-Time-formats/m-p/643669#M192139</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-04-28T16:00:58Z</dc:date>
    </item>
  </channel>
</rss>

