<?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: Macro Not Carrying Through Variable in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567935#M11599</link>
    <description>&lt;P&gt;The variable is the "Variable" created from the symputx. I just need it to carry through to the rest of the macro. The table creation and reporting is done for a metric&amp;nbsp;(ex: HR) and then moves on to the next metric, with a list imported through a csv file. I guess the real question is after the symputx, how do I call that variable in the next data step.&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jun 2019 14:40:21 GMT</pubDate>
    <dc:creator>Josh123</dc:creator>
    <dc:date>2019-06-21T14:40:21Z</dc:date>
    <item>
      <title>Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567909#M11590</link>
      <description>&lt;P&gt;Hello Everyone and thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a macro producing a number of tables through a loop, but the value of &amp;amp;variable defined in the symputx command is not carrying through to the rest of the macro. Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;NOPRINT&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/*select name into :varlist separated by ' '*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; _Null_ &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; * &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; temp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; m=&amp;amp;sqlobs;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;m;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;%macro&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; tablecreate (Variable);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; i=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%to&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;m;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;i; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data tempmod;&lt;/P&gt;&lt;P&gt;set temp;&lt;/P&gt;&lt;P&gt;where seq=&amp;amp;i;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;call symputx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Variable'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;||trim(left(_n_)), Test);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;data resultsmerged2; set resultsmerged2;&lt;/P&gt;&lt;P&gt;retain base_val;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;if timeptno=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; then&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do;&lt;/P&gt;&lt;P&gt;base_val = &amp;amp;variable;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;change_bl = &amp;amp;variable-base_val;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; tablecreate;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 13:38:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567909#M11590</guid>
      <dc:creator>Josh123</dc:creator>
      <dc:date>2019-06-21T13:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567917#M11593</link>
      <description>&lt;P&gt;Which macro variable are you asking about?&lt;/P&gt;
&lt;P&gt;The macro definition defines VARIABLE as a parameter. So there is a macro variable named VARIABLE.&amp;nbsp; But I don't see any attempt to change the value of it over what it got when the macro was called.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The CALL SYMPUTX() function call is creating a&amp;nbsp; series of macro variables named VARIABLE1 to VARIABLE&amp;lt;n&amp;gt; where N is the number of observations in TEMP that have the variable SEQ equal to your loop counter &amp;amp;I.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 14:13:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567917#M11593</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-06-21T14:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567919#M11594</link>
      <description>&lt;P&gt;You are creating the variable in a macro without defining it global, so it will be local to the macro and vanish as soon as the macro stops executing.&lt;/P&gt;
&lt;P&gt;Add "g" as third parameter to the call symputx().&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 14:18:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567919#M11594</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-21T14:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567921#M11595</link>
      <description>&lt;P&gt;PS I am 90% sure that what you try to achieve can be done without macro coding, either by joining temp to your data or by using call execute() off it.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 14:20:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567921#M11595</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-21T14:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567935#M11599</link>
      <description>&lt;P&gt;The variable is the "Variable" created from the symputx. I just need it to carry through to the rest of the macro. The table creation and reporting is done for a metric&amp;nbsp;(ex: HR) and then moves on to the next metric, with a list imported through a csv file. I guess the real question is after the symputx, how do I call that variable in the next data step.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 14:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567935#M11599</guid>
      <dc:creator>Josh123</dc:creator>
      <dc:date>2019-06-21T14:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567965#M11602</link>
      <description>You need to add a parameter scope to the CALL SYMPUTX(). You're creating the macro variable, but only within the macro and hten outside of the macro it doesn't exist. This is a concept known as 'scope' of a variable. &lt;BR /&gt;&lt;BR /&gt;CALL SYMPUTX() has a third parameter that allows you to set the variable as global or local, you want to set it to global.&lt;BR /&gt;&lt;BR /&gt;call symputx(..., ...., 'g')&lt;BR /&gt;&lt;BR /&gt;Everyone else's comments are also valid though.</description>
      <pubDate>Fri, 21 Jun 2019 15:37:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567965#M11602</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-21T15:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567984#M11604</link>
      <description>&lt;P&gt;Thank you for your reply. I'm trying to use &amp;amp;variable in the next step inside the macro, but it's not recognizing the variable as populated.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 16:07:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567984#M11604</guid>
      <dc:creator>Josh123</dc:creator>
      <dc:date>2019-06-21T16:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567985#M11605</link>
      <description>Have you tried the solutions posted, changing the scope in your CALL SYMPUTX()? That should solve your problem. If, not please post the code you ran and the log that indicate the errors.</description>
      <pubDate>Fri, 21 Jun 2019 16:11:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567985#M11605</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-21T16:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567988#M11606</link>
      <description>&lt;P&gt;I see no use of macro variable &amp;amp;variable1. or similar in this macro code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro tablecreate (Variable);
%do i=1 %to &amp;amp;m;
  %put &amp;amp;i;

data tempmod;
set temp;
where seq=&amp;amp;i;
call symputx('Variable'||trim(left(_n_)), Test);
run;

data resultsmerged2; set resultsmerged2;
retain base_val;
if timeptno=1 then do;
  base_val = &amp;amp;variable;
end;
change_bl = &amp;amp;variable-base_val;
run;

.

.

.

%end;
%mend tablecreate;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jun 2019 16:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567988#M11606</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-21T16:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567993#M11607</link>
      <description>&lt;P&gt;With both updates:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;NOPRINT&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/*select name into :varlist separated by ' '*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; _Null_ &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; * &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; temp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; m=&amp;amp;sqlobs;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;m;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;%macro&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; tablecreate (Variable);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; i=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%to&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;m;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;i; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data tempmod;&lt;/P&gt;&lt;P&gt;set temp;&lt;/P&gt;&lt;P&gt;where seq=&amp;amp;i;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;call symputx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Variable'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;||trim(left(_n_)), Test, &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'g'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;data resultsmerged2; set resultsmerged2;&lt;/P&gt;&lt;P&gt;retain base_val;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;if timeptno=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; then&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do;&lt;/P&gt;&lt;P&gt;base_val = &amp;amp;variable&amp;amp;i;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;change_bl = &amp;amp;variable&amp;amp;i-base_val;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; tablecreate;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;tablecreate&lt;/I&gt;&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Log doesn't show any errors but all records are now producing a value of 1 for base_val and 0 for change_bl. I'm try to take the variable name from the import and use it as the field name in dataset resultsmerged2. Any other ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 16:44:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567993#M11607</guid>
      <dc:creator>Josh123</dc:creator>
      <dc:date>2019-06-21T16:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567996#M11608</link>
      <description>So the original problem is solved and you now have further errors. This is kind of a painful back and forth here. Can you maybe start at the beginning, explain what you're trying to solve and we can offer some suggestions? I feel like this is an XY problem.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;The XY problem is a communication problem encountered in help desk and similar situations in which the real issue, X, of the person asking for help is obscured, because instead of asking directly about issue X, they ask how to solve a secondary issue, Y, which they believe will allow them to resolve issue X. However, resolving issue Y often does not resolve issue X, or is a poor way to resolve it, and the obscuring of the real issue and the introduction of the potentially strange secondary issue can lead to the person trying to help having unnecessary difficulties in communication and offering poor solutions.</description>
      <pubDate>Fri, 21 Jun 2019 16:58:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/567996#M11608</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-21T16:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/568009#M11609</link>
      <description>&lt;P&gt;Fair enough:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm importing a dataset that translates a text string&amp;nbsp;(a) to another text string (b). I need to then take (b) and use it as a field reference in another dataset. I'm looping through the initial dataset of a to b conversions and for each (b) taking metrics from the field in dataset resultsmerged2. So for example, the first (b) is HR, so I need to add HR to &amp;amp;variable and use it in calculations in the calculation for baseline and change from baseline. Everything works until I try to use the variable. The data tempmod needs to define&amp;nbsp;&amp;amp;variable somehow so I can use it in other sections of the same macro. I can try to explain anything else that is unclear&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Josh&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 17:39:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/568009#M11609</guid>
      <dc:creator>Josh123</dc:creator>
      <dc:date>2019-06-21T17:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/568015#M11610</link>
      <description>&lt;P&gt;Most of it is unclear.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is clear is that you have not understood the early suggestions that you need to reference the macro variable that you actually created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example this CALL SYMPUTX() function call is creating a macro variable name MYVARNAME with the value HR. Then the PROC MEANS step is using that macro variable in the VAR statement so that the variable named HR in the dataset named MYDATA is what is being analyzed.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  call symputx('MYVARNAME','HR');
run;
proc means data=mydata;
  var &amp;amp;myvarname;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jun 2019 18:06:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/568015#M11610</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-06-21T18:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/568021#M11612</link>
      <description>And you're positive you can't use BY group processing to do all of these groups at once?</description>
      <pubDate>Fri, 21 Jun 2019 18:12:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/568021#M11612</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-21T18:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/568032#M11613</link>
      <description>&lt;P&gt;I appreciate the response. While I may not have understood, the issue is directly between the variable declaration and usage in the following data step. Rather than try to reinvent the wheel here, I am looking for a solution to how to call the previous variable defined as &amp;amp;variable. None of the suggestions thus far have worked, so still trying to find a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Josh&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 18:38:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/568032#M11613</guid>
      <dc:creator>Josh123</dc:creator>
      <dc:date>2019-06-21T18:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/568035#M11614</link>
      <description>You need to resolve it as &amp;amp;&amp;amp;Variable&amp;amp;i. &lt;BR /&gt;</description>
      <pubDate>Fri, 21 Jun 2019 18:44:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/568035#M11614</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-21T18:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Not Carrying Through Variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/568038#M11615</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/278787"&gt;@Josh123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I appreciate the response. While I may not have understood, the issue is directly between the variable declaration and usage in the following data step. Rather than try to reinvent the wheel here, I am looking for a solution to how to call the previous variable defined as &amp;amp;variable. None of the suggestions thus far have worked, so still trying to find a solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Josh&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You did NOT create a macro variable named VARIABLE.&lt;/P&gt;
&lt;P&gt;You created a variable named VARIABLE1 (and possibly some other macro variables, we cannot tell with out data or at least SAS log).&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 18:51:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro-Not-Carrying-Through-Variable/m-p/568038#M11615</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-06-21T18:51:33Z</dc:date>
    </item>
  </channel>
</rss>

