<?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: passing an equals sign in a macro value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/passing-an-equals-sign-in-a-macro-value/m-p/937307#M368292</link>
    <description>&lt;P&gt;You don't need %str macro function there, there is nothing to mask.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;E.g.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let ren= (age=age_group sex=sex_group height=height_group); 
%put &amp;amp;=ren; 

data have;
	set sashelp.class (rename=&amp;amp;ren);
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;1    %let ren= (pbp_a_hnumber=H_Number pbp_a_plan_identifier=Plan_ID
1  ! segment_id=Segment_ID);
2
3    %put &amp;amp;=ren;
REN=(pbp_a_hnumber=H_Number pbp_a_plan_identifier=Plan_ID segment_id=Segment_ID)
4    %let ren= (age=age_group sex=sex_group height=height_group);
5
6    %put &amp;amp;=ren;
REN=(age=age_group sex=sex_group height=height_group)
7    data have;
8        set sashelp.class (rename=&amp;amp;ren);
9    run;

NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.HAVE has 19 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds

&lt;/PRE&gt;
&lt;P&gt;I would double check the syntax.&amp;nbsp; As you see in example above equal signs passes into macro var without issue.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jul 2024 20:37:46 GMT</pubDate>
    <dc:creator>A_Kh</dc:creator>
    <dc:date>2024-07-26T20:37:46Z</dc:date>
    <item>
      <title>passing an equals sign in a macro value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/passing-an-equals-sign-in-a-macro-value/m-p/937305#M368291</link>
      <description>&lt;P&gt;I want to rename the same three variables across a group of files.&amp;nbsp; &amp;nbsp;Thought %str would work, but it didn't&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;27 %let ren=%str(pbp_a_hnumber=H_Number&amp;nbsp;pbp_a_plan_identifier=Plan_ID segment_id=Segment_ID);&amp;nbsp;&lt;BR /&gt;28&lt;BR /&gt;27 %let ren=%str(pbp_a_hnumber=H_Number&amp;nbsp;pbp_a_plan_identifier=Plan_ID segment_id=Segment_ID);&amp;nbsp;&lt;BR /&gt;_&lt;BR /&gt;180&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;29 Data pbp_b1a;&lt;/P&gt;&lt;P&gt;30 set D107342.pbp_b1a (keep=&amp;amp;keepvars pbp_b1a_auth_yn&lt;BR /&gt;___&lt;BR /&gt;180&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;31 rename=(&lt;BR /&gt;32 %bquote(&amp;amp;ren)&lt;BR /&gt;33 pbp_b1a_auth_yn=inpatient_acute_auth&lt;BR /&gt;34 ));&lt;/P&gt;&lt;P&gt;35 run;&lt;BR /&gt;36&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 20:12:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/passing-an-equals-sign-in-a-macro-value/m-p/937305#M368291</guid>
      <dc:creator>Batman</dc:creator>
      <dc:date>2024-07-26T20:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: passing an equals sign in a macro value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/passing-an-equals-sign-in-a-macro-value/m-p/937307#M368292</link>
      <description>&lt;P&gt;You don't need %str macro function there, there is nothing to mask.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;E.g.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let ren= (age=age_group sex=sex_group height=height_group); 
%put &amp;amp;=ren; 

data have;
	set sashelp.class (rename=&amp;amp;ren);
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;1    %let ren= (pbp_a_hnumber=H_Number pbp_a_plan_identifier=Plan_ID
1  ! segment_id=Segment_ID);
2
3    %put &amp;amp;=ren;
REN=(pbp_a_hnumber=H_Number pbp_a_plan_identifier=Plan_ID segment_id=Segment_ID)
4    %let ren= (age=age_group sex=sex_group height=height_group);
5
6    %put &amp;amp;=ren;
REN=(age=age_group sex=sex_group height=height_group)
7    data have;
8        set sashelp.class (rename=&amp;amp;ren);
9    run;

NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.HAVE has 19 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds

&lt;/PRE&gt;
&lt;P&gt;I would double check the syntax.&amp;nbsp; As you see in example above equal signs passes into macro var without issue.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 20:37:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/passing-an-equals-sign-in-a-macro-value/m-p/937307#M368292</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2024-07-26T20:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: passing an equals sign in a macro value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/passing-an-equals-sign-in-a-macro-value/m-p/937308#M368293</link>
      <description>&lt;P&gt;Missing some bits. For you to get that error on line 27 something else is likely going before line 27 that is making that %let have a problem. Also, please post LOG text into a text box opened on the forum with the &amp;lt;/&amp;gt; icon above the main message window. That will have the diagnostic characters, such as the underscore that appears above the 180, in the proper position relative to the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Strongly suggest that you show the code submitted before this along with this code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 20:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/passing-an-equals-sign-in-a-macro-value/m-p/937308#M368293</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-07-26T20:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: passing an equals sign in a macro value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/passing-an-equals-sign-in-a-macro-value/m-p/937309#M368294</link>
      <description>Yes, just determined there were hidden characters messing things up.</description>
      <pubDate>Fri, 26 Jul 2024 20:43:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/passing-an-equals-sign-in-a-macro-value/m-p/937309#M368294</guid>
      <dc:creator>Batman</dc:creator>
      <dc:date>2024-07-26T20:43:28Z</dc:date>
    </item>
  </channel>
</rss>

