<?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: Put column value into a macro variable that's named from another column in same row in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Put-column-value-into-a-macro-variable-that-s-named-from-another/m-p/569472#M160488</link>
    <description>&lt;P&gt;Welcome to the SAS Community &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simply use CALL SYMPUTX in a data step instead of PROC SQL logic&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jun 2019 14:53:23 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-06-27T14:53:23Z</dc:date>
    <item>
      <title>Put column value into a macro variable that's named from another column in same row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Put-column-value-into-a-macro-variable-that-s-named-from-another/m-p/569467#M160485</link>
      <description>&lt;P&gt;Hi, I have a table that contains a list of values and the macro variable name that I want to store that value in.&lt;/P&gt;&lt;P&gt;Simplified to this example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;ValueToStore&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Macro_Name&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Value A&lt;/TD&gt;&lt;TD&gt;TestContainerA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Value B&lt;/TD&gt;&lt;TD&gt;MacroNameBoy&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Value C&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;MacroNameTT&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So as a result, I'd like a macro variable named TestContainerA that has the value 'Value A'. MacroNameBoy would have the value 'Value B' and so forth.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried several things around this and can't get it working. Any suggestions on another way would be much appreciated:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;Proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;SQL&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; macro_name&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; :macro_name separated by &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;From&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;Quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;Proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;SQL&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ValueToStore&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; :&amp;amp;macro_name separated by &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' '&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;From&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;Quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 14:50:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Put-column-value-into-a-macro-variable-that-s-named-from-another/m-p/569467#M160485</guid>
      <dc:creator>BuildsStuff</dc:creator>
      <dc:date>2019-06-27T14:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Put column value into a macro variable that's named from another column in same row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Put-column-value-into-a-macro-variable-that-s-named-from-another/m-p/569470#M160487</link>
      <description>&lt;P&gt;A perfect use case for the CALL SYMPUTX() function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set test;
  call symputx(Macro_Name,ValueToStore);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jun 2019 14:52:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Put-column-value-into-a-macro-variable-that-s-named-from-another/m-p/569470#M160487</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-06-27T14:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Put column value into a macro variable that's named from another column in same row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Put-column-value-into-a-macro-variable-that-s-named-from-another/m-p/569472#M160488</link>
      <description>&lt;P&gt;Welcome to the SAS Community &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simply use CALL SYMPUTX in a data step instead of PROC SQL logic&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 14:53:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Put-column-value-into-a-macro-variable-that-s-named-from-another/m-p/569472#M160488</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-06-27T14:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Put column value into a macro variable that's named from another column in same row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Put-column-value-into-a-macro-variable-that-s-named-from-another/m-p/569517#M160506</link>
      <description>Holy mackerel. There's a function for everything. Love it! Thanks!</description>
      <pubDate>Thu, 27 Jun 2019 16:11:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Put-column-value-into-a-macro-variable-that-s-named-from-another/m-p/569517#M160506</guid>
      <dc:creator>BuildsStuff</dc:creator>
      <dc:date>2019-06-27T16:11:20Z</dc:date>
    </item>
  </channel>
</rss>

