<?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: Is there a function that performs a calculation described in string? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513370#M138318</link>
    <description>&lt;P&gt;Thanks! I went with his suggestion of using the resolve function. i.e.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input formula $25.;
  x=resolve('%sysevalf('||formula||')');
  cards;
-1+3+6
;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 15 Nov 2018 15:32:07 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2018-11-15T15:32:07Z</dc:date>
    <item>
      <title>Is there a function that performs a calculation described in string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513351#M138309</link>
      <description>&lt;P&gt;Is there a function that performs a calculation described in a string? E.g., given the following code, is there a function that will provide 8 as the value of x?:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input formula $25.;
  *x=???(formula);
  cards;
-1+3+6
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;TIA,&lt;/P&gt;
&lt;P&gt;Art&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 15:05:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513351#M138309</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-11-15T15:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a function that performs a calculation described in string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513362#M138315</link>
      <description>&lt;P&gt;Ksharp shows two ways in this post:&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/resolving-a-formula-in-a-dataset/td-p/68123" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/resolving-a-formula-in-a-dataset/td-p/68123&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 15:24:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513362#M138315</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-15T15:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a function that performs a calculation described in string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513368#M138317</link>
      <description>&lt;P&gt;Only thing I can think of like that is placing the value in a macro variable and using %sysevalf (or %eval if integers only). Which I doubt really helps a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 15:28:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513368#M138317</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-15T15:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a function that performs a calculation described in string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513370#M138318</link>
      <description>&lt;P&gt;Thanks! I went with his suggestion of using the resolve function. i.e.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input formula $25.;
  x=resolve('%sysevalf('||formula||')');
  cards;
-1+3+6
;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Nov 2018 15:32:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513370#M138318</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-11-15T15:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a function that performs a calculation described in string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513373#M138319</link>
      <description>&lt;P&gt;Do please like the original post from Ksharp, its his solution after all&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 15:39:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513373#M138319</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-15T15:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a function that performs a calculation described in string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513377#M138322</link>
      <description>&lt;P&gt;fun with APP&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input formula $25.;
  *x=???(formula);
 x1=translate(formula,' ','+');
array target(3)$2 _temporary_;
 call pokelong (x1, addrlong(target[1]), 6) ; 
 want=sum(of target(*));
 drop x1;
  cards;
-1+3+6
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;EDITed to 'long' 64 bit machine&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 15:56:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513377#M138322</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-15T15:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a function that performs a calculation described in string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513411#M138334</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;:&amp;nbsp; Did it!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 16:22:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513411#M138334</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-11-15T16:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a function that performs a calculation described in string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513429#M138339</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;fun with APP&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input formula $25.;
  *x=???(formula);
 x1=translate(formula,' ','+');
array target(3)$2 _temporary_;
 call pokelong (x1, addrlong(target[1]), 6) ; 
 want=sum(of target(*));
 drop x1;
  cards;
-1+3+6
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;EDITed to 'long' 64 bit machine&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;with this we need to know if &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt;&amp;nbsp;needs to consider other functions such as multiplication, division, exponentiation and possibly grouping with () within the function string.&lt;/P&gt;
&lt;P&gt;I have sort of wondered for quite awhile why the macro language has %eval and later %sysevalf without equivalents in the data step.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 16:45:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513429#M138339</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-15T16:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a function that performs a calculation described in string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513437#M138340</link>
      <description>&lt;P&gt;Thank you sir&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;for the response. Actually APP does not scale like 'resolve' for this thread. I realised that later but still didn't want to delete my post.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suppose if any of those arthimetic math operators are in the formula %sysevalf should accomplish. Perhaps, the equivalents didn;t matter so long as the&amp;nbsp; datastep interface with the macro facility like resolve, call execute, symget etc are giving a helping hand.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Btw, you took a week or so off? My classmate is still thankful to you for the regression plot of&amp;nbsp; confidence level help. Dankie!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 16:52:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513437#M138340</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-15T16:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a function that performs a calculation described in string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513445#M138342</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;: No. Just addition and subtraction. I'm trying to solve the Canadian FriendsOfSAS problem of the week that can be found at:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sas.com/content/dam/SAS/documents/technical/education/en/en-programming-problem-6.pdf" target="_blank"&gt;https://www.sas.com/content/dam/SAS/documents/technical/education/en/en-programming-problem-6.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 17:02:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513445#M138342</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-11-15T17:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a function that performs a calculation described in string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513704#M138440</link>
      <description>&lt;P&gt;So one question becomes are&lt;/P&gt;
&lt;P&gt;+1+2+34-5+67-8+9&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;1+2+34-5+67-8+9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;different solutions or not?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have one solution at 33 lines of code&amp;nbsp;finding 23 answers if the answer to the above is "Yes they are different solutions". But 22 of them are pairs with and without the leading +.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&amp;nbsp;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 22:55:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513704#M138440</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-15T22:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a function that performs a calculation described in string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513740#M138457</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;: Not sure how to answer your question because the first digit might have a leading negative sign. The solution I offered can be found at&amp;nbsp;&lt;A href="https://communities.sas.com/t5/Friends-of-SAS-Programming/November-14-2018-Programming-Problem/m-p/513347#M146" target="_blank"&gt;https://communities.sas.com/t5/Friends-of-SAS-Programming/November-14-2018-Programming-Problem/m-p/513347#M146&lt;/A&gt;, but a much better one was also posted there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, both the one I liked and my own each found 11 equations that met the challenge's criteria. My guess is that your 22 solutions incorporate 11 duplicates. I have no idea where your 23rd solution might have come from.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 00:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513740#M138457</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-11-16T00:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a function that performs a calculation described in string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513744#M138459</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;: Not sure how to answer your question because the first digit might have a leading negative sign. The solution I offered can be found at&amp;nbsp;&lt;A href="https://communities.sas.com/t5/Friends-of-SAS-Programming/November-14-2018-Programming-Problem/m-p/513347#M146" target="_blank"&gt;https://communities.sas.com/t5/Friends-of-SAS-Programming/November-14-2018-Programming-Problem/m-p/513347#M146&lt;/A&gt;, but a much better one was also posted there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, both the one I liked and my own each found 11 equations that met the challenge's criteria. My guess is that your 22 solutions incorporate 11 duplicates. I have no idea where your 23rd solution might have come from.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes there were 11 pairs, the odd man out&lt;/P&gt;
&lt;P&gt;-1+2-3+4+5+6+78+9&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 00:26:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513744#M138459</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-16T00:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a function that performs a calculation described in string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513747#M138461</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;: Yes, that was the only one that began with -1,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 01:10:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-function-that-performs-a-calculation-described-in/m-p/513747#M138461</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-11-16T01:10:08Z</dc:date>
    </item>
  </channel>
</rss>

