<?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 call many times a macro function and gather all the information in one dataset in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-call-many-times-a-macro-function-and-gather-all-the/m-p/711599#M37991</link>
    <description>&lt;P&gt;PROC APPEND is your friend.&amp;nbsp; So create one dataset with the DATA step and then use PROC APPEND to append it to the aggregate dataset you are trying to create. (PS Avoid using SASUSER as it will be readonly if you happen to be running more than one SAS session at the same time.)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data current_list;
  infile findfile truncover;
  input filelisting $200.;
run;
proc append base=full_list data=current_list force;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 15 Jan 2021 05:30:35 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2021-01-15T05:30:35Z</dc:date>
    <item>
      <title>How to call many times a macro function and gather all the information in one dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-call-many-times-a-macro-function-and-gather-all-the/m-p/711566#M37990</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I need help because, I don't have any idea , how to do that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, from a root directory, I have gathered in one dataset the complete path of each subfolder that are not empty and does not contains the name old.&amp;nbsp; I have put those various path's name in the dataset subdirectories under the variable foldername.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;from there, I would like to use the following macro function and gather the information about the files hosted in each of those subfolders.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro FindFile(Path= , Command=);&lt;BR /&gt;/*This proc is to check if xcmd is enable. It must be enable&lt;BR /&gt;in order to use the unix command below*/&lt;BR /&gt;proc options option=xcmd;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;/*The %put is to see the value of FileName and Path into the logFile*/&lt;/P&gt;
&lt;P&gt;%put &amp;amp;Command;&lt;BR /&gt;%put &amp;amp;Path;&lt;/P&gt;
&lt;P&gt;/*Using the UNIX Commands find with (PIPE)*/&lt;/P&gt;
&lt;P&gt;filename findfile PIPE "ls &amp;amp;Path. -l --time-style=long-iso | grep ^- | tr -s ' ' | cut -d ' ' -f 5,6,8";&lt;/P&gt;
&lt;P&gt;data sasuser.fileslist;&lt;BR /&gt;infile findfile truncover;&lt;BR /&gt;input filelisting $200.;&lt;BR /&gt;run;&lt;BR /&gt;%mend FindFile;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I am looking a way to pick one by one the name of the subfolder from the subdirectories dataset, and use it&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in&lt;/P&gt;
&lt;P&gt;%FindFile(Path=Path1);&lt;/P&gt;
&lt;P&gt;%FindFile(Path=Path2);&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;%FindFile(Path=Path11);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and gather all the information in one dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do we do that?&lt;/P&gt;
&lt;P&gt;Thanks in advance for help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 21:48:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-call-many-times-a-macro-function-and-gather-all-the/m-p/711566#M37990</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2021-01-14T21:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to call many times a macro function and gather all the information in one dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-call-many-times-a-macro-function-and-gather-all-the/m-p/711599#M37991</link>
      <description>&lt;P&gt;PROC APPEND is your friend.&amp;nbsp; So create one dataset with the DATA step and then use PROC APPEND to append it to the aggregate dataset you are trying to create. (PS Avoid using SASUSER as it will be readonly if you happen to be running more than one SAS session at the same time.)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data current_list;
  infile findfile truncover;
  input filelisting $200.;
run;
proc append base=full_list data=current_list force;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Jan 2021 05:30:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-call-many-times-a-macro-function-and-gather-all-the/m-p/711599#M37991</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-15T05:30:35Z</dc:date>
    </item>
  </channel>
</rss>

