<?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: how to import multiple csv files with same format to sas with data step in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/627128#M20491</link>
    <description>&lt;P&gt;Thank you! I will try it out and let you know if it works for me.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Feb 2020 08:20:27 GMT</pubDate>
    <dc:creator>Tesera</dc:creator>
    <dc:date>2020-02-25T08:20:27Z</dc:date>
    <item>
      <title>how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626097#M20340</link>
      <description>&lt;P&gt;Hello, I am new to SAS and I've been trying to write a sas code so it can automatically take all my csv tables from one directory. Mostly, I've found different proc import scripts, but I want to use data step, as proc import evaluated my columns differently from my what I need. This is my script.&lt;/P&gt;&lt;PRE&gt;data test;
	infile '\\PC0525\SAS_EG\IACS\AEZ_2008.csv'
delimiter=';'
		missover
		firstobs=2
		DSD
		LRECL=32767
		;
informat 

ID best12.	
VS 12. 
DOTT $15. 
;

format ID best12.;	
format VS best12.;	
format DOTT	$15.;

input 

ID
VS 
DOTT $	

run;&lt;/PRE&gt;&lt;P&gt;I have files from 2008 to 2019, and also different names Like AEZ_2008... ABC_2008..&lt;/P&gt;&lt;P&gt;Thank you for your responses!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 11:06:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626097#M20340</guid>
      <dc:creator>Tesera</dc:creator>
      <dc:date>2020-02-20T11:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626110#M20341</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;did you try asterisk(*):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
	infile '\\PC0525\SAS_EG\IACS\*.csv'
delimiter=';'
...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 11:49:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626110#M20341</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-02-20T11:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626114#M20342</link>
      <description>&lt;P&gt;Thank you, that works perfectly!&lt;/P&gt;&lt;P&gt;And is there any way, it can make separate tables, different for each year, from 2008 to 2019?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 11:56:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626114#M20342</guid>
      <dc:creator>Tesera</dc:creator>
      <dc:date>2020-02-20T11:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626116#M20343</link>
      <description>&lt;P&gt;Check out the&amp;nbsp;&lt;SPAN style="font-weight: bold;"&gt;FILENAME= &lt;/SPAN&gt;option in the&lt;SPAN style="font-weight: bold;"&gt; INFILE &lt;/SPAN&gt;statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 12:00:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626116#M20343</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-02-20T12:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626117#M20344</link>
      <description>&lt;P&gt;EDIT: It works but it also add names of every columns from all the tables again, in between.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 12:01:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626117#M20344</guid>
      <dc:creator>Tesera</dc:creator>
      <dc:date>2020-02-20T12:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626122#M20345</link>
      <description>&lt;P&gt;One solution would be like this [EDIT: lest make it more robust]:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename f1 "%sysfunc(pathname(work))/file1.csvxxx";
filename f2 "%sysfunc(pathname(work))/file2.csvxxx";
filename f3 "%sysfunc(pathname(work))/file3.csvxxx";

data _null_;
  file f1;
  put "a,b,c";
  put "1,2,3";
  put "4,5,6";
  file f2;
  put "a,b,c";
  put "7,8,9";
  put "10,11,12";
  file f3;
  put "a,b,c";
  put "13,14,15";
  put "16,17,18";
run;

data want;
  length F $ 200;
  infile "%sysfunc(pathname(work))/*.csvxxx" dlm="," filename=F lrecl=512;
  if 1 = _N_ then 
    do;
      input @;
      length _header_ $ 512; retain _header_; drop _header_;
      _header_ = _infile_;
    end;
  input @;
  curent_file = F;
  if _infile_ ne _header_;
  input a b c;
run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 12:47:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626122#M20345</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-02-20T12:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626162#M20348</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt; Consider the INFILE statement option EOV=&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36260i2BB0B5A0300A6532/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 15:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626162#M20348</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2020-02-20T15:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626240#M20361</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did consider EOV= but unfortunately asterisk(*) seems to not cooperate:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename f1 "%sysfunc(pathname(work))/file1.csvxxx";
filename f2 "%sysfunc(pathname(work))/file2.csvxxx";
filename f3 "%sysfunc(pathname(work))/file3.csvxxx";

data _null_;
  file f1;
  put "a,b,c";
  put "1,2,3";
  put "4,5,6";
  file f2;
  put "a,b,c";
  put "7,8,9";
  put "10,11,12";
  file f3;
  put "a,b,c";
  put "13,14,15";
  put "16,17,18";
run;

data want;
  infile "%sysfunc(pathname(work))/*.csvxxx" dlm="," EOV=EOV;
  input @;
  EV=EOV;
  if EV then input;
             else input a b c;
run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;the result is:&lt;/P&gt;&lt;PRE&gt;Obs    EV    a    b    c

 1      0    .    .    .
 2      0    1    2    3
 3      0    4    5    6
 4      1    .    .    .
 5      1    .    .    .
 6      1    .    .    .
 7      1    .    .    .
 8      1    .    .    .
 9      1    .    .    .&lt;/PRE&gt;&lt;P&gt;All the best&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would do it probably like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename D DUMMY;
