<?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: Ignore macro function into a string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887270#M350553</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let macrovariable=%str(url=blogs.sas.com/content/sastraining/2011/09/23/sas-authors-tip-macro-functions-eval-and-sysevalf/#:~:text=);

%put &amp;amp;macrovariable;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 01 Aug 2023 11:30:28 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-08-01T11:30:28Z</dc:date>
    <item>
      <title>Ignore macro function into a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887267#M350552</link>
      <description>&lt;P&gt;Dear expert&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following url:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;url=blogs.sas.com/content/sastraining/2011/09/23/sas-authors-tip-macro-functions-eval-and-sysevalf/#:~:text=The %EVAL function&lt;BR /&gt;evaluates expressions using integer arithmetic.,in more detail how to construct macro expressions. ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I'm trying to store it into a macro var, without getting the %eval function getting interpreted by the compiler&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The final outcome I expect to be stored in the macro var is to have the URL stored as text into single quotes ( " ' " + &amp;amp;url + " ' ")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any hints appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 11:27:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887267#M350552</guid>
      <dc:creator>dcortell</dc:creator>
      <dc:date>2023-08-01T11:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore macro function into a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887270#M350553</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let macrovariable=%str(url=blogs.sas.com/content/sastraining/2011/09/23/sas-authors-tip-macro-functions-eval-and-sysevalf/#:~:text=);

