<?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: Evaluate Expression Stored in a Dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107961#M22430</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's what I was thinking Jaap . . . since %eval and %sysevalf can take text as an expression, then you can call %eval and %sysevalf directly from a data step statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Aug 2013 06:08:48 GMT</pubDate>
    <dc:creator>Fugue</dc:creator>
    <dc:date>2013-08-12T06:08:48Z</dc:date>
    <item>
      <title>Evaluate Expression Stored in a Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107957#M22426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I have a dataset with variable such as INPUT1, INPUT2, INPUT3, INPUT4, CALCULATION&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;INPUT1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUT2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUT3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUT4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALC&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUT1 * INPUT2 + 100&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUT3 / INPUT2&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 90&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUT1 - INPUT3&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I would like to evaluate the expression stored in CALC and store the result in a new column&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Thanks&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Selva.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Aug 2013 19:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107957#M22426</guid>
      <dc:creator>SelvaN</dc:creator>
      <dc:date>2013-08-11T19:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate Expression Stored in a Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107958#M22427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you ellaborate why you are asking this?&lt;/P&gt;&lt;P&gt;Normally SAS is using a table approach (relational like) wiht that it is strange to differentiate cacualtions within a column.&lt;/P&gt;&lt;P&gt;It is has not the fully freedom of a spreadsheet like Excel. It is requiring the normal programmer approach.&lt;/P&gt;&lt;P&gt;There are solutions possible. They are in the more advanced concepts and the googling in the language. As the way you are asking it the SAS language interepretation must be enhanced by a dynamic intrepretation line.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Aug 2013 20:36:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107958#M22427</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-08-11T20:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate Expression Stored in a Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107959#M22428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The %eval and %sysevalf functions might do the trick for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Aug 2013 20:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107959#M22428</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2013-08-11T20:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate Expression Stored in a Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107960#M22429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@fugue&lt;BR /&gt;That is correct under the condition you are working at the macro language and do not use the datastep.&lt;/P&gt;&lt;P&gt;By that you could do a lot but io is cumbersome. The calculations must be limited to these macro functions.&lt;/P&gt;&lt;P&gt;All datastpe IO to be replaces with sysfunc and open/fopen tedious first IO calls&amp;nbsp; to start all programming,&lt;/P&gt;&lt;P&gt;Or use in a datastep call symput with a resolve call. Timing between datastep language / macro&amp;nbsp; language&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other options are:&lt;/P&gt;&lt;P&gt;- converting the input to SAS source just defining variables and do a %include&lt;/P&gt;&lt;P&gt;- using fcmp with run_sasfile having the needed expression stored somewhere&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 04:44:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107960#M22429</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-08-12T04:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate Expression Stored in a Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107961#M22430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's what I was thinking Jaap . . . since %eval and %sysevalf can take text as an expression, then you can call %eval and %sysevalf directly from a data step statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 06:08:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107961#M22430</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2013-08-12T06:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate Expression Stored in a Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107962#M22431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes but at that moment datastep variables you need in computation are not available in the macrovar environment.&lt;/P&gt;&lt;P&gt;When you need those datastep variables you have to export them first to the macro-var environment en refer them as macrovars.&lt;/P&gt;&lt;P&gt;The call Execute&amp;nbsp; won't help you. &lt;A href="http://www.sascommunity.org/wiki/Call_Execute_in_the_Data_Step"&gt;http://www.sascommunity.org/wiki/Call_Execute_in_the_Data_Step&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAS-macro enviroment and the sas-datastep (statements) are interacting in a special way.&amp;nbsp; &lt;/P&gt;&lt;P&gt;The question of SelvaN is something that could be a challenge in some course to become aware off all this.&amp;nbsp; &lt;BR /&gt;In that case we have done the homework. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 06:54:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107962#M22431</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-08-12T06:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate Expression Stored in a Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107963#M22432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How many different types of calculations do you have? Can they be more complex than in your example?&lt;/P&gt;&lt;P&gt;If there are only a few, you could use if-then logic interpret the calculations and then more or less hard coded execute them.&lt;/P&gt;&lt;P&gt;If there are "many", you could have a pre code that pick up the distinct calculations, and then have a macro generate the if-then code for you.&lt;/P&gt;&lt;P&gt;Additions and subtractions could be simplified by just putting them in a separate variable with the sign.&lt;/P&gt;&lt;P&gt;Not a neat solution, but could work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 10:14:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107963#M22432</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-08-12T10:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate Expression Stored in a Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107964#M22433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem can be solved with a dynamically created data-step, but bear in mind that the performance with a high number of observations will be poor. Data-steps can be created with the following techniques:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The macro language with %sysfunc and functions like open, fetch and close.&lt;/LI&gt;&lt;LI&gt;data-_null_-step with file and put and afterwards %include to load and execute the generated program&lt;/LI&gt;&lt;LI&gt;data-_null_-step with call execute - very much like the second technique, but debugging the program will be more difficult.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code is not fully tested:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set work.have end= last;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; file "SOMEWHERE\calc.sas";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length line $ 200;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _n_ = 1 then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'data work.want;';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'set work.have;';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'length result 8;';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'select (_n_);';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; line = catx(' ', 'when (', _n_, ') result =', calc, ';');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put line;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if last then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'end;';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'run;';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 10:32:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107964#M22433</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2013-08-12T10:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate Expression Stored in a Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107965#M22434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DOSUBL looks about right.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.lexjansen.com/pharmasug/2013/AD/PharmaSUG-2013-AD24-SAS.pdf" title="http://www.lexjansen.com/pharmasug/2013/AD/PharmaSUG-2013-AD24-SAS.pdf"&gt;http://www.lexjansen.com/pharmasug/2013/AD/PharmaSUG-2013-AD24-SAS.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 11:57:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107965#M22434</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-08-12T11:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate Expression Stored in a Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107966#M22435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The source has the "calculation" and the "result" stored. But, the values used to get the results is not persisted. We had to bring all the values (INPUT1, INPUT2...) from a different source. So, as part of this conversion, we need to re-calculate the result based on the new values and show the differences if any. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this makes sense.&lt;/P&gt;&lt;P&gt;Selva.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 13:47:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107966#M22435</guid>
      <dc:creator>SelvaN</dc:creator>
      <dc:date>2013-08-12T13:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate Expression Stored in a Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107967#M22436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Andreas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I ended up doing. In addition to the evaluation of the calculation, I also needed to store the intermediate values. For example, if the calculation is INPUT1 * INPUT2, then I need to store "4.5 * 3" in one column and "10.5" in the result column. So, this method is helping to do that too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, as I have only around 100 combination of these calculation from a dataset with millions of records, I had first selected distinct calculation and had the DATA step built with only the 100 combinations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Selva.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 13:49:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107967#M22436</guid>
      <dc:creator>SelvaN</dc:creator>
      <dc:date>2013-08-12T13:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate Expression Stored in a Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107968#M22437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting. I will look into it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 13:50:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107968#M22437</guid>
      <dc:creator>SelvaN</dc:creator>
      <dc:date>2013-08-12T13:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate Expression Stored in a Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107969#M22438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SelvaN,&lt;BR /&gt;With you addtional information:&lt;/P&gt;&lt;P&gt;-&amp;nbsp; having millions of records&lt;/P&gt;&lt;P&gt;- ca 100 type of calcuations&lt;/P&gt;&lt;P&gt;- Recalculating something.. having many type of sources&lt;/P&gt;&lt;P&gt;&amp;nbsp; I assume the recalculation is triggered /dependent of that type of source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you would have an indicator of the calcauation or treat the Calc field as that information.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;You could use LinusH approach a fixed part of code... You could generate out of your table.&lt;/P&gt;&lt;P&gt;Later you can do a %include .....&amp;nbsp;&amp;nbsp; ;&amp;nbsp;&amp;nbsp; of this code of processing.&lt;/P&gt;&lt;P&gt;The idea like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Select ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; When ( calc=".." ) ...-compute-&amp;nbsp; calc&amp;nbsp; ;&amp;nbsp; /* repeated */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Otherwise put "a message" ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 14:45:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107969#M22438</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-08-12T14:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate Expression Stored in a Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107970#M22439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's an example that uses sysevalf in a data step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* create sample data */&lt;/P&gt;&lt;P&gt;data have ;&lt;BR /&gt; format calc_exprsn $50.;&lt;BR /&gt; input input1 input2 input3 input4 calc_exprsn $ &amp;amp;;&lt;BR /&gt;datalines;&lt;BR /&gt;4 6 7 9&amp;nbsp; INPUT1 * INPUT2 + 100&lt;BR /&gt;8 8 6 2&amp;nbsp; INPUT3 / INPUT2&lt;BR /&gt;8 3 90 11&amp;nbsp; INPUT1 - INPUT3&lt;BR /&gt;;&lt;BR /&gt;;;;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* evaluate expression using sysevalf in a datastep */&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt; length name $ 8;&lt;BR /&gt; set have ;&lt;BR /&gt; drop i name;&lt;BR /&gt; macro_exprsn = tranwrd ( calc_exprsn, 'INPUT' , '&amp;amp;INPUT' );&lt;BR /&gt; array nums ( * ) input1-input4;&lt;BR /&gt; do i = 1 to dim (nums);&lt;BR /&gt;&amp;nbsp; call vname (nums(i), name);&lt;BR /&gt;&amp;nbsp; call symput (name, put(nums(i), best12.));&lt;BR /&gt; end;&lt;BR /&gt; calc_rslt = resolve ('%sysevalf('||macro_exprsn||')');&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 23:51:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107970#M22439</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2013-08-12T23:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate Expression Stored in a Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107971#M22440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fugue,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fantastic...This worked like a charm &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;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, in order to store my intermediate values such 4*6+100, all I needed to do was to add another variable without %sysevalf as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;length name $ 8;&lt;/P&gt;&lt;P&gt;set have ;&lt;/P&gt;&lt;P&gt;drop i name;&lt;/P&gt;&lt;P&gt;macro_exprsn = tranwrd ( calc_exprsn, 'INPUT' , '&amp;amp;INPUT' );&lt;/P&gt;&lt;P&gt;array nums ( * ) input1-input4;&lt;/P&gt;&lt;P&gt;do i = 1 to dim (nums);&lt;/P&gt;&lt;P&gt;&amp;nbsp; call vname (nums(i), name);&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symput (name, put(nums(i), best12.));&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;calc_rslt = resolve('%sysevalf('||macro_exprsn||')');&lt;/P&gt;&lt;H1&gt;&lt;STRONG&gt;calc_rslt2 = compbl(resolve(macro_exprsn))&lt;/STRONG&gt;;&lt;/H1&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 00:27:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Evaluate-Expression-Stored-in-a-Dataset/m-p/107971#M22440</guid>
      <dc:creator>SelvaN</dc:creator>
      <dc:date>2013-08-13T00:27:59Z</dc:date>
    </item>
  </channel>
</rss>

