<?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: Storing a value in a variable ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-in-a-variable/m-p/76734#M16592</link>
    <description>Yes it was what I wanted to do, your solution worked perfectly.&lt;BR /&gt;
Many thanks from France !</description>
    <pubDate>Mon, 26 Oct 2009 19:36:19 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-10-26T19:36:19Z</dc:date>
    <item>
      <title>Storing a value in a variable ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-in-a-variable/m-p/76732#M16590</link>
      <description>Hi, &lt;BR /&gt;
I would like to store the mean of a data set variable in a variable such that I could use the value without writing it myself each time I need it.&lt;BR /&gt;
Is this possible ?&lt;BR /&gt;
If yes, how can I proceed ?&lt;BR /&gt;
&lt;BR /&gt;
Thank you in advance</description>
      <pubDate>Mon, 26 Oct 2009 17:41:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-in-a-variable/m-p/76732#M16590</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-10-26T17:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Storing a value in a variable ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-in-a-variable/m-p/76733#M16591</link>
      <description>Not sure of what you need, but maybe storing the desired value into a SAS macro variable may solve your problem.&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
select mean(VALUE) into :MEAN_VALUE from DATA;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
the into: statement will load a value into a SAS macro variable through SQL.&lt;BR /&gt;
&lt;BR /&gt;
See the online doc here:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a000543554.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a000543554.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
From there, you just need to reference the SAS macro variable in your program, then at runtime this will be substituted by the actual value loaded previously.&lt;BR /&gt;
&lt;BR /&gt;
for example:&lt;BR /&gt;
data _null_;&lt;BR /&gt;
put "Mean value is: &amp;amp;MEAN_VALUE";&lt;BR /&gt;
&lt;BR /&gt;
/* or */&lt;BR /&gt;
&lt;BR /&gt;
MEAN=&amp;amp;MEAN_VALUE;&lt;BR /&gt;
put MEAN=;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
      <pubDate>Mon, 26 Oct 2009 17:54:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-in-a-variable/m-p/76733#M16591</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2009-10-26T17:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Storing a value in a variable ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-in-a-variable/m-p/76734#M16592</link>
      <description>Yes it was what I wanted to do, your solution worked perfectly.&lt;BR /&gt;
Many thanks from France !</description>
      <pubDate>Mon, 26 Oct 2009 19:36:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Storing-a-value-in-a-variable/m-p/76734#M16592</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-10-26T19:36:19Z</dc:date>
    </item>
  </channel>
</rss>

