<?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 Import CSV file with date variable in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-CSV-file-with-date-variable/m-p/517406#M32616</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a lot of excel files saved as date variable (i.e. "ABC 20181130.csv", "&lt;SPAN&gt;ABC 20181129.csv" ... etc) would like to import to SAS. Is there any way/code that SAS can read the date variable of the CSV files ?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 30 Nov 2018 09:29:07 GMT</pubDate>
    <dc:creator>Kennychan0809</dc:creator>
    <dc:date>2018-11-30T09:29:07Z</dc:date>
    <item>
      <title>Import CSV file with date variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-CSV-file-with-date-variable/m-p/517406#M32616</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a lot of excel files saved as date variable (i.e. "ABC 20181130.csv", "&lt;SPAN&gt;ABC 20181129.csv" ... etc) would like to import to SAS. Is there any way/code that SAS can read the date variable of the CSV files ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 09:29:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-CSV-file-with-date-variable/m-p/517406#M32616</guid>
      <dc:creator>Kennychan0809</dc:creator>
      <dc:date>2018-11-30T09:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Import CSV file with date variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-CSV-file-with-date-variable/m-p/517408#M32617</link>
      <description>&lt;P&gt;How are you reading the csv files?&amp;nbsp; The simplest method is to take the filename when you put it in your import code.&amp;nbsp; The simplest method of this is in the datastep you use to import the data - you do use a datastep right:&lt;/P&gt;
&lt;PRE&gt;data want;
  infile "c:/myfiles/*.csv" filename=filename dlm=",";
  length ...;
  input ...;
  informat ...;
  format ...;
  inname=filename;
run;&lt;/PRE&gt;
&lt;P&gt;With this you can read 1 or more file - I just read all files with .csv extension in here - and get the filename information into a variable - you can process that variable to just get date out.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 10:04:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-CSV-file-with-date-variable/m-p/517408#M32617</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-30T10:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Import CSV file with date variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-CSV-file-with-date-variable/m-p/517409#M32618</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;data work.testdata;
infile '~path/ABC_20181130.csv' delimiter=',' ;
input date yymmdd10. ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or you could use&lt;/P&gt;
&lt;P&gt;the&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile='~path/ABC 20181130.csv' dbms=csv replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 10:14:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-CSV-file-with-date-variable/m-p/517409#M32618</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2018-11-30T10:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Import CSV file with date variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-CSV-file-with-date-variable/m-p/517522#M32619</link>
      <description>&lt;P&gt;You can also use the wildcard and use FILENAME to grab the file name from the file and parse out the date after the fact.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 15:51:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-CSV-file-with-date-variable/m-p/517522#M32619</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-30T15:51:39Z</dc:date>
    </item>
  </channel>
</rss>

