<?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: SYMGET in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SYMGET/m-p/14966#M1932</link>
    <description>Interesting that you mentioned the symget function. I remember vividly &lt;A href="http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0401B&amp;amp;L=sas-l&amp;amp;D=0&amp;amp;P=19282"&gt;this sas-l thread&lt;/A&gt; about the certification exam but also about the not-well-known-back-then (and now either, it seems) symget function. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Thu, 16 Jun 2011 16:20:17 GMT</pubDate>
    <dc:creator>chang_y_chung_hotmail_com</dc:creator>
    <dc:date>2011-06-16T16:20:17Z</dc:date>
    <item>
      <title>SYMGET</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMGET/m-p/14963#M1929</link>
      <description>Ok SYMPUT I use all the time and in preference to SELECT INTO : in PROC SQL but SYMGET I just don't get it. In a data step what does &lt;U&gt;x=symget('macrovar')&lt;/U&gt; achieve that &lt;U&gt;x="&amp;amp;macrovar"&lt;/U&gt; does not?</description>
      <pubDate>Thu, 16 Jun 2011 10:59:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMGET/m-p/14963#M1929</guid>
      <dc:creator>Josh</dc:creator>
      <dc:date>2011-06-16T10:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: SYMGET</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMGET/m-p/14964#M1930</link>
      <description>Hi Josh,&lt;BR /&gt;
&lt;BR /&gt;
You can use a datastep variable to determine which macro variable is retreived using symget:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data this;&lt;BR /&gt;
  do x = 1 to 3; output;&lt;BR /&gt;
    call symput(put(x,words5.),x);&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data that;&lt;BR /&gt;
  set this;&lt;BR /&gt;
  y = symget(put(x,words5.));&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
The other main feature I use it for is that it can retreive a macro variable which has been set by call symput from within the same step:&lt;BR /&gt;
[pre]&lt;BR /&gt;
%symdel me;&lt;BR /&gt;
data also;&lt;BR /&gt;
  call symput("me","mememe");&lt;BR /&gt;
  put 'Value of &amp;amp;me: ' "&amp;amp;me."; *Not found;&lt;BR /&gt;
  tst = symget("me");&lt;BR /&gt;
  put 'Value of &amp;amp;me: ' tst; *Found;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Regards,&lt;BR /&gt;
-- Will

Message was edited by: WillDobson</description>
      <pubDate>Thu, 16 Jun 2011 11:14:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMGET/m-p/14964#M1930</guid>
      <dc:creator>WillDobson</dc:creator>
      <dc:date>2011-06-16T11:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: SYMGET</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMGET/m-p/14965#M1931</link>
      <description>Short answer: Symget is executable.&lt;BR /&gt;
&lt;BR /&gt;
Plus check out symgetN to create a numeric value from a macro variable value.</description>
      <pubDate>Thu, 16 Jun 2011 12:41:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMGET/m-p/14965#M1931</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-06-16T12:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: SYMGET</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYMGET/m-p/14966#M1932</link>
      <description>Interesting that you mentioned the symget function. I remember vividly &lt;A href="http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0401B&amp;amp;L=sas-l&amp;amp;D=0&amp;amp;P=19282"&gt;this sas-l thread&lt;/A&gt; about the certification exam but also about the not-well-known-back-then (and now either, it seems) symget function. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 16 Jun 2011 16:20:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYMGET/m-p/14966#M1932</guid>
      <dc:creator>chang_y_chung_hotmail_com</dc:creator>
      <dc:date>2011-06-16T16:20:17Z</dc:date>
    </item>
  </channel>
</rss>

