<?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: Basic question about dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Basic-question-about-dates/m-p/694843#M211944</link>
    <description>&lt;P&gt;This is an example of some of the rows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;"id","date"
1,2010-11-19 00:00:00
2,2010-11-25 10:20:00
3,2010-11-26 13:12:00&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 28 Oct 2020 13:09:03 GMT</pubDate>
    <dc:creator>joaolopes</dc:creator>
    <dc:date>2020-10-28T13:09:03Z</dc:date>
    <item>
      <title>Basic question about dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-question-about-dates/m-p/694827#M211941</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have opened a csv file in sas and I have some dates variables in the following format:&lt;/P&gt;&lt;P&gt;19NOV10:00:00:00&lt;/P&gt;&lt;P&gt;25NOV10:10:20:00&lt;/P&gt;&lt;P&gt;26NOV10:13:12:00&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I remove the time to it so I get:&lt;/P&gt;&lt;P&gt;19NOV10&lt;/P&gt;&lt;P&gt;25NOV10&lt;/P&gt;&lt;P&gt;26NOV10&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After that I would like to convert the dates to the following:&lt;/P&gt;&lt;P&gt;19NOV2010&lt;/P&gt;&lt;P&gt;25NOV2010&lt;/P&gt;&lt;P&gt;26NOV2010&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, let's say that in a further step the date "25NOV10" is not correct and want it to replace with "25NOV11". How do I do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 12:20:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-question-about-dates/m-p/694827#M211941</guid>
      <dc:creator>joaolopes</dc:creator>
      <dc:date>2020-10-28T12:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question about dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-question-about-dates/m-p/694830#M211942</link>
      <description>&lt;P&gt;Please show us the CSV file as is. Open it with a text editor (e.g. Notepad, but do NOT use Excel!), and copy/paste a few lines into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg"&gt;&lt;img src="https://communities.sas.com/skins/images/E0BB18E7DAA53C21BC28740CEA0E38DA/responsive_peak/images/image_not_found.png" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on the data, you may be able to read the date difrectly by using a date informat.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once a datetime has been read into SAS as such, use the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0rttbu7w62xgzn1damccyuwpld8.htm&amp;amp;locale=de" target="_blank" rel="noopener"&gt;DATEPART&lt;/A&gt; function to extract the date from it.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 12:26:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-question-about-dates/m-p/694830#M211942</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-28T12:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question about dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-question-about-dates/m-p/694843#M211944</link>
      <description>&lt;P&gt;This is an example of some of the rows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;"id","date"
1,2010-11-19 00:00:00
2,2010-11-25 10:20:00
3,2010-11-26 13:12:00&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 13:09:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-question-about-dates/m-p/694843#M211944</guid>
      <dc:creator>joaolopes</dc:creator>
      <dc:date>2020-10-28T13:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question about dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-question-about-dates/m-p/694846#M211945</link>
      <description>&lt;P&gt;With data like this, you can easily apply the date informat directly on the text data:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile datalines dlm="," firstobs=2;
input id $ date :yymmdd10.;
format date yymmdd10.;
datalines;
"id","date"
1,2010-11-19 00:00:00
2,2010-11-25 10:20:00
3,2010-11-26 13:12:00
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Oct 2020 13:13:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-question-about-dates/m-p/694846#M211945</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-28T13:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question about dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-question-about-dates/m-p/694848#M211947</link>
      <description>&lt;P&gt;I'm using proc import and it seems that format is not supported&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 13:30:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-question-about-dates/m-p/694848#M211947</guid>
      <dc:creator>joaolopes</dc:creator>
      <dc:date>2020-10-28T13:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Basic question about dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Basic-question-about-dates/m-p/694851#M211949</link>
      <description>&lt;P&gt;It's not necessary to use proc import on CSV files; much better to write the data step yourself.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 13:35:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Basic-question-about-dates/m-p/694851#M211949</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-28T13:35:09Z</dc:date>
    </item>
  </channel>
</rss>