data want2;
  infile cards;
  input FN : $ 200.;
  FN = "%sysfunc(pathname(work))/" || FN;

  do until(eof);
    infile D FILEVAR=FN dlm="," FIRSTOBS=2 END=EOF;
      input a b c;
      output;
  end;
cards;
file1.csvxxx
file2.csvxxx
file3.csvxxx
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but I would replace cards with extraction data list from the folder.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 17:49:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626240#M20361</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-02-20T17:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626253#M20362</link>
      <description>&lt;P&gt;You have to RESET EOV as mentioned in the tip. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   infile "%sysfunc(pathname(work))/*.csvxxx" dlm="," EOV=EOV;
   input @;
   if _n_ eq 1 or eov then do;
      eov = 0;
      delete;
      end;
   input a b c;
   run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Feb 2020 18:12:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626253#M20362</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2020-02-20T18:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626254#M20363</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/313031"&gt;@Tesera&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;EDIT: It works but it also add names of every columns from all the tables again, in between.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If the goal is to keep them as separate years (which is probably not what you want)&amp;nbsp; you can make a loop (or a macro that is called multiple times) and read each file separately.&amp;nbsp; The FIRSTOBS=2 option on the infile statement will skip the header row each time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you are reading multiple files you will need to use other logic to skip the header rows.&lt;/P&gt;
&lt;P&gt;You could look at the line and figure it out. That is easy if the first variable is numeric so the header is always different than any real line of data.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile .....;
  input @;
  if _infile_ =: 'VAR1' then delete;
  ...
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could try to make heads or tails of the EOV option. But I have found using the FILENAME= option is easier.&amp;nbsp; Plus then you have it if you want to pull the YEAR or other information from the file's name.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  length fname $256 ;
  infile ..... firstobs=1 filename=fname ;
  input @;
  if fname ne lag(fname) then delete;
  ...
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 18:13:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626254#M20363</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-20T18:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626274#M20367</link>
      <description>&lt;P&gt;Haha, I need to examine my eyes! Didn't spot that Tip &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now it looks nice, and firstobs=2 still works:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile "%sysfunc(pathname(work))/*.csvxxx" dlm="," EOV=EOV Firstobs=2;
  input @;
  if not EOV then do; 
            input a b c; 
            output; 
          end;
  EOV = 0;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 18:42:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626274#M20367</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-02-20T18:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626293#M20371</link>
      <description>&lt;P&gt;I use that pattern of resetting it at the end of the datastep.&amp;nbsp; Works well for simple steps where every iteration traverses the full step.&lt;/P&gt;
&lt;P&gt;For simple one line headers just conditionally execute an INPUT to remove the header.&amp;nbsp; Note that you need to use the FIRSTOBS option to skip the first header line.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile '*.txt' firstobs=2 eov=eov;
  input @;
  if eov then input;
  input .... ;
  eov=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note this will have trouble with 0 observation files that consist of just the header line.&amp;nbsp; In that case you might want to make it a little more complex by putting the extra INPUT in a do loop.&amp;nbsp; In which case then you no longer need to reset EOV at the end.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile '*.txt' firstobs=2 eov=eov;
  input @;
  do while(eov); eov=0; input / @; end;
  input .... ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Feb 2020 19:20:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626293#M20371</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-20T19:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626422#M20385</link>
      <description>&lt;P&gt;I would like to&amp;nbsp;&lt;SPAN&gt;keep them as separate years, all 2008 together, all 2009 together, etc. etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 09:19:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626422#M20385</guid>
      <dc:creator>Tesera</dc:creator>
      <dc:date>2020-02-21T09:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626428#M20386</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/313031"&gt;@Tesera&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I wrote use filename= option to extract file name and from the name the year, try below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename f1 "%sysfunc(pathname(work))/fileA_2008.csvxxx";
filename f2 "%sysfunc(pathname(work))/fileB_2009.csvxxx";
filename f3 "%sysfunc(pathname(work))/fileC_2019.csvxxx";

data _null_;
  file f1;
  put "a,b,c";
  put "1,2,3";
  put "4,5,6";
  file f2;
  put "a,b,c";
  put "7,8,9";
  put "10,11,12";
  file f3;
  put "a,b,c";
  put "13,14,15";
  put "16,17,18";
run;

data 
  %macro smallLoop1(s,e);
    %do year = &amp;amp;s. %to &amp;amp;e.;
      want&amp;amp;year.
    %end;
  %mend smallLoop1;
  %smallLoop1(2008,2019)
  wantOther
