<?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: SAS 9.4 Reformat dates after CSV import in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-9-4-Reformat-dates-after-CSV-import/m-p/261778#M57633</link>
    <description>&lt;P&gt;If you use a datastep program to read CSV (highly recommended) instead of proc import then you specify the informat and format in the datastep.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are going to be repeatedly importing similar format files you are almost gauranteed to get some inconsistency over time from changing lengths of character variables, change from numeric to character, from date to character or similar. Getting one datastep and modifying input file and output dataset will save you lots of headaches down the road.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Apr 2016 15:00:52 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-04-06T15:00:52Z</dc:date>
    <item>
      <title>SAS 9.4 Reformat dates after CSV import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-9-4-Reformat-dates-after-CSV-import/m-p/261688#M57629</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I am importing a csv file from excel and the dates that is pulled from the file contains time as well. &amp;nbsp;SAS is reading the dates correctly, however I want to change the DATETIME16. to MMYYDD10. &amp;nbsp;Any guidance on how to do this would be greatly appreciated. &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;BR /&gt;Jeff S. O.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 13:08:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-9-4-Reformat-dates-after-CSV-import/m-p/261688#M57629</guid>
      <dc:creator>Jolly</dc:creator>
      <dc:date>2016-04-06T13:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAS 9.4 Reformat dates after CSV import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-9-4-Reformat-dates-after-CSV-import/m-p/261692#M57630</link>
      <description>&lt;P&gt;Do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newdate = datepart(date);
format newdate mmddyy10.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(there is no mmyydd format)&lt;/P&gt;
&lt;P&gt;If you want to preserve the original variable name, add&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;drop date;
rename newdate=date;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in the data step.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 13:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-9-4-Reformat-dates-after-CSV-import/m-p/261692#M57630</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-04-06T13:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS 9.4 Reformat dates after CSV import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-9-4-Reformat-dates-after-CSV-import/m-p/261778#M57633</link>
      <description>&lt;P&gt;If you use a datastep program to read CSV (highly recommended) instead of proc import then you specify the informat and format in the datastep.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are going to be repeatedly importing similar format files you are almost gauranteed to get some inconsistency over time from changing lengths of character variables, change from numeric to character, from date to character or similar. Getting one datastep and modifying input file and output dataset will save you lots of headaches down the road.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 15:00:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-9-4-Reformat-dates-after-CSV-import/m-p/261778#M57633</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-04-06T15:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS 9.4 Reformat dates after CSV import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-9-4-Reformat-dates-after-CSV-import/m-p/261782#M57634</link>
      <description>&lt;P&gt;Hello Ballardw,&lt;BR /&gt;&lt;BR /&gt;Would you mind giving a brief example?&amp;nbsp; I have always used the import statement, but if I can decide the format before the dataset is created, that sounds way better than what I have been doing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;BR /&gt;Jeff S O&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 15:09:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-9-4-Reformat-dates-after-CSV-import/m-p/261782#M57634</guid>
      <dc:creator>Jolly</dc:creator>
      <dc:date>2016-04-06T15:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: SAS 9.4 Reformat dates after CSV import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-9-4-Reformat-dates-after-CSV-import/m-p/261866#M57643</link>
      <description>&lt;P&gt;If you have been using Proc Import you should get code SAS generates to read a csv file in the log.&lt;/P&gt;
&lt;P&gt;You can copy that and paste into the editor to see a basic example. Look at statements like INFORMAT. Those tell SAS how to read specific variables. When they are character the $nn sets the length of the text variables to nn characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 17:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-9-4-Reformat-dates-after-CSV-import/m-p/261866#M57643</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-04-06T17:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAS 9.4 Reformat dates after CSV import</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-9-4-Reformat-dates-after-CSV-import/m-p/261898#M57652</link>
      <description>&lt;P&gt;Thank you very much for that Ballardw!&lt;BR /&gt;&lt;BR /&gt;Jeff S O&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 18:58:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-9-4-Reformat-dates-after-CSV-import/m-p/261898#M57652</guid>
      <dc:creator>Jolly</dc:creator>
      <dc:date>2016-04-06T18:58:28Z</dc:date>
    </item>
  </channel>
</rss>

