<?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: Reading multiple csv files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-csv-files/m-p/606430#M176102</link>
    <description>&lt;P&gt;Or use a subsetting if:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data file_1;
infile "C:\Users\SAS\Desktop\shared\month_*.csv" dlm=',';
format name $10. dates date9.;
input name @;
if name ne "name";
input dates:date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 22 Nov 2019 12:34:41 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-11-22T12:34:41Z</dc:date>
    <item>
      <title>Reading multiple csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-csv-files/m-p/606419#M176097</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using below code to read multiple csv files but&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data file_1;&lt;BR /&gt;infile "C:\Users\SAS\Desktop\shared\month_*.csv" dlm=',' firstobs=2;&lt;BR /&gt;input name $ dates:date9.;&lt;BR /&gt;format dates date9.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help me to skip the 1st row of each new file as each file has column header.&lt;/P&gt;
&lt;P&gt;My csv files are month_1, month_2....month_4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 10:39:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-csv-files/m-p/606419#M176097</guid>
      <dc:creator>Rahul_SAS</dc:creator>
      <dc:date>2019-11-22T10:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Reading multiple csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-csv-files/m-p/606420#M176098</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can test if name="name" and drop the observation like this :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data file_1;
infile "C:\Users\SAS\Desktop\shared\month_*.csv" dlm=',';
format name $10. dates date9.;
input name @;
if name ="name" then delete;
else input dates:date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Nov 2019 10:54:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-csv-files/m-p/606420#M176098</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2019-11-22T10:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Reading multiple csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-csv-files/m-p/606430#M176102</link>
      <description>&lt;P&gt;Or use a subsetting if:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data file_1;
infile "C:\Users\SAS\Desktop\shared\month_*.csv" dlm=',';
format name $10. dates date9.;
input name @;
if name ne "name";
input dates:date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Nov 2019 12:34:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-csv-files/m-p/606430#M176102</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-22T12:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reading multiple csv files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-csv-files/m-p/606489#M176114</link>
      <description>&lt;P&gt;SAS provides the EOV= option on the INFILE statement for giving the name of a variable that will indicate when you are changing files.&amp;nbsp; But using that flag can get a little tricky.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is actually a lot easier to use the FILENAME= option to name a variable that will contain the NAME of the file.&amp;nbsp; Then you can just check if the name has changed.&amp;nbsp; Make sure to define the variable as long enough that the names are not truncated.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data file_1;
  length fname $256 ;
  infile "C:\Users\SAS\Desktop\shared\month_*.csv" dsd truncover filename=fname;
  input @;
  if fname ne lag(fname) then input;
  input name :$32. dates :date.;
  format dates date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Nov 2019 15:30:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-csv-files/m-p/606489#M176114</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-11-22T15:30:00Z</dc:date>
    </item>
  </channel>
</rss>

