<?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 probleme with a variable in a %let statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/probleme-with-a-variable-in-a-let-statement/m-p/395890#M278067</link>
    <description>&lt;P&gt;&lt;FONT size="4"&gt;Hi! I did a code to list every folder in a certain path and I sorted them (befor this step) and the folder I'm interested in are in the table "Filenames1593_epuree", witch I called at the end of the macro bellow. It contains 25 folder names.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*****List of all the folders to open****/&lt;/P&gt;&lt;P&gt;/*****determine the number of different name in the table*****/&lt;BR /&gt;%macro ouvrir(table);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;set &amp;amp;table. end=eof;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if eof then call symput('nomdossier',_n_);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*****for every non empty line, attribute a memname into the 'dossier' variable************/&lt;BR /&gt;%do i=1 %to &amp;amp;nomdossier;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;set &amp;amp;table.(where=(numero=&amp;amp;i.));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;call symput('dossier',memname);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;run;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;%put &amp;amp;dossier;&lt;BR /&gt;%end;&lt;BR /&gt;%mend ouvrir;&lt;BR /&gt;%ouvrir(&lt;FONT color="#FF0000"&gt;Filenames1593_epuree&lt;/FONT&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;This macro up here works well. The problem is when I want to use these folder names to open them and get to every file inside of it. I did this bellow and it works well if I test it with a specific folder instead of &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&amp;amp;dossier.&lt;/STRONG&gt;&lt;/FONT&gt; But, when I do it with a variable in de %let statement, I get nothing... (see log message after the code). What am I doing wrong? Thank you very much!!&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;%let rep=\\sdlc000-000010\soutien$\Projets\ORN - STL-0108\Acquisitions\1593\&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&amp;amp;dossier.&lt;/STRONG&gt;&lt;/FONT&gt;;&lt;BR /&gt;&lt;BR /&gt;filename profileA "&amp;amp;rep.";&lt;BR /&gt;&lt;BR /&gt;data fichiers_profileA;&lt;BR /&gt;length name $55;&lt;BR /&gt;drop rc did i;&lt;BR /&gt;did=dopen("profileA");&lt;BR /&gt;if did &amp;gt; 0 then do;&lt;BR /&gt;do i=1 to dnum(did);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;name=dread(did,i);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if findw(name, 'profileA.csv')&amp;gt;0 then output;&lt;BR /&gt;end;&lt;BR /&gt;rc=dclose(did);&lt;BR /&gt;end;&lt;BR /&gt;else put 'Could not open directory';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;log message&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;2764&amp;nbsp; %let rep=\\sdlc000-000010\soutien$\Projets\ORN - STL-0108\Acquisitions\1593\&amp;amp;dossier.;&lt;BR /&gt;&lt;FONT color="#339966"&gt;WARNING: Apparent symbolic reference DOSSIER not resolved.&lt;/FONT&gt;&lt;BR /&gt;2765&lt;BR /&gt;2766&amp;nbsp; filename profileA "&amp;amp;rep.";&lt;BR /&gt;&lt;FONT color="#339966"&gt;WARNING: Apparent symbolic reference DOSSIER not resolved.&lt;/FONT&gt;&lt;BR /&gt;2767&lt;BR /&gt;2768&amp;nbsp; data fichiers_profileA;&lt;BR /&gt;2769&amp;nbsp; length name $55;&lt;BR /&gt;2770&amp;nbsp; drop rc did i;&lt;BR /&gt;2771&amp;nbsp; did=dopen("profileA");&lt;BR /&gt;2772&amp;nbsp; if did &amp;gt; 0 then do;&lt;BR /&gt;2773&amp;nbsp; do i=1 to dnum(did);&lt;BR /&gt;2774&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name=dread(did,i);&lt;BR /&gt;2775&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if findw(name, 'profileA.csv')&amp;gt;0 then output;&lt;BR /&gt;2776&amp;nbsp; end;&lt;BR /&gt;2777&amp;nbsp; rc=dclose(did);&lt;BR /&gt;2778&amp;nbsp; end;&lt;BR /&gt;2779&amp;nbsp; else put 'Could not open directory';&lt;BR /&gt;2780&amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;Could not open directory&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;NOTE: The data set WORK.FICHIERS_PROFILEA has 0 observations and 1 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;NOTE: DATA statement used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Sep 2017 12:52:29 GMT</pubDate>
    <dc:creator>bemariec</dc:creator>
    <dc:date>2017-09-14T12:52:29Z</dc:date>
    <item>
      <title>probleme with a variable in a %let statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/probleme-with-a-variable-in-a-let-statement/m-p/395890#M278067</link>
      <description>&lt;P&gt;&lt;FONT size="4"&gt;Hi! I did a code to list every folder in a certain path and I sorted them (befor this step) and the folder I'm interested in are in the table "Filenames1593_epuree", witch I called at the end of the macro bellow. It contains 25 folder names.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*****List of all the folders to open****/&lt;/P&gt;&lt;P&gt;/*****determine the number of different name in the table*****/&lt;BR /&gt;%macro ouvrir(table);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;set &amp;amp;table. end=eof;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if eof then call symput('nomdossier',_n_);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*****for every non empty line, attribute a memname into the 'dossier' variable************/&lt;BR /&gt;%do i=1 %to &amp;amp;nomdossier;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;set &amp;amp;table.(where=(numero=&amp;amp;i.));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;call symput('dossier',memname);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;run;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;%put &amp;amp;dossier;&lt;BR /&gt;%end;&lt;BR /&gt;%mend ouvrir;&lt;BR /&gt;%ouvrir(&lt;FONT color="#FF0000"&gt;Filenames1593_epuree&lt;/FONT&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;This macro up here works well. The problem is when I want to use these folder names to open them and get to every file inside of it. I did this bellow and it works well if I test it with a specific folder instead of &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&amp;amp;dossier.&lt;/STRONG&gt;&lt;/FONT&gt; But, when I do it with a variable in de %let statement, I get nothing... (see log message after the code). What am I doing wrong? Thank you very much!!&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;%let rep=\\sdlc000-000010\soutien$\Projets\ORN - STL-0108\Acquisitions\1593\&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&amp;amp;dossier.&lt;/STRONG&gt;&lt;/FONT&gt;;&lt;BR /&gt;&lt;BR /&gt;filename profileA "&amp;amp;rep.";&lt;BR /&gt;&lt;BR /&gt;data fichiers_profileA;&lt;BR /&gt;length name $55;&lt;BR /&gt;drop rc did i;&lt;BR /&gt;did=dopen("profileA");&lt;BR /&gt;if did &amp;gt; 0 then do;&lt;BR /&gt;do i=1 to dnum(did);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;name=dread(did,i);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if findw(name, 'profileA.csv')&amp;gt;0 then output;&lt;BR /&gt;end;&lt;BR /&gt;rc=dclose(did);&lt;BR /&gt;end;&lt;BR /&gt;else put 'Could not open directory';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;log message&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;2764&amp;nbsp; %let rep=\\sdlc000-000010\soutien$\Projets\ORN - STL-0108\Acquisitions\1593\&amp;amp;dossier.;&lt;BR /&gt;&lt;FONT color="#339966"&gt;WARNING: Apparent symbolic reference DOSSIER not resolved.&lt;/FONT&gt;&lt;BR /&gt;2765&lt;BR /&gt;2766&amp;nbsp; filename profileA "&amp;amp;rep.";&lt;BR /&gt;&lt;FONT color="#339966"&gt;WARNING: Apparent symbolic reference DOSSIER not resolved.&lt;/FONT&gt;&lt;BR /&gt;2767&lt;BR /&gt;2768&amp;nbsp; data fichiers_profileA;&lt;BR /&gt;2769&amp;nbsp; length name $55;&lt;BR /&gt;2770&amp;nbsp; drop rc did i;&lt;BR /&gt;2771&amp;nbsp; did=dopen("profileA");&lt;BR /&gt;2772&amp;nbsp; if did &amp;gt; 0 then do;&lt;BR /&gt;2773&amp;nbsp; do i=1 to dnum(did);&lt;BR /&gt;2774&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name=dread(did,i);&lt;BR /&gt;2775&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if findw(name, 'profileA.csv')&amp;gt;0 then output;&lt;BR /&gt;2776&amp;nbsp; end;&lt;BR /&gt;2777&amp;nbsp; rc=dclose(did);&lt;BR /&gt;2778&amp;nbsp; end;&lt;BR /&gt;2779&amp;nbsp; else put 'Could not open directory';&lt;BR /&gt;2780&amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;Could not open directory&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;NOTE: The data set WORK.FICHIERS_PROFILEA has 0 observations and 1 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;NOTE: DATA statement used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 12:52:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/probleme-with-a-variable-in-a-let-statement/m-p/395890#M278067</guid>
      <dc:creator>bemariec</dc:creator>
      <dc:date>2017-09-14T12:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: probleme with a variable in a %let statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/probleme-with-a-variable-in-a-let-statement/m-p/395891#M278068</link>
      <description>&lt;P&gt;Sounds like a macro variable scoping issue, but it is hard to tell from what you posted.&lt;/P&gt;
