<?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: code explanation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/code-explanation/m-p/263225#M51499</link>
    <description>&lt;P&gt;This is using SAS functions to read the names of external files. Using this approach there isn't anything that will get simpler.&lt;/P&gt;
&lt;P&gt;Basically&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dirlist;
    rc=filename ("fdir","&amp;amp;path");  /*Assign a reference SAS can use to a folder or directory*/
    did=dopen("fdir");   /* attempt to open the directory for reading*/
    if did&amp;gt;0 then do;    /* if successful opening */
       num=dnum(did);    /* get the number of files in the directory*/
       do i = 1 to num;
          fname=dread(did,i);  /* retrieve the file names*/
          output;
       end;
    end;
 run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are operating system options involving pipes and such to get the output of system commands with file lists and read them but they are operating system dependent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Apr 2016 15:11:17 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-04-12T15:11:17Z</dc:date>
    <item>
      <title>code explanation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-explanation/m-p/263218#M51497</link>
      <description>&lt;P&gt;can someone please explain to me the code below and how i can make modification to it to still run, basically i am trying to edit the code to be more simple and understantable&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is the code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;data dirlist;&lt;BR /&gt;&amp;nbsp;rc=filename ("fdir","&amp;amp;path");&lt;BR /&gt;&amp;nbsp;did=dopen("fdir");&lt;BR /&gt;&amp;nbsp;if did&amp;gt;0 then do;&lt;BR /&gt;&amp;nbsp;num=dnum(did);&lt;BR /&gt;&amp;nbsp;do i = 1 to num;&lt;BR /&gt;&amp;nbsp;fname=dread(did,i);&lt;BR /&gt;&amp;nbsp;output;&lt;BR /&gt;&amp;nbsp;end;&lt;BR /&gt;&amp;nbsp;end;&lt;BR /&gt;&amp;nbsp;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 14:56:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-explanation/m-p/263218#M51497</guid>
      <dc:creator>109393</dc:creator>
      <dc:date>2016-04-12T14:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: code explanation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-explanation/m-p/263225#M51499</link>
      <description>&lt;P&gt;This is using SAS functions to read the names of external files. Using this approach there isn't anything that will get simpler.&lt;/P&gt;
&lt;P&gt;Basically&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dirlist;
    rc=filename ("fdir","&amp;amp;path");  /*Assign a reference SAS can use to a folder or directory*/
    did=dopen("fdir");   /* attempt to open the directory for reading*/
    if did&amp;gt;0 then do;    /* if successful opening */
       num=dnum(did);    /* get the number of files in the directory*/
       do i = 1 to num;
          fname=dread(did,i);  /* retrieve the file names*/
          output;
       end;
    end;
 run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are operating system options involving pipes and such to get the output of system commands with file lists and read them but they are operating system dependent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 15:11:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-explanation/m-p/263225#M51499</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-04-12T15:11:17Z</dc:date>
    </item>
  </channel>
</rss>

