<?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: import multiple files into sas datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/682201#M206487</link>
    <description>The files are independent of each other.They need not be appended. they have to be converted into individual datasets</description>
    <pubDate>Tue, 08 Sep 2020 11:33:16 GMT</pubDate>
    <dc:creator>sindhura1</dc:creator>
    <dc:date>2020-09-08T11:33:16Z</dc:date>
    <item>
      <title>import multiple files into sas datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/681812#M206286</link>
      <description>&lt;P&gt;There are multiple files in my unix folder(csv,txt).I want to convert them all into sas datasets through SAS EG.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone help with this please?&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2020 14:57:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/681812#M206286</guid>
      <dc:creator>sindhura1</dc:creator>
      <dc:date>2020-09-05T14:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: import multiple files into sas datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/681813#M206287</link>
      <description>&lt;P&gt;You can run PROC IMPORT on them, but be advised that this involves guessing and is therefore unreliable.&lt;/P&gt;
&lt;P&gt;If the files share the same structure, you need to run the same data step on them to get identical (in terms of variable attributes) results.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2020 15:13:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/681813#M206287</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-05T15:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: import multiple files into sas datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/681814#M206288</link>
      <description>&lt;P&gt;Use EG to help you write some SAS code to read the files.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you know what is in the files?&amp;nbsp; If so just write a data step to read them.&lt;/P&gt;
&lt;P&gt;If you don't know are you ok with SAS guessing how to define the variables?&amp;nbsp; If so just use PROC IMPORT.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2020 15:15:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/681814#M206288</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-05T15:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: import multiple files into sas datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/681815#M206289</link>
      <description>I am able to import one file using proc import&lt;BR /&gt;But how to import series of files?&lt;BR /&gt;</description>
      <pubDate>Sat, 05 Sep 2020 15:25:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/681815#M206289</guid>
      <dc:creator>sindhura1</dc:creator>
      <dc:date>2020-09-05T15:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: import multiple files into sas datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/681816#M206290</link>
      <description>&lt;P&gt;Please be more specific. Are the datasets resulting from the import meant to be appended (same structure), or do they share common key columns which need to be used later on in joins, or are they completely independent and have no relationship at all?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A list of files in a folder is easily done, either by running the UNIX ls command in a FILENAME PIPE, or by using the FILENAME, DOPEN, DNUM and DREAD functions in a data step.&lt;/P&gt;
&lt;P&gt;Search for "list files in directory" here on the communities, as this question has been asked and answered numerous times.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2020 15:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/681816#M206290</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-05T15:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: import multiple files into sas datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/681831#M206302</link>
      <description>I generally don't recommend this approach at all but here's one way. &lt;BR /&gt;I guarantee it's infinitely better to go through the files, make sure variables are coded correctly otherwise you run into issues later on. &lt;BR /&gt;&lt;BR /&gt;This was designed for Excel but you can easily change to be for CSV.&lt;BR /&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/Import_all_files_one_type" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/Import_all_files_one_type&lt;/A&gt;</description>
      <pubDate>Sat, 05 Sep 2020 19:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/681831#M206302</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-09-05T19:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: import multiple files into sas datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/682201#M206487</link>
      <description>The files are independent of each other.They need not be appended. they have to be converted into individual datasets</description>
      <pubDate>Tue, 08 Sep 2020 11:33:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/682201#M206487</guid>
      <dc:creator>sindhura1</dc:creator>
      <dc:date>2020-09-08T11:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: import multiple files into sas datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/682203#M206489</link>
      <description>yes i am able to do proc import with single file.But unable to do with multiple files&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Sep 2020 11:34:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/682203#M206489</guid>
      <dc:creator>sindhura1</dc:creator>
      <dc:date>2020-09-08T11:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: import multiple files into sas datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/682221#M206500</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/343938"&gt;@sindhura1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;yes i am able to do proc import with single file.But unable to do with multiple files&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Get the list of files:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data files;
  input 'ls /myfolder/*.csv' pipe truncover;
  input filename $256. ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then generate code to convert each one.&amp;nbsp; Here is a simple process, but you might need to make it more complicated if the base names of your files are not valid SAS member names (or not unique).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set files;
  call execute(catx(' '
    ,'proc import datafile=',quote(trim(filename))
    ,'dbms=csv'
    ,'out=',scan(filename,-2,'/.'),'replace'
    ,';'
    ,'run;'
  ));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Sep 2020 12:18:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-multiple-files-into-sas-datasets/m-p/682221#M206500</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-09-08T12:18:46Z</dc:date>
    </item>
  </channel>
</rss>