&lt;P&gt;What happens if you make the macro variable global?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where are you setting the macro variable DOSSIER?&lt;/P&gt;
&lt;P&gt;The only reference I see in you posted code is inside of %DO loop inside of one of the macros you posted. &amp;nbsp;Is that the value you want? If so which version did you want to use?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 13:21:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/probleme-with-a-variable-in-a-let-statement/m-p/395891#M278068</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-09-14T13:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: probleme with a variable in a %let statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/probleme-with-a-variable-in-a-let-statement/m-p/395903#M278069</link>
      <description>I'm such a begginer in all this :|... I created the first macro so I can list every observation from the variable memname in the table "Filenames1593_epuree". You can consider that there is nothing before this macro... So it is the only place where I have defined the variable "dossier" (in the call symput). I try to use this variable "dossier" in the next macro so I can get a new file with all the names of the .csv files that contains "profile.csv" in the name. I tried what you suggested (define the variable dossier in a global statement), but it doesn't help... the log doesn't even give me the kind of error... (see below)&lt;BR /&gt;%macro ouvrir(table);&lt;BR /&gt;data _null_;&lt;BR /&gt;set &amp;amp;table. end=eof;&lt;BR /&gt;if eof then call symput('nomdossier',_n_);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;%do i=1 %to &amp;amp;nomdossier;&lt;BR /&gt;data _null_;&lt;BR /&gt;set &amp;amp;table.(where=(numero=&amp;amp;i.));&lt;BR /&gt;%global dossier;&lt;BR /&gt;call symput('dossier',memname);&lt;BR /&gt;run;&lt;BR /&gt;%put &amp;amp;dossier;&lt;BR /&gt;%end;&lt;BR /&gt;%mend ouvrir;&lt;BR /&gt;%ouvrir(Filenames1593_epuree);&lt;BR /&gt;&lt;BR /&gt;LOG :&lt;BR /&gt;3003 %let rep=\\sdlc000-000010\soutien$\Projets\ORN - STL-0108\Acquisitions\1593\&amp;amp;dossier.;&lt;BR /&gt;3004&lt;BR /&gt;3005 filename profileA "&amp;amp;rep.";&lt;BR /&gt;3006&lt;BR /&gt;3007 data fichiers_profileA;&lt;BR /&gt;3008 length name $55;&lt;BR /&gt;3009 drop rc did i;&lt;BR /&gt;3010 did=dopen("profileA");&lt;BR /&gt;3011 if did &amp;gt; 0 then do;&lt;BR /&gt;3012 do i=1 to dnum(did);&lt;BR /&gt;3013 name=dread(did,i);&lt;BR /&gt;3014 if findw(name, 'profileA.csv')&amp;gt;0 then output;&lt;BR /&gt;3015 end;&lt;BR /&gt;3016 rc=dclose(did);&lt;BR /&gt;3017 end;&lt;BR /&gt;3018 else put 'Could not open directory';&lt;BR /&gt;3019 run;&lt;BR /&gt;&lt;BR /&gt;NOTE: The data set WORK.FICHIERS_PROFILEA has 0 observations and 1 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;BR /&gt;&lt;BR /&gt;you posted: "The only reference I see in you posted code is inside of %DO loop inside of one of the macros you posted. Is that the value you want? If so which version did you want to use?"&lt;BR /&gt;&lt;BR /&gt;I don't understand what is a version of a variable... and yess, the 'dossier' in the %do loop is the variable I want... it is a character variable...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for your patience!!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Sep 2017 13:47:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/probleme-with-a-variable-in-a-let-statement/m-p/395903#M278069</guid>
      <dc:creator>bemariec</dc:creator>
      <dc:date>2017-09-14T13:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: probleme with a variable in a %let statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/probleme-with-a-variable-in-a-let-statement/m-p/395914#M278070</link>
      <description>&lt;P&gt;My quesiton is which of the many values of the dataset variable MEMNAME that you are pushing into the macro variable named DOSSIER with the CALL SYMPUT() function call do you want to access after the macro has finished?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So let's make a simplied version of what it looks like you macro is doing (at least in regard to the setting macro variables). Lets use TEST instead of DOSSIER because it easier for me to spell.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test(N);
