<?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 Macro in Prxchange didnt' work in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-in-Prxchange-didnt-work/m-p/726430#M225711</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;I would like to replace 'CLEFT LIP / CLEFT PALATE / CLEFT PALETTE' with 'UAIRWAY' in the sample dataset 'Have.'&amp;nbsp;&amp;nbsp; I created a macro list 'Uairway_name.'&amp;nbsp;&amp;nbsp; I found the macro could not be recognized in the Prxchange command.&amp;nbsp;&amp;nbsp; Please help me to fix it.&amp;nbsp; Also,&amp;nbsp;is there any limitation for the text length in the Prxchange?&amp;nbsp;&amp;nbsp; My real texts need to be replaced are over 500 character long.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;
      infile datalines delimiter='/';
  input Disease : $300.  ;
datalines;
	CLEFT PALETTE, ADHD, CHRONIC RHINITIS /
	HAVING A GTUBE, ENCEPHALOMALACIA, HIDRADENITIS, AUTISM/
	ENCEPHALOPATHY, GTUBE SUPPORTIVE, HEP C EXPOSURE /
	AUTISM SPECTRUM, SPEECH &amp;amp; COGNITIVE DELAY, CLEFT LIP
;
run;

data AIRWAY_Name;
  infile datalines dsd;
  input  Name : $50. ;
datalines;
	CLEFT LIP, 
	CLEFT PALATE,
	CLEFT PALETTE
	;
run;

options noquotelenmax;
proc sql;
	select trim(Name) into : Uairway_name separated by '|'  from AIRWAY_Name;
quit;

%put &amp;amp;Uairway_name;

data dataout;
	set Have;
	Disease2 = prxchange('s/[^,]*(&amp;amp;Uairway_name.)[^,]*/UAIRWAY/i',              -1, Disease); 
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Mar 2021 15:24:17 GMT</pubDate>
    <dc:creator>ybz12003</dc:creator>
    <dc:date>2021-03-15T15:24:17Z</dc:date>
    <item>
      <title>Macro in Prxchange didnt' work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-in-Prxchange-didnt-work/m-p/726430#M225711</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;I would like to replace 'CLEFT LIP / CLEFT PALATE / CLEFT PALETTE' with 'UAIRWAY' in the sample dataset 'Have.'&amp;nbsp;&amp;nbsp; I created a macro list 'Uairway_name.'&amp;nbsp;&amp;nbsp; I found the macro could not be recognized in the Prxchange command.&amp;nbsp;&amp;nbsp; Please help me to fix it.&amp;nbsp; Also,&amp;nbsp;is there any limitation for the text length in the Prxchange?&amp;nbsp;&amp;nbsp; My real texts need to be replaced are over 500 character long.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;
      infile datalines delimiter='/';
  input Disease : $300.  ;
datalines;
	CLEFT PALETTE, ADHD, CHRONIC RHINITIS /
	HAVING A GTUBE, ENCEPHALOMALACIA, HIDRADENITIS, AUTISM/
	ENCEPHALOPATHY, GTUBE SUPPORTIVE, HEP C EXPOSURE /
	AUTISM SPECTRUM, SPEECH &amp;amp; COGNITIVE DELAY, CLEFT LIP
;
run;

data AIRWAY_Name;
  infile datalines dsd;
  input  Name : $50. ;
datalines;
	CLEFT LIP, 
	CLEFT PALATE,
	CLEFT PALETTE
	;
run;

options noquotelenmax;
proc sql;
	select trim(Name) into : Uairway_name separated by '|'  from AIRWAY_Name;
quit;

%put &amp;amp;Uairway_name;

data dataout;
	set Have;
	Disease2 = prxchange('s/[^,]*(&amp;amp;Uairway_name.)[^,]*/UAIRWAY/i',              -1, Disease); 
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 15:24:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-in-Prxchange-didnt-work/m-p/726430#M225711</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2021-03-15T15:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in Prxchange didnt' work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-in-Prxchange-didnt-work/m-p/726435#M225714</link>
      <description>&lt;P&gt;The macro processor ignores strings bounded by single quotes.&amp;nbsp; Use double quotes instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS Why did you indent your in-line data lines?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 15:41:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-in-Prxchange-didnt-work/m-p/726435#M225714</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-15T15:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in Prxchange didnt' work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-in-Prxchange-didnt-work/m-p/726451#M225719</link>
      <description>&lt;P&gt;I put double quote in the macro list, still did not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;
	select quote(trim(Name)) into : Uairway_name separated by '|'  from AIRWAY_Name;
quit;

%put &amp;amp;Uairway_name;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Mar 2021 16:48:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-in-Prxchange-didnt-work/m-p/726451#M225719</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2021-03-15T16:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in Prxchange didnt' work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-in-Prxchange-didnt-work/m-p/726455#M225720</link>
      <description>&lt;P&gt;Don't add quotes into your strings.&amp;nbsp; Use double quotes when referencing you macro variable.&lt;/P&gt;
&lt;P&gt;The macro processor ignores the strings in single quotes so:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;'&amp;amp;mvar'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is the string &amp;amp;mvar.&lt;/P&gt;
&lt;P&gt;While&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"&amp;amp;mvar"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Will replace &amp;amp;MVAR with value of the MVAR macro variable.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 16:53:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-in-Prxchange-didnt-work/m-p/726455#M225720</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-15T16:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macro in Prxchange didnt' work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-in-Prxchange-didnt-work/m-p/726479#M225728</link>
      <description>Tom, it's working. Thanks.</description>
      <pubDate>Mon, 15 Mar 2021 17:39:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-in-Prxchange-didnt-work/m-p/726479#M225728</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2021-03-15T17:39:19Z</dc:date>
    </item>
  </channel>
</rss>

