<?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: Looking for Non-SAS Data within a directory in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-Non-SAS-Data-within-a-directory/m-p/786235#M250996</link>
    <description>&lt;P&gt;This is nice.&amp;nbsp; I will have to try it out.&amp;nbsp; I was hoping for a one line solution similar to the functions that exist in R and Python.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Dec 2021 20:49:14 GMT</pubDate>
    <dc:creator>whs278</dc:creator>
    <dc:date>2021-12-15T20:49:14Z</dc:date>
    <item>
      <title>Looking for Non-SAS Data within a directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-Non-SAS-Data-within-a-directory/m-p/785425#M250656</link>
      <description>&lt;P&gt;Is there a way to look at all files in directory using SAS code similar to os.listdir() in python or list.files() in R?&amp;nbsp; I know you in SAS EG, you point and clock File-Open Data, but I was just curious if there was some SAS code that could do the same thing.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 16:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-Non-SAS-Data-within-a-directory/m-p/785425#M250656</guid>
      <dc:creator>whs278</dc:creator>
      <dc:date>2021-12-10T16:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for Non-SAS Data within a directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-Non-SAS-Data-within-a-directory/m-p/785433#M250660</link>
      <description>&lt;P&gt;In SAS there are a number of functions related to manipulating external, i.e. Non-SAS files.&lt;/P&gt;
&lt;P&gt;You can search in the documentation for Functions and look at the External Files section. &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/lefunctionsref/n01f5qrjoh9h4hn1olbdpb5pr2td.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/lefunctionsref/n01f5qrjoh9h4hn1olbdpb5pr2td.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are examples in the documentation using the functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would strongly recommend creating practice data to work with these functions, as in a directory or two with practice files you don't mind losing as it is relatively easy to delete files or change contents and practice with known and expendable data is a good idea.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 16:51:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-Non-SAS-Data-within-a-directory/m-p/785433#M250660</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-12-10T16:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for Non-SAS Data within a directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-Non-SAS-Data-within-a-directory/m-p/785524#M250704</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
rc=filename('x','c:\temp\');
did=dopen('x');
do i=1 to dnum(did);
 fname=dread(did,i);put fname=;
end;
did=dclose(did);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:01:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-Non-SAS-Data-within-a-directory/m-p/785524#M250704</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-12-11T11:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for Non-SAS Data within a directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-Non-SAS-Data-within-a-directory/m-p/785605#M250743</link>
      <description>&lt;P&gt;In general it is very easy to just read the output of whatever operating system command generates a list of files on your machine.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data files;
  infile 'ls -d /mydir/*' pipe truncover;
  input filename $200.;
run;
data files;
  infile 'dir /b c:\mydir' pipe truncover;
  input filename $200.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you are stuck running on a SAS session that has disabled your ability to run operating system commands then use the DOPEN() and DREAD() function.&lt;/P&gt;
&lt;P&gt;For example as done with this macro:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/sasutils/macros/blob/master/dirtree.sas" target="_blank"&gt;https://github.com/sasutils/macros/blob/master/dirtree.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-Non-SAS-Data-within-a-directory/m-p/785605#M250743</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-12-11T22:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for Non-SAS Data within a directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-Non-SAS-Data-within-a-directory/m-p/785636#M250760</link>
      <description>&lt;P&gt;Of course - here is a macro to give a directory listing (it also works recursively, and does not require XCMD):&amp;nbsp;&lt;A href="https://core.sasjs.io/mp__dirlist_8sas.html" target="_blank"&gt;https://core.sasjs.io/mp__dirlist_8sas.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:39:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-Non-SAS-Data-within-a-directory/m-p/785636#M250760</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2021-12-12T16:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for Non-SAS Data within a directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-Non-SAS-Data-within-a-directory/m-p/786235#M250996</link>
      <description>&lt;P&gt;This is nice.&amp;nbsp; I will have to try it out.&amp;nbsp; I was hoping for a one line solution similar to the functions that exist in R and Python.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 20:49:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-Non-SAS-Data-within-a-directory/m-p/786235#M250996</guid>
      <dc:creator>whs278</dc:creator>
      <dc:date>2021-12-15T20:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for Non-SAS Data within a directory</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Looking-for-Non-SAS-Data-within-a-directory/m-p/786277#M251016</link>
      <description>If you could use OS command, that is the best choice !</description>
      <pubDate>Thu, 16 Dec 2021 11:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Looking-for-Non-SAS-Data-within-a-directory/m-p/786277#M251016</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-12-16T11:46:56Z</dc:date>
    </item>
  </channel>
</rss>

