<?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: Saving macro values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Saving-macro-values/m-p/451950#M114028</link>
    <description>&lt;P&gt;Always post into the code windows while they are open (Pop-up). Posting into the field within the main posting window eats linefeeds.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Apr 2018 15:23:41 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-04-06T15:23:41Z</dc:date>
    <item>
      <title>Saving macro values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-macro-values/m-p/451857#M113997</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to save parameters as a macro:&lt;/P&gt;&lt;PRE&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;CODE class=" language-sas"&gt;data t0;
length Parameter $15;
input Parameter $ Estimate;
datalines;
Intercept 1132
;
run;

*store the estimated parameters;
data _null_;
 set t0;
 if Parameter = "Intercept" then 
 call symput('Ibar', Esimate);
run;

%put &amp;amp;Ibar;&lt;/CODE&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the message that IBar was not saved properly:&lt;/P&gt;&lt;P&gt;SYMBOLGEN: Macro variable IBAR resolves to .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why can"t I save the value?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 13:16:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-macro-values/m-p/451857#M113997</guid>
      <dc:creator>GKati</dc:creator>
      <dc:date>2018-04-06T13:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Saving macro values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-macro-values/m-p/451863#M114000</link>
      <description>&lt;P&gt;Look at your second parameter of call symput. It's misspelled.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 13:25:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-macro-values/m-p/451863#M114000</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-06T13:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Saving macro values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-macro-values/m-p/451864#M114001</link>
      <description>&lt;P&gt;Is that exactly how you typed it, with many SAS commands on the same line?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not only is this a bad practice, but I believe it is why the commands fail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to put each command on it's own line&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Furthermore the line that reads&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Intercept 1132&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;should be on a line without a semicolon, and the semicolon that follows should be on the next line.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, you need to spell the variable name&amp;nbsp;&lt;EM&gt;exactly the same&lt;/EM&gt; in both the DATA T0; step, and in the DATA _NULL_; step.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 13:29:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-macro-values/m-p/451864#M114001</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-04-06T13:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Saving macro values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-macro-values/m-p/451866#M114003</link>
      <description>&lt;P&gt;Your corrected code, posted with the "little running man", looks like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data t0;
length Parameter $15;
input Parameter $ Estimate;
datalines;
Intercept 1132
;
run;

*store the estimated parameters;
data _null_;
set t0;
if Parameter = "Intercept" then call symput('Ibar', Estimate);
run;

%put &amp;amp;Ibar;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can see the advantages of posting code in the right manner.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 13:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-macro-values/m-p/451866#M114003</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-06T13:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Saving macro values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-macro-values/m-p/451871#M114005</link>
      <description>&lt;P&gt;Thanks for the help. This was copy-pasted in the "running man" line by line as suggested below. I don't know why the display changed after posting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 13:40:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-macro-values/m-p/451871#M114005</guid>
      <dc:creator>GKati</dc:creator>
      <dc:date>2018-04-06T13:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Saving macro values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-macro-values/m-p/451950#M114028</link>
      <description>&lt;P&gt;Always post into the code windows while they are open (Pop-up). Posting into the field within the main posting window eats linefeeds.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 15:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-macro-values/m-p/451950#M114028</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-06T15:23:41Z</dc:date>
    </item>
  </channel>
</rss>

