<?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 Have a my %let = a value of a variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Have-a-my-let-a-value-of-a-variable/m-p/169261#M43769</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need help.&amp;nbsp; I want a %let statement to equal a variable's value.&amp;nbsp; If variable order had values of 1-10, I want %let x = order to resolve to the value of order, if the line had 5 for order I want x to be 5, currently for everything I've tried it always resolves to the variable name.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Jan 2015 17:32:44 GMT</pubDate>
    <dc:creator>weweaw</dc:creator>
    <dc:date>2015-01-05T17:32:44Z</dc:date>
    <item>
      <title>Have a my %let = a value of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Have-a-my-let-a-value-of-a-variable/m-p/169261#M43769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need help.&amp;nbsp; I want a %let statement to equal a variable's value.&amp;nbsp; If variable order had values of 1-10, I want %let x = order to resolve to the value of order, if the line had 5 for order I want x to be 5, currently for everything I've tried it always resolves to the variable name.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 17:32:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Have-a-my-let-a-value-of-a-variable/m-p/169261#M43769</guid>
      <dc:creator>weweaw</dc:creator>
      <dc:date>2015-01-05T17:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Have a my %let = a value of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Have-a-my-let-a-value-of-a-variable/m-p/169262#M43770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CALL SYMPUT Routine&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000210266.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000210266.htm"&gt;SAS(R) 9.2 Macro Language: Reference&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 17:36:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Have-a-my-let-a-value-of-a-variable/m-p/169262#M43770</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2015-01-05T17:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Have a my %let = a value of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Have-a-my-let-a-value-of-a-variable/m-p/169263#M43771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL SYMPUTX can be used to write the value of a data step variable to a macro variable, e.g:&lt;/P&gt;&lt;PRE&gt;60&amp;nbsp;&amp;nbsp; data _null_;
61&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; order=5;
62&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symputx('x',order);
63&amp;nbsp;&amp;nbsp; run;
64
65&amp;nbsp;&amp;nbsp; %put &amp;amp;x;
5

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 17:37:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Have-a-my-let-a-value-of-a-variable/m-p/169263#M43771</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2015-01-05T17:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Have a my %let = a value of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Have-a-my-let-a-value-of-a-variable/m-p/169264#M43772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm sorry, I meant I have a variable which is numeric, and I want when the let expression is call for that value to come up, it could be several different numbers. Say my data set looks like this&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="384"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="64"&gt;order&lt;/TD&gt;&lt;TD width="64"&gt;Var_1&lt;/TD&gt;&lt;TD width="64"&gt;Var_2&lt;/TD&gt;&lt;TD width="64"&gt;Var_3&lt;/TD&gt;&lt;TD width="64"&gt;Var_4&lt;/TD&gt;&lt;TD width="64"&gt;Var_n&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;1&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD align="right"&gt;6&lt;/TD&gt;&lt;TD align="right"&gt;6&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;4&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD align="right"&gt;34&lt;/TD&gt;&lt;TD align="right"&gt;6&lt;/TD&gt;&lt;TD align="right"&gt;4&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;7&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD align="right"&gt;5&lt;/TD&gt;&lt;TD align="right"&gt;6&lt;/TD&gt;&lt;TD align="right"&gt;3&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;8&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD align="right"&gt;7&lt;/TD&gt;&lt;TD align="right"&gt;6&lt;/TD&gt;&lt;TD align="right"&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to sum certain variables that are Var_n.&amp;nbsp; I want to start the sum with the Var_n that is the value of order.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 18:28:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Have-a-my-let-a-value-of-a-variable/m-p/169264#M43772</guid>
      <dc:creator>weweaw</dc:creator>
      <dc:date>2015-01-05T18:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Have a my %let = a value of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Have-a-my-let-a-value-of-a-variable/m-p/169265#M43773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understand the question, you have a program that should not be using macro language at all, not even %let statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this the meaning of your question?&amp;nbsp; On the first observation, order=1.&amp;nbsp; Therefore, get the sum of Var_1 through Var_n.&amp;nbsp;&amp;nbsp; Similarly, on the second observation, order=4.&amp;nbsp; Therefore, get the sum of Var_4 through Var_n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are looking for something different than what I described, you will have to clarify your objective.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 18:41:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Have-a-my-let-a-value-of-a-variable/m-p/169265#M43773</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-01-05T18:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Have a my %let = a value of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Have-a-my-let-a-value-of-a-variable/m-p/169266#M43774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you may be looking for an array solution:&lt;/P&gt;&lt;P&gt;Array v var_1 - var_n;&lt;/P&gt;&lt;P&gt;tot=0;&lt;/P&gt;&lt;P&gt;do I = order to dim(v);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tot = tot + v&lt;I&gt;;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming 1) order is a positive integer 2) order is never larger than the number of variables&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 18:43:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Have-a-my-let-a-value-of-a-variable/m-p/169266#M43774</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-01-05T18:43:15Z</dc:date>
    </item>
  </channel>
</rss>