;
  length F $ 200;
  infile "%sysfunc(pathname(work))/*.csvxxx" dlm="," filename=F EOV=EOV Firstobs=2;
  input @;
  if not EOV then do; 
            input a b c;
            select(compress(scan(F,-1,"\/"),,"KD"));
              %macro smallLoop2(s,e);
                %do year = &amp;amp;s. %to &amp;amp;e.;
                  when("&amp;amp;year.") output want&amp;amp;year.;
                %end;
              %mend smallLoop2;
              %smallLoop2(2008,2019)
              otherwise  output wantOther;
            end; 
          end;
  EOV = 0;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I'm using macro-loop here, it could be also done with hash-of-hashes, but this one do the job perfectly good.&lt;/P&gt;&lt;P&gt;Just adjust `&lt;CODE class=" language-sas"&gt;input a b c;` to your needs and `%smallLoop1(2008,2019)` and `%smallLoop2(2008,2019)` to cover your data range.&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 09:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/626428#M20386</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-02-21T09:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/627128#M20491</link>
      <description>&lt;P&gt;Thank you! I will try it out and let you know if it works for me.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 08:20:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/627128#M20491</guid>
      <dc:creator>Tesera</dc:creator>
      <dc:date>2020-02-25T08:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/629092#M20709</link>
      <description>&lt;P&gt;the first suggestion with&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; _infile_ &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;: &lt;SPAN class="token string"&gt;'VAR1'&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;delete&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;worked for me very well, thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 11:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/629092#M20709</guid>
      <dc:creator>Tesera</dc:creator>
      <dc:date>2020-03-03T11:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/629093#M20710</link>
      <description>&lt;P&gt;I tried to adjust it to my script, but I am beginner and this is too complicated for me.&lt;/P&gt;&lt;P&gt;I dont understand how this statement work:&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;filename&lt;/SPAN&gt; f3 &lt;SPAN class="token string"&gt;"%sysfunc(pathname(work))/fileC_2019.csvxxx"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;as I am not administrator of the computer in my work, and it gives me weird path which I cannot see. So I put this instead:&amp;nbsp;filename f7 "\\PC0525\SAS_EG\IACS\*_2014.csv" but it gives me empty table in the output.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 11:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/629093#M20710</guid>
      <dc:creator>Tesera</dc:creator>
      <dc:date>2020-03-03T11:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/629108#M20711</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/313031"&gt;@Tesera&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This part:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename f1 "%sysfunc(pathname(work))/fileA_2008.csvxxx";
filename f2 "%sysfunc(pathname(work))/fileB_2009.csvxxx";
filename f3 "%sysfunc(pathname(work))/fileC_2019.csvxxx";

data _null_;
  file f1;
  put "a,b,c";
  put "1,2,3";
  put "4,5,6";
  file f2;
  put "a,b,c";
  put "7,8,9";
  put "10,11,12";
  file f3;
  put "a,b,c";
  put "13,14,15";
  put "16,17,18";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;was just to create example files.&lt;/P&gt;&lt;P&gt;The `&lt;CODE class=" language-sas"&gt;%sysfunc(pathname(work))` basically gets the location of the work folder of the sas session. For your task only the second part is important and you are using the `infile` statement to read in your files.&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;This&amp;nbsp;line of code&lt;/CODE&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile "%sysfunc(pathname(work))/*.csvxxx" dlm="," filename=F EOV=EOV Firstobs=2;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;points to my example files, you should change it to the directory you are using in your exercise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 12:57:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/629108#M20711</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-03-03T12:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/629109#M20712</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/313031"&gt;@Tesera&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I tried to adjust it to my script, but I am beginner and this is too complicated for me.&lt;/P&gt;
&lt;P&gt;I dont understand how this statement work:&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;filename&lt;/SPAN&gt; f3 &lt;SPAN class="token string"&gt;"%sysfunc(pathname(work))/fileC_2019.csvxxx"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;as I am not administrator of the computer in my work, and it gives me weird path which I cannot see. So I put this instead:&amp;nbsp;filename f7 "\\PC0525\SAS_EG\IACS\*_2014.csv" but it gives me empty table in the output.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Read the example solution more carefully.&amp;nbsp; That was the location that the program wrote the example data files it used to demonstrate.&amp;nbsp; Use the real path to the files you want to read.&amp;nbsp; Do your real filenames have an extension of csvxxx ?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 12:58:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/629109#M20712</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-03T12:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to import multiple csv files with same format to sas with data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/629110#M20713</link>
      <description>&lt;P&gt;I put the end of the post this: "&lt;STRONG&gt;So I put this instead:&amp;nbsp;filename f7 "\\PC0525\SAS_EG\IACS\*_2014.csv" but it gives me empty table in the output."&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So I adjusted it to my path, but it didnt work the right way.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 13:10:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-import-multiple-csv-files-with-same-format-to-sas-with/m-p/629110#M20713</guid>
      <dc:creator>Tesera</dc:creator>
      <dc:date>2020-03-03T13:10:42Z</dc:date>
    </item>
  </channel>
</rss>