%local i;
%global test ;
%do i=1 %to &amp;amp;n ;
  %let test=&amp;amp;i;
  %put &amp;amp;=i &amp;amp;=test ;
%end ;
%mend test;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So now let's see what happens to TEST when I call this macro and what value of TEST it leaves after it finishs.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let test=BEFORE MACRO CALL;
%put &amp;amp;=test;
%test(5);
%put &amp;amp;=test;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So the macro assigned 5 different values to TEST when it was running, but only the last one is available after the macro stops.&lt;/P&gt;
&lt;PRE&gt;1096  %let test=BEFORE MACRO CALL;
1097  %put &amp;amp;=test;
TEST=BEFORE MACRO CALL
1098  %test(5);
I=1 TEST=1
I=2 TEST=2
I=3 TEST=3
I=4 TEST=4
I=5 TEST=5
1099  %put &amp;amp;=test;
TEST=5&lt;/PRE&gt;
&lt;P&gt;What is your actual goal with this program?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 14:09:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/probleme-with-a-variable-in-a-let-statement/m-p/395914#M278070</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-09-14T14:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: probleme with a variable in a %let statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/probleme-with-a-variable-in-a-let-statement/m-p/395929#M278071</link>
      <description>&lt;P&gt;This sounds like you have a data set that is supposed to have&amp;nbsp; a list of file names and then you are searching a directory to see if the specific filename exists in the directory. Is that what you are actually attempting to do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so what will you do when you have the list of found files?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The path you show for your &amp;amp;rep macro variable indicates to me that the name referenced by memname may well be case sensitive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And your current code will only have a value of dossier for the last record in the table after the end of that loop.&lt;/P&gt;
