<?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: Read Files in A Directory in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-Files-in-A-Directory/m-p/164673#M12691</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes that is the one for the members with example&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Apr 2014 16:52:24 GMT</pubDate>
    <dc:creator>jakarman</dc:creator>
    <dc:date>2014-04-02T16:52:24Z</dc:date>
    <item>
      <title>Read Files in A Directory</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-Files-in-A-Directory/m-p/164670#M12688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Environment:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enterprise Guide on UNIX via CITRIX over a Windows XP PC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Situation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have serveral .CSV files located in /aaa/bbb/ccc/ddd&lt;/P&gt;&lt;P&gt;Now i would like to read all CSV files from this folder into a SAS table.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I only want to read the FILENAMES not the content.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I cant use "call system" or "filename x pile ..:" Statements. (Permissions)&lt;/P&gt;&lt;P&gt;I found another option by using the dopen() function.&lt;/P&gt;&lt;P&gt;When i try to open my file the dopenfunction returns a zero (file not found)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the LOG&amp;nbsp; all files are accessed (see LOG)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;I dont know what am I doing wrong? (im not having so much experience)&lt;/P&gt;&lt;P&gt;but why cant dopen open the directory and output my files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sourcecode&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let path = /aaa/bbb/ccc/ddd;&lt;/P&gt;&lt;P&gt;filename dir "&amp;amp;path/*";&lt;/P&gt;&lt;P&gt;data content;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; did=dopen("dir");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if did eq 0 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile dir length=linelen;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input dir $Varying200. linelen;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else do; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg=sysmsg();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put msg;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;filename dir clear;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOG:&lt;/P&gt;&lt;P&gt;NOTE: The infile DIR is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Filename=/aaa/bbb/ccc/ddd/2013-12-06-A.CSV,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File List=/aaa/bbb/ccc/ddd/*,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: The infile DIR is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Filename=/aaa/bbb/ccc/ddd/2013-12-06-B.CSV,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File List=/aaa/bbb/ccc/ddd/*,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;NOTE: The infile DIR is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Filename=/aaa/bbb/ccc/ddd/2014-03-18-B.CSV,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File List=/aaa/bbb/ccc/ddd/*,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;NOTE: The infile DIR is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Filename=/aaa/bbb/ccc/ddd/2014-03-19-A.CSV,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File List=/aaa/bbb/ccc/ddd/*,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;WANT:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want exactly this: 2013-12-06-A.CSV or the whole path /aaa/bbb/ccc/ddd/2014-03-19-A.CSV&lt;/P&gt;&lt;P&gt;in my table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can someone help me? I'm desperate...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 15:26:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-Files-in-A-Directory/m-p/164670#M12688</guid>
      <dc:creator>asdf_sas</dc:creator>
      <dc:date>2014-04-02T15:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Read Files in A Directory</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-Files-in-A-Directory/m-p/164671#M12689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did you follow the example as of: &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67239/HTML/default/viewer.htm#n0jdt2eo1d9pyxn1hxjrkwhi9cdp.htm" title="http://support.sas.com/documentation/cdl/en/lefunctionsref/67239/HTML/default/viewer.htm#n0jdt2eo1d9pyxn1hxjrkwhi9cdp.htm"&gt;SAS(R) 9.4 Functions and CALL Routines: Reference, Second Edition&lt;/A&gt; ?&lt;/P&gt;&lt;P&gt;It is the doptname function retrieving the information not the input statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you have shown with the input statement is that a directory (with HFS as Unix/Windows)&amp;nbsp; is nothing more as a dataset. That dataset (directory) is having a list of pointers to ....&lt;/P&gt;&lt;P&gt;It is shamefull not having the OS layers for security in place as you can do everything with SAS. Oh they will try to block that also.&lt;/P&gt;&lt;P&gt;More easier would be allowing the x-cmd by you platform admin. When he did his work well putting you in an isolated secured box&amp;nbsp; sandbox. There is no security issue involved.&lt;/P&gt;&lt;P&gt;It is something like following the dogtail someone started it claiming it could be harmfull and without verifying understanding many followers.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 16:23:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-Files-in-A-Directory/m-p/164671#M12689</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-04-02T16:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Read Files in A Directory</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-Files-in-A-Directory/m-p/164672#M12690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to use DREAD() instead of INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67239/HTML/default/viewer.htm#n1u8n0tue0ymkrn109xu8ya01kle.htm" title="http://support.sas.com/documentation/cdl/en/lefunctionsref/67239/HTML/default/viewer.htm#n1u8n0tue0ymkrn109xu8ya01kle.htm"&gt;SAS(R) 9.4 Functions and CALL Routines: Reference, Second Edition&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 16:46:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-Files-in-A-Directory/m-p/164672#M12690</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-04-02T16:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Read Files in A Directory</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-Files-in-A-Directory/m-p/164673#M12691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes that is the one for the members with example&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 16:52:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-Files-in-A-Directory/m-p/164673#M12691</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-04-02T16:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Read Files in A Directory</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-Files-in-A-Directory/m-p/164674#M12692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Jaap Karmann&lt;/P&gt;&lt;P&gt;I totally agree with you...even&amp;nbsp; in a test envirnonment our permissions are restricted to nothing *laught&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Both&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help it works &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2014 08:00:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Read-Files-in-A-Directory/m-p/164674#M12692</guid>
      <dc:creator>asdf_sas</dc:creator>
      <dc:date>2014-04-03T08:00:59Z</dc:date>
    </item>
  </channel>
</rss>