%put &amp;amp;macrovariable;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Aug 2023 11:30:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887270#M350553</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-01T11:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore macro function into a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887278#M350559</link>
      <description>&lt;P&gt;You have cut the url address. The full address include the %EVAL keywords, which is generating errors described above&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 11:47:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887278#M350559</guid>
      <dc:creator>dcortell</dc:creator>
      <dc:date>2023-08-01T11:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore macro function into a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887282#M350563</link>
      <description>&lt;P&gt;Is this what you want?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; %let macrovariable=%nrstr('url=blogs.sas.com/content/sastraining/2011/09/23/sas-authors-tip-macro-functions-eval-and-sysevalf/#:~:text=The %EVAL function
evaluates expressions using integer arithmetic.,in more detail how to construct macro expressions. ;');
 %put &amp;amp;macrovariable;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Aug 2023 11:57:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887282#M350563</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-01T11:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore macro function into a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887283#M350564</link>
      <description>&lt;P&gt;I don't understand.&lt;/P&gt;
&lt;P&gt;The value you showed does not have any %EVAL() function call.&lt;/P&gt;
&lt;P&gt;If the goal is to enclose the value in single quotes why not just do that?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let url='some string in quotes';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Are you saying you want to create part of the string from the value of some macro code?&amp;nbsp; If so then try using %BQUOTE() to allow the macro code to resolve inside the single quotes.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let word=string;
%let url=%bquote('some &amp;amp;word. in quotes');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Aug 2023 12:00:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887283#M350564</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-08-01T12:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore macro function into a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887286#M350565</link>
      <description>&lt;P&gt;If you want the string in single quotes, the easiest thing to do is write the single quotes.&amp;nbsp; They will hide any macro triggers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let url='blogs.sas.com/content/sastraining/2011/09/23/sas-authors-tip-macro-functions-eval-and-sysevalf/#:~:text=The %EVAL function
evaluates expressions using integer arithmetic.,in more detail how to construct macro expressions. ' ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Aug 2023 12:04:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887286#M350565</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-08-01T12:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore macro function into a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887287#M350566</link>
      <description>&lt;P&gt;Yeah, I think we are near a solution. So the URLs are extracted iteratively in a code. A proxy is the following:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data test;
url='blogs.sas.com/content/sastraining/2011/09/23/sas-authors-tip-macro-functions-eval-and-sysevalf/#:~:text=The %EVAL function 
evaluates expressions using integer arithmetic.,in more detail how to construct macro expressions.';
run;


proc sql;
select strip(url)into:url
from test;
quit;


%let urls=%nrstr(&amp;amp;url);

%put &amp;amp;urls;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The %nrstr seems stopping the %Eval triggering in the text but does not allow the first macro var to resolve.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 12:05:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887287#M350566</guid>
      <dc:creator>dcortell</dc:creator>
      <dc:date>2023-08-01T12:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore macro function into a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887291#M350568</link>
      <description>&lt;P&gt;There is an %EVAL keyword in the text of the URL. URls are extracted iteratively from a dataset. So proxy code like this, using your suggestion:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data test;
url='blogs.sas.com/content/sastraining/2011/09/23/sas-authors-tip-macro-functions-eval-and-sysevalf/#:~:text=The %EVAL function 
evaluates expressions using integer arithmetic.,in more detail how to construct macro expressions.';
run;


proc sql;
select strip(url)into:url
from test;
quit;


%let urls=%bquote('&amp;amp;url');

%put &amp;amp;urls;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Error generated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt; SYMBOLGEN:  Macro variable URL resolves to 
             blogs.sas.com/content/sastraining/2011/09/23/sas-authors-tip-macro-functions-eval-and-sysevalf/#:~:text=The %EVAL 
             function evaluates expressions using integer arithmetic.,in more detail how to construct macro expressions.
 ERROR: %EVAL must be followed by an expression enclosed in parentheses.
 ERROR: %EVAL must be followed by an expression enclosed in parentheses.
 83         
 84         
 85         %let urls=%bquote('&amp;amp;url');
 86         
 87         %put &amp;amp;urls;
 SYMBOLGEN:  Macro variable URLS resolves to 
             'blogs.sas.com/content/sastraining/2011/09/23/sas-authors-tip-macro-functions-eval-and-sysevalf/#:~:text=The %EVAL 
             function evaluates expressions using integer arithmetic.,in more detail how to construct macro expressions.'
 SYMBOLGEN:  Some characters in the above value which were subject to macro quoting have been unquoted for printing.
 ERROR: %EVAL must be followed by an expression enclosed in parentheses.
 'blogs.sas.com/content/sastraining/2011/09/23/sas-authors-tip-macro-functions-eval-and-sysevalf/#:~:text=The %EVAL function 
 evaluates expressions using integer arithmetic.,in more detail how to construct macro expressions.'&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 12:09:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887291#M350568</guid>
      <dc:creator>dcortell</dc:creator>
      <dc:date>2023-08-01T12:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore macro function into a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887292#M350569</link>
      <description>&lt;P&gt;If you want to resolve a macro variable and then mask any macro triggers that results from that resolution, you need %SUPERQ.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
url='blogs.sas.com/content/sastraining/2011/09/23/sas-authors-tip-macro-functions-eval-and-sysevalf/#:~:text=The %EVAL function 
evaluates expressions using integer arithmetic.,in more detail how to construct macro expressions.';
call symputx('url',url) ;
run;

%let urls=%superq(url) ;

%put &amp;amp;=urls ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Aug 2023 12:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887292#M350569</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-08-01T12:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore macro function into a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887293#M350570</link>
      <description>&lt;P&gt;So now you have introduced data steps and SQL into this process. Why?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Its not clear to me where you are going — you seem to know but I don't understand.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, I think&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;&amp;nbsp;has solved the problem by masking properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 12:15:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887293#M350570</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-01T12:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore macro function into a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887298#M350572</link>
      <description>&lt;PRE&gt;&lt;CODE class=""&gt;&lt;BR /&gt;&lt;BR /&gt; 73         data test;
 74         url='blogs.sas.com/content/sastraining/2011/09/23/sas-authors-tip-macro-functions-eval-and-sysevalf/#:~:text=The %EVAL
 74       ! function
 75         evaluates expressions using integer arithmetic.,in more detail how to construct macro expressions.';
 76         call symputx('url',url);
 77         run;
 
 NOTE: The data set WORK.TEST has 1 observations and 1 variables.
 NOTE: Compressing data set WORK.TEST increased size by 100.00 percent. 
       Compressed is 2 pages; un-compressed would require 1 pages.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 SYMBOLGEN:  Macro variable URL resolves to 
             blogs.sas.com/content/sastraining/2011/09/23/sas-authors-tip-macro-functions-eval-and-sysevalf/#:~:text=The %EVAL 
             function evaluates expressions using integer arithmetic.,in more detail how to construct macro expressions.
 ERROR: %EVAL must be followed by an expression enclosed in parentheses.
 ERROR: Invalid symbolic variable name 
        BLOGS.SAS.COM/CONTENT/SASTRAINING/2011/09/23/SAS-AUTHORS-TIP-MACRO-FUNCTIONS-EVAL-AND-SYSEVALF/#:~:TEXT=THE %EVAL FUNCTION 
        EVALUATES EXPRESSIONS USING INTEGER ARITHMETIC.,IN MORE DETAIL HOW TO CONSTRUCT MACRO EXPRESSIONS..&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Still getting the %EVAL error triggered&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 12:25:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887298#M350572</guid>
      <dc:creator>dcortell</dc:creator>
      <dc:date>2023-08-01T12:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore macro function into a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887301#M350574</link>
      <description>&lt;P&gt;Sorry, I checked and the function doesn't need the "&amp;amp;" for the macro recall. Terrific. Amazing function to know!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 12:32:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887301#M350574</guid>
      <dc:creator>dcortell</dc:creator>
      <dc:date>2023-08-01T12:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore macro function into a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887302#M350575</link>
      <description>&lt;P&gt;The log is NOT showing the statement that triggered that note.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please show the code you used.&lt;/P&gt;
&lt;P&gt;Did you call the %SUPERQ() function? Did you make sure to pass it just the NAME of the macro variable you want quoted?&amp;nbsp; Not the VALUE of the macro variable.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 12:35:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ignore-macro-function-into-a-string/m-p/887302#M350575</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-08-01T12:35:39Z</dc:date>
    </item>
  </channel>
</rss>