&lt;P&gt;You would have to have the entire&lt;/P&gt;
&lt;PRE&gt;%let rep=\\sdlc000-000010\soutien$\Projets\ORN - STL-0108\Acquisitions\1593\&amp;amp;dossier.;

filename profileA "&amp;amp;rep.";

data fichiers_profileA;
length name $55;
drop rc did i;
did=dopen("profileA");
if did &amp;gt; 0 then do;
do i=1 to dnum(did);
    name=dread(did,i);
    if findw(name, 'profileA.csv')&amp;gt;0 then output;
end;
rc=dclose(did);
end;
else put 'Could not open directory';
run;&lt;/PRE&gt;
&lt;P&gt;Inside the %do loop in your Ouvir macro to have a chance of opening more than one folder. Your output data set would have to change for each value, otherwise you overwrite the set or you would have to append the values to different dataset at each pass through the loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 14:31:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/probleme-with-a-variable-in-a-let-statement/m-p/395929#M278071</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-14T14:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: probleme with a variable in a %let statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/probleme-with-a-variable-in-a-let-statement/m-p/395941#M278072</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/154111"&gt;@bemariec&lt;/a&gt; wrote:&lt;BR /&gt;I'm such a begginer in all this :|..&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;Sometimes not recreating the wheel is a good idea.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;There are a lot of macros on line that cover how to list all files, here's one example from the SAS documentation:&lt;/P&gt;
&lt;H1 class="xis-title"&gt;&lt;STRONG&gt;&lt;FONT size="3"&gt;Example 2: List All Files within a Directory Including Subdirectories&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H1&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#n0js70lrkxo6uvn1fl4a5aafnlgt.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#n0js70lrkxo6uvn1fl4a5aafnlgt.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 14:50:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/probleme-with-a-variable-in-a-let-statement/m-p/395941#M278072</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-14T14:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: probleme with a variable in a %let statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/probleme-with-a-variable-in-a-let-statement/m-p/395950#M278073</link>
      <description>&lt;P&gt;Use %global dossier inside the macro.&lt;/P&gt;&lt;P&gt;Hope this will solve your pbm.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 15:01:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/probleme-with-a-variable-in-a-let-statement/m-p/395950#M278073</guid>
      <dc:creator>chithra</dc:creator>
      <dc:date>2017-09-14T15:01:44Z</dc:date>
    </item>
  </channel>
</rss>

