<?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: vvaluex in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/vvaluex/m-p/376251#M90282</link>
    <description>&lt;P&gt;If you know your macro variable(s) contain numeric strings (all macro variables are character strings) you can use the SYMGETN() function to read it directly into a numeric variable and skip the INPUT() function call.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let V01 = 2;
%let M08 = 4;
data want;
  input plan $ amount ;
  calc= symgetn(plan)*amount;
cards;
V01 3.4
M08 4.5
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 15 Jul 2017 15:56:12 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2017-07-15T15:56:12Z</dc:date>
    <item>
      <title>vvaluex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/vvaluex/m-p/375998#M90192</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This &amp;nbsp;example code was taken from stackoverflow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data have;
input MERCH_NO      V01   M02  V08  M08  AMOUNT    PLAN $;
calc = input(vvaluex(plan),best12.) * amount;
put calc=;
datalines;
123456        2     2    1    1    100.00    V01     
456789        4     4    4    4    250.00    M08    
;;;;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can vvaluex be regarded as kind of macro variable resolution? In this example, value of V01 is 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I replicated the outout with this code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let V01 = 2;&lt;BR /&gt;%let M08 = 4;&lt;BR /&gt;data test;&lt;BR /&gt;set have;&lt;BR /&gt;calc= input(symget(plan),best.)*amount;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2017 13:52:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/vvaluex/m-p/375998#M90192</guid>
      <dc:creator>SAS_inquisitive</dc:creator>
      <dc:date>2017-07-14T13:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: vvaluex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/vvaluex/m-p/376018#M90195</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/64404"&gt;@SAS_inquisitive&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can vvaluex be regarded as kind of macro variable resolution? In this example, value of V01 is 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No. VVALUEX returns the value of a variable. It can have nothing to do with macro variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You create macro variables but don't use them so your example doesn't quite make sense.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2017 14:36:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/vvaluex/m-p/376018#M90195</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-14T14:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: vvaluex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/vvaluex/m-p/376246#M90280</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote "&lt;SPAN&gt;You create macro variables but don't use them so your example doesn't quite make sense".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am creating those macro variables and using symget function to get values. Basically, I was trying to do same thing as vvaluex function does using symget in this example.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jul 2017 14:53:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/vvaluex/m-p/376246#M90280</guid>
      <dc:creator>SAS_inquisitive</dc:creator>
      <dc:date>2017-07-15T14:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: vvaluex</title>
      <link>https://communities.sas.com/t5/SAS-Programming/vvaluex/m-p/376251#M90282</link>
      <description>&lt;P&gt;If you know your macro variable(s) contain numeric strings (all macro variables are character strings) you can use the SYMGETN() function to read it directly into a numeric variable and skip the INPUT() function call.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let V01 = 2;
%let M08 = 4;
data want;
  input plan $ amount ;
  calc= symgetn(plan)*amount;
cards;
V01 3.4
M08 4.5
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jul 2017 15:56:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/vvaluex/m-p/376251#M90282</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-07-15T15:56:12Z</dc:date>
    </item>
  </channel>
</rss>

