<?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 put a macro variable in character search in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-a-macro-variable-in-character-search/m-p/396794#M278202</link>
    <description>&lt;P&gt;What do you get in the log? How many records are witten to fichiers_ProfileA?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would add some PUT statments to help with debugging, e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; data fichiers_profileA;
    length name $55;
    drop rc did i;
    did=dopen("profileA");

    put did= ;
    
    if did &amp;gt; 0 then do;
        do i=1 to dnum(did);
            name=dread(did,i);

            put i= name= ;

            if findw(name,'ProfileA.csv')&amp;gt;0 then output;
        end;
        rc=dclose(did);
    end;
    else put 'Could not open directory';
 run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 18 Sep 2017 12:41:01 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2017-09-18T12:41:01Z</dc:date>
    <item>
      <title>How to put a macro variable in character search</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-a-macro-variable-in-character-search/m-p/396782#M278201</link>
      <description>&lt;P&gt;&amp;nbsp;In this code bellow, I'm trying to put a varaiable for the letter A in the word ProfileA. I want to bea able to do it for ProfileB and ProfileC.&lt;/P&gt;&lt;P&gt;I've tried to put the variable &amp;amp;profile. to replace every "A" in the programme but it gives me empty table... No error in the log... So I figured that the problem was in the&lt;FONT color="#FF0000"&gt; did=dopen("ProfileA")&lt;/FONT&gt; or in the &lt;FONT color="#FF0000"&gt;findw(name,'ProfileA.csv') section... &lt;FONT color="#000000"&gt;Hoe can I do to make it work?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;Thank you!&lt;/FONT&gt;&lt;/FONT&gt;&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;%macro ouvrir(table,orni);&lt;BR /&gt;proc delete data=fichiers_profileA_&amp;amp;orni. fichiers_profileA;&lt;BR /&gt;run;quit;&lt;BR /&gt;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;BR /&gt;&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;%global dossier;&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;&lt;BR /&gt;/*****Faire la table avec tous les noms de fichiers*******/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;%let rep=\\sdlc000-000010\soutien$\Projets\ORN - STL-0108\Acquisitions\&amp;amp;orni.\&amp;amp;dossier.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;filename profileA "&amp;amp;rep.";&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;data fichiers_profileA;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;length name $55;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;drop rc did i;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;FONT color="#FF0000"&gt;did=dopen("profileA")&lt;/FONT&gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if did &amp;gt; 0 then do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;do i=1 to dnum(did);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;name=dread(did,i);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if &lt;FONT color="#FF0000"&gt;findw(name,'ProfileA.csv')&lt;/FONT&gt;&amp;gt;0 then output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;rc=dclose(did);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;else put 'Could not open directory';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;run;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;proc append data=fichiers_profileA base=fichiers_profileA_&amp;amp;orni.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;run;quit;&lt;BR /&gt;%end;&lt;BR /&gt;%mend ouvrir;&lt;BR /&gt;%ouvrir(Filenames1593_epuree,1593);&lt;BR /&gt;%ouvrir(Filenames4906_epuree,4906);&lt;BR /&gt;%ouvrir(Filenames6361_epuree,6361);&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 12:10:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-put-a-macro-variable-in-character-search/m-p/396782#M278201</guid>
      <dc:creator>bemariec</dc:creator>
      <dc:date>2017-09-18T12:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to put a macro variable in character search</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-a-macro-variable-in-character-search/m-p/396794#M278202</link>
      <description>&lt;P&gt;What do you get in the log? How many records are witten to fichiers_ProfileA?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would add some PUT statments to help with debugging, e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; data fichiers_profileA;
    length name $55;
    drop rc did i;
    did=dopen("profileA");

    put did= ;
    
    if did &amp;gt; 0 then do;
        do i=1 to dnum(did);
            name=dread(did,i);

            put i= name= ;

            if findw(name,'ProfileA.csv')&amp;gt;0 then output;
        end;
        rc=dclose(did);
    end;
    else put 'Could not open directory';
 run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Sep 2017 12:41:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-put-a-macro-variable-in-character-search/m-p/396794#M278202</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2017-09-18T12:41:01Z</dc:date>
    </item>
  </channel>
</rss>

