<?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 Reading multiple CSVs with EOV in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-CSVs-with-EOV/m-p/296157#M61982</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to read in multiple csvs with headers on the first line using wildcards in the infile command. I heard that to skip the first line in the files one could use EOV however I&amp;nbsp;didn't get a chance to figure out how it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i just say the piece of code below, I still get the headers imported.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile '\\*_20160831*.csv' dlm=';' lrecl=10000 dsd missover eov=eov firstobs=2;

if eov then input;

input 
   column_1
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If I however use the piece of code below it works.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile '\\*_20160831*.csv' dlm=';' lrecl=10000 dsd missover eov=eov firstobs=2;

input @;
if eov then input;

input column_1;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What does this input&amp;nbsp;@; command do? I could not find any documentation on it ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Sep 2016 16:58:05 GMT</pubDate>
    <dc:creator>_SAS_</dc:creator>
    <dc:date>2016-09-02T16:58:05Z</dc:date>
    <item>
      <title>Reading multiple CSVs with EOV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-CSVs-with-EOV/m-p/296157#M61982</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to read in multiple csvs with headers on the first line using wildcards in the infile command. I heard that to skip the first line in the files one could use EOV however I&amp;nbsp;didn't get a chance to figure out how it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i just say the piece of code below, I still get the headers imported.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile '\\*_20160831*.csv' dlm=';' lrecl=10000 dsd missover eov=eov firstobs=2;

if eov then input;

input 
   column_1
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If I however use the piece of code below it works.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile '\\*_20160831*.csv' dlm=';' lrecl=10000 dsd missover eov=eov firstobs=2;

input @;
if eov then input;

input column_1;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What does this input&amp;nbsp;@; command do? I could not find any documentation on it ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 16:58:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-CSVs-with-EOV/m-p/296157#M61982</guid>
      <dc:creator>_SAS_</dc:creator>
      <dc:date>2016-09-02T16:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Reading multiple CSVs with EOV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-CSVs-with-EOV/m-p/296170#M61987</link>
      <description>&lt;P&gt;Trailing&amp;nbsp;@ means that you are not done reading this line yet. SAS keeps the line current and it is available for another INPUT statement on the same iteration of the data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a simple example that uses that to read in multiple observations&amp;nbsp;from one line.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
   input id $ @;
   do year=2010 to 2015 ;
      input cost @;
      output;
   end;
cards;
Milk 1 2 3 4 5 6 
Beer 2 3 4 5 6 7
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The reason that you need it is because the EOV flag is not set until SAS sees that you are opening another data file and it does not know this until you try to read from it. &amp;nbsp;So you need the INPUT statement to set the EOV flag, but you don't want to try to read hte column headers into your variables. &amp;nbsp;So you read the line, but do not try to read any variable values by using the bare INPUT statement with only the trailing&amp;nbsp;@ pointer control command.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 17:39:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-CSVs-with-EOV/m-p/296170#M61987</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-09-02T17:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Reading multiple CSVs with EOV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-CSVs-with-EOV/m-p/296288#M62021</link>
      <description>Thank you very much for the excellent detailed explanation &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Sat, 03 Sep 2016 05:20:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-multiple-CSVs-with-EOV/m-p/296288#M62021</guid>
      <dc:creator>_SAS_</dc:creator>
      <dc:date>2016-09-03T05:20:00Z</dc:date>
    </item>
  </channel>
</rss>

