<?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: creating column with Changing formula in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378513#M90976</link>
    <description>&lt;P&gt;Yes &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;, point of view cacula, that's right. I can even mention as it is resolved, but is there a way to have the results for each effect in column and not online of the form target_var1 target_var2 target_var3 .... for each effect.&lt;/P&gt;</description>
    <pubDate>Sun, 23 Jul 2017 09:46:48 GMT</pubDate>
    <dc:creator>soumri</dc:creator>
    <dc:date>2017-07-23T09:46:48Z</dc:date>
    <item>
      <title>creating column with Changing formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378471#M90954</link>
      <description>&lt;P&gt;Hi&amp;nbsp;everyone&lt;BR /&gt;I have a database of the form:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Effect &amp;nbsp; &amp;nbsp;fact1 &amp;nbsp;fact2 fact3 fact4 fact5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; time &amp;nbsp; &amp;nbsp; val1 &amp;nbsp; val2 &amp;nbsp; val3 &amp;nbsp;val4&lt;/P&gt;&lt;P&gt;HP11 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.1 &amp;nbsp; &amp;nbsp;-0.2 &amp;nbsp; 0.1 &amp;nbsp; &amp;nbsp;0.1&amp;nbsp; &amp;nbsp; -0.3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; 0.01 &amp;nbsp;0.02 &amp;nbsp;0.05 &amp;nbsp;0.08&lt;/P&gt;&lt;P&gt;HP12 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.2 &amp;nbsp; &amp;nbsp;-0.3 &amp;nbsp; 0.3 &amp;nbsp; &amp;nbsp;0.4 &amp;nbsp; &amp;nbsp; 0.1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; 0.02 &amp;nbsp;0.03 &amp;nbsp;0.02 &amp;nbsp;0.08&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;HP13 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.1 &amp;nbsp; &amp;nbsp; 0.2 &amp;nbsp; 0.3 &amp;nbsp; &amp;nbsp;0.4 &amp;nbsp; &amp;nbsp; 0.5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; 0.07 &amp;nbsp;0.02 &amp;nbsp;0.03 &amp;nbsp;0.03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;HP21 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.3 &amp;nbsp; &amp;nbsp;-0.4 &amp;nbsp; 0.7 &amp;nbsp; &amp;nbsp;0.2&amp;nbsp; &amp;nbsp; -0.3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&amp;nbsp; &amp;nbsp; &amp;nbsp; 0.02 &amp;nbsp;0.02 &amp;nbsp;0.04 &amp;nbsp;0.08&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;HP22 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.1 &amp;nbsp; &amp;nbsp;-0.7 &amp;nbsp; 0.2 &amp;nbsp; &amp;nbsp;0.2&amp;nbsp; &amp;nbsp; -0.2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&amp;nbsp; &amp;nbsp; &amp;nbsp; 0.04 &amp;nbsp;0.07 &amp;nbsp;0.01 &amp;nbsp;0.08&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;HP23 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.2&amp;nbsp; &amp;nbsp; &amp;nbsp;0.2 &amp;nbsp; 0.2 &amp;nbsp; &amp;nbsp;0.2&amp;nbsp; &amp;nbsp; &amp;nbsp;0.5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6&amp;nbsp; &amp;nbsp; &amp;nbsp; 0.01 &amp;nbsp;0.07 &amp;nbsp;0.01 &amp;nbsp;0.02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;HP32 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.1 &amp;nbsp; &amp;nbsp; 0.5 &amp;nbsp; 0.1 &amp;nbsp; &amp;nbsp;0.1&amp;nbsp; &amp;nbsp; &amp;nbsp;0.2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&amp;nbsp; &amp;nbsp; &amp;nbsp; 0.02 &amp;nbsp;0.05 &amp;nbsp;0.02 &amp;nbsp;0.07&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;HP34 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.1 &amp;nbsp; &amp;nbsp; 0.3 &amp;nbsp; 0.1 &amp;nbsp; &amp;nbsp;0.1&amp;nbsp; &amp;nbsp; &amp;nbsp;0.3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8&amp;nbsp; &amp;nbsp; &amp;nbsp; 0.06 &amp;nbsp;0.02 &amp;nbsp;0.02 &amp;nbsp;0.04&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;HP35 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.7 &amp;nbsp; &amp;nbsp;-0.1 &amp;nbsp; 0.6 &amp;nbsp; &amp;nbsp;0.3&amp;nbsp; &amp;nbsp; &amp;nbsp;0.1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; 0.01 &amp;nbsp;0.06 &amp;nbsp;0.02 &amp;nbsp;0.08&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SP11 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.3 &amp;nbsp; &amp;nbsp;-0.4 &amp;nbsp; 0.7 &amp;nbsp; &amp;nbsp;0.7&amp;nbsp; &amp;nbsp; -0.3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.03 &amp;nbsp;0.06 &amp;nbsp;0.06 &amp;nbsp;0.08&lt;/P&gt;&lt;P&gt;SP12 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.1 &amp;nbsp; &amp;nbsp; 0.2 &amp;nbsp; 0.2 &amp;nbsp; &amp;nbsp;0.2&amp;nbsp; &amp;nbsp; -0.1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.02 &amp;nbsp;0.04 &amp;nbsp;0.05 &amp;nbsp;0.08&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SP13 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.9&amp;nbsp; &amp;nbsp; -0.1 &amp;nbsp; 0.5 &amp;nbsp; &amp;nbsp;0.1&amp;nbsp; &amp;nbsp; &amp;nbsp;0.3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.02 &amp;nbsp;0.01 &amp;nbsp;0.05 &amp;nbsp;0.08&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SP21 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.4&amp;nbsp; &amp;nbsp; -0.1 &amp;nbsp; 0.7 &amp;nbsp; &amp;nbsp;0.1&amp;nbsp; &amp;nbsp; -0.3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;13&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.07 &amp;nbsp;0.01 &amp;nbsp;0.04 &amp;nbsp;0.08&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SP22 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.5 &amp;nbsp; &amp;nbsp;-0.2 &amp;nbsp; 0.1 &amp;nbsp; &amp;nbsp;0.7&amp;nbsp; &amp;nbsp; -0.3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;14&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.09 &amp;nbsp;0.01 &amp;nbsp;0.03 &amp;nbsp;0.02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SP23 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.1 &amp;nbsp; &amp;nbsp;-0.2 &amp;nbsp; 0.1 &amp;nbsp; &amp;nbsp;0.3&amp;nbsp; &amp;nbsp; -0.2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.02 &amp;nbsp;0.06 &amp;nbsp;0.02 &amp;nbsp;0.08&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SP32 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.6 &amp;nbsp; &amp;nbsp;-0.2 &amp;nbsp; 0.5 &amp;nbsp; &amp;nbsp;0.3&amp;nbsp; &amp;nbsp; -0.1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;16&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.01 &amp;nbsp;0.07 &amp;nbsp;0.03 &amp;nbsp;0.04&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SP34 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.7 &amp;nbsp; &amp;nbsp;-0.4 &amp;nbsp; 0.5 &amp;nbsp; &amp;nbsp;0.2&amp;nbsp; &amp;nbsp; &amp;nbsp;0.3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;17&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.02 &amp;nbsp;0.09 &amp;nbsp;0.06 &amp;nbsp;0.02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SP35 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.9 &amp;nbsp; &amp;nbsp;-0.2 &amp;nbsp; 0.1 &amp;nbsp; &amp;nbsp;0.1&amp;nbsp; &amp;nbsp; &amp;nbsp;0.1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;18&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.02 &amp;nbsp;0.02 &amp;nbsp;0.02 &amp;nbsp;0.02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;. &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; &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; &amp;nbsp; &amp;nbsp;&amp;nbsp;19&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.08 &amp;nbsp;0.01 &amp;nbsp;0.07 &amp;nbsp;0.03&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;. &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; &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; &amp;nbsp; &amp;nbsp;&amp;nbsp;20&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.06 &amp;nbsp;0.03 &amp;nbsp;0.02 &amp;nbsp;0.02&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;. &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; &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; &amp;nbsp; &amp;nbsp;&amp;nbsp;21&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.01 &amp;nbsp;0.02 &amp;nbsp;0.03 &amp;nbsp;0.05&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;. &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; &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; &amp;nbsp; &amp;nbsp;&amp;nbsp;22&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.06 &amp;nbsp;0.04 &amp;nbsp;0.01 &amp;nbsp;0.06&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;. &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; &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; &amp;nbsp; &amp;nbsp;&amp;nbsp;23&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.02 &amp;nbsp;0.04 &amp;nbsp;0.02 &amp;nbsp;0.05&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;. &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; &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; &amp;nbsp; &amp;nbsp;&amp;nbsp;24&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.04 &amp;nbsp;0.01 &amp;nbsp;0.05 &amp;nbsp;0.09&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;. &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; &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; &amp;nbsp; &amp;nbsp;&amp;nbsp;25&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.01 &amp;nbsp;0.01 &amp;nbsp;0.03 &amp;nbsp;0.0&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;For each effect I want to create a column with its name in which I apply the following formula in each line:&lt;BR /&gt;fact1+ &amp;nbsp;(fact2* val1)+(fact3* val2)+(fact4*val3)+ (fact5*val4)&lt;BR /&gt;This formula is repeated on each line under the following conditions:&lt;BR /&gt;Fact1, fact2, fact3, fact4 and fact5 do not change and always have the same values of the same effect.&lt;BR /&gt;Val1 val2 val3 and val4 change to each line from Time = 1 to time = n.&lt;/P&gt;&lt;P&gt;I give the result (what i want) for the first effect for the three first lines of my example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Effect &amp;nbsp; &amp;nbsp;fact1 &amp;nbsp;fact2 fact3 fact4 fact5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; time &amp;nbsp; &amp;nbsp; val1 &amp;nbsp; val2 &amp;nbsp; val3 &amp;nbsp;val4 &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;HP11&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;HP11 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.1 &amp;nbsp; &amp;nbsp;-0.2 &amp;nbsp; 0.1 &amp;nbsp; &amp;nbsp;0.1&amp;nbsp; &amp;nbsp; -0.3&lt;/FONT&gt;&lt;/STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;0.01 &amp;nbsp;0.02 &amp;nbsp;0.05 &amp;nbsp;0.08&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.081 &amp;nbsp;[=&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;0.1&lt;/FONT&gt;&lt;/STRONG&gt;+(&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;-0.2&lt;/FONT&gt;&lt;/STRONG&gt;*&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;0.01&lt;/FONT&gt;&lt;/STRONG&gt;)+(&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;0.1&lt;/FONT&gt;&lt;/STRONG&gt;*&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;0.02&lt;/FONT&gt;&lt;/STRONG&gt;)+(&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;0.1&lt;/FONT&gt;&lt;/STRONG&gt;*&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;0.05&lt;/FONT&gt;&lt;/STRONG&gt;)+(&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;-0.3&lt;/FONT&gt;&lt;/STRONG&gt;*&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;0.08&lt;/FONT&gt;&lt;/STRONG&gt;)]&lt;/P&gt;&lt;P&gt;HP12 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.2&amp;nbsp;&amp;nbsp; &amp;nbsp;-0.3&amp;nbsp;&amp;nbsp; 0.3&amp;nbsp;&amp;nbsp; &amp;nbsp;0.4 &amp;nbsp; &amp;nbsp; 0.1&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;0.02&amp;nbsp;&amp;nbsp;0.03&amp;nbsp;&amp;nbsp;0.02&amp;nbsp;&amp;nbsp;0.08&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;0.077 &amp;nbsp;[=&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;0.1&lt;/FONT&gt;&lt;/STRONG&gt;+(&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;-0.2&lt;/FONT&gt;&lt;/STRONG&gt;*&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;0.02&lt;/FONT&gt;&lt;/STRONG&gt;)+(&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;0.1&lt;/FONT&gt;&lt;/STRONG&gt;*&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;0.03&lt;/FONT&gt;&lt;/STRONG&gt;)+(&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;0.1&lt;/FONT&gt;&lt;/STRONG&gt;*&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;0.02&lt;/FONT&gt;&lt;/STRONG&gt;)+(&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;-0.3&lt;/FONT&gt;&lt;/STRONG&gt;*&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;0.08&lt;/FONT&gt;&lt;/STRONG&gt;)]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;HP13 &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;0.1 &amp;nbsp; &amp;nbsp; 0.2 &amp;nbsp; 0.3&amp;nbsp;&amp;nbsp; &amp;nbsp;0.4 &amp;nbsp; &amp;nbsp; 0.5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;&lt;FONT color="#008000"&gt;0.07&amp;nbsp;&amp;nbsp;0.02 &amp;nbsp;0.03&amp;nbsp;&amp;nbsp;0.03&lt;/FONT&gt; &lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; 0.082 &amp;nbsp;[=&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;0.1&lt;/FONT&gt;&lt;/STRONG&gt;+&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;(-0.2&lt;/FONT&gt;&lt;/STRONG&gt;*&lt;STRONG&gt;&lt;FONT color="#008000"&gt;0.07&lt;/FONT&gt;&lt;/STRONG&gt;)+(&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;0.1&lt;/FONT&gt;&lt;/STRONG&gt;*&lt;STRONG&gt;&lt;FONT color="#008000"&gt;0.02&lt;/FONT&gt;&lt;/STRONG&gt;)+(&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;0.1&lt;/FONT&gt;&lt;/STRONG&gt;*&lt;STRONG&gt;&lt;FONT color="#008000"&gt;0.03&lt;/FONT&gt;&lt;/STRONG&gt;)+(&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;-0.3&lt;/FONT&gt;&lt;/STRONG&gt;*&lt;STRONG&gt;&lt;FONT color="#008000"&gt;0.03&lt;/FONT&gt;&lt;/STRONG&gt;)]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This should be repeated with all the effects from&amp;nbsp;Time equal to 1 until the last value of Time.&lt;BR /&gt;Thank you for helping me.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2017 22:31:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378471#M90954</guid>
      <dc:creator>soumri</dc:creator>
      <dc:date>2017-07-22T22:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: creating column with Changing formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378473#M90956</link>
      <description>&lt;P&gt;Why does HP12 start with 0.2? Why doesn't it use the fact1 value. It may easier to follow if you write out the formula's for the first three lines.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How does the formula shown not work in code? What does your code look like so far?&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2017 23:11:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378473#M90956</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-22T23:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: creating column with Changing formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378474#M90957</link>
      <description>&lt;P&gt;In my database the variable effect is like Id's, each Id has its own values of&amp;nbsp;fact1, fact2, fact3, fact4 and fact5.&lt;BR /&gt;The values of the variables val1, val2, val3 and val4 can be considered as an independent database to use to apply the formula.&lt;BR /&gt;I gave the first 3 results for the effect HP11 and I mentioned the formulas before each result between two brackets.&lt;/P&gt;&lt;P&gt;The results for HP12 will appear in an independent&amp;nbsp;column as for HP11 and results will start with 0.2.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2017 23:40:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378474#M90957</guid>
      <dc:creator>soumri</dc:creator>
      <dc:date>2017-07-22T23:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: creating column with Changing formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378475#M90958</link>
      <description>&lt;P&gt;Did you tried code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
       new_var = fact1+  (fact2* val1)+(fact3* val2)+(fact4*val3)+ (fact5*val4);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Why have you titled the calculated variable as HP11?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2017 23:37:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378475#M90958</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-07-22T23:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: creating column with Changing formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378477#M90960</link>
      <description>&lt;P&gt;Thank you for answering me, but it is not what I want.&lt;BR /&gt;The result looks in&amp;nbsp;excel lake:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HP11 = fact &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;$&lt;/FONT&gt;&lt;/STRONG&gt; 1 + (fact &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;$&lt;/FONT&gt;&lt;/STRONG&gt; 2 * val1) + (fact &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;$&lt;/FONT&gt;&lt;/STRONG&gt; 3 * val2) + (fact &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;$&lt;/FONT&gt;&lt;/STRONG&gt; 4 * val3) + (fact &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;$&lt;/FONT&gt;&lt;/STRONG&gt; 5 * val4);&lt;BR /&gt;Repeat from Time = 1 to Time = n;&lt;/P&gt;&lt;P&gt;of course for every effect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2017 23:47:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378477#M90960</guid>
      <dc:creator>soumri</dc:creator>
      <dc:date>2017-07-22T23:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: creating column with Changing formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378479#M90961</link>
      <description>&lt;P&gt;The calculation appears straightforward and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&amp;nbsp;answer is exactly what I would suggest, so I think at this point you need to more clearly explain what you have, what you need, and very specifically, what you need help with because that's unclear.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 00:09:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378479#M90961</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-23T00:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: creating column with Changing formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378480#M90962</link>
      <description>&lt;P&gt;How many variables do you want to create per set of facts? - is it n (number of times given) ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For effect = X you cannot create more than one variable named X !&lt;/P&gt;
&lt;P&gt;so, how should you name the variable calculated with values of time=2, of time=3, etc?&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 00:13:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378480#M90962</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-07-23T00:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: creating column with Changing formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378489#M90966</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/87866"&gt;@soumri&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Given the previous discussion I'm assuming you're after something like below.&lt;/P&gt;
&lt;P&gt;For future questions: Please provide the source data in your question as SAS data steps as I've done it now for you in below code for tables &lt;EM&gt;factors&lt;/EM&gt; and &lt;EM&gt;horizons&lt;/EM&gt;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data factors;
input Effect $ fact1 fact2 fact3 fact4 fact5;
datalines;
HP11 0.1 -0.2 0.1 0.1 -0.3 
HP12 0.2 -0.3 0.3 0.4 0.1 
HP13 0.1 0.2 0.3 0.4 0.5 
HP21 0.3 -0.4 0.7 0.2 -0.3 
HP22 0.1 -0.7 0.2 0.2 -0.2 
HP23 0.2 0.2 0.2 0.2 0.5 
HP32 0.1 0.5 0.1 0.1 0.2 
HP34 0.1 0.3 0.1 0.1 0.3 
HP35 0.7 -0.1 0.6 0.3 0.1 
SP11 0.3 -0.4 0.7 0.7 -0.3 
SP12 0.1 0.2 0.2 0.2 -0.1 
SP13 0.9 -0.1 0.5 0.1 0.3 
SP21 0.4 -0.1 0.7 0.1 -0.3 
SP22 0.5 -0.2 0.1 0.7 -0.3 
SP23 0.1 -0.2 0.1 0.3 -0.2 
SP32 0.6 -0.2 0.5 0.3 -0.1 
SP34 0.7 -0.4 0.5 0.2 0.3 
SP35 0.9 -0.2 0.1 0.1 0.1 
;
run;

data horizons;
  input time val1 val2 val3 val4;
  datalines;
1 0.01 0.02 0.05 0.08
2 0.02 0.03 0.02 0.08
3 0.07 0.02 0.03 0.03
4 0.02 0.02 0.04 0.08
5 0.04 0.07 0.01 0.08
6 0.01 0.07 0.01 0.02
7 0.02 0.05 0.02 0.07
8 0.06 0.02 0.02 0.04
9 0.01 0.06 0.02 0.08
10 0.03 0.06 0.06 0.08
11 0.02 0.04 0.05 0.08
12 0.02 0.01 0.05 0.08
13 0.07 0.01 0.04 0.08
14 0.09 0.01 0.03 0.02
15 0.02 0.06 0.02 0.08
16 0.01 0.07 0.03 0.04
17 0.02 0.09 0.06 0.02
18 0.02 0.02 0.02 0.02
19 0.08 0.01 0.07 0.03
20 0.06 0.03 0.02 0.02
21 0.01 0.02 0.03 0.05
22 0.06 0.04 0.01 0.06
23 0.02 0.04 0.02 0.05 
24 0.04 0.01 0.05 0.09
25 0.01 0.01 0.03 0.01
;
run;

data want;
  set factors;
  do _point=1 to _nobs;
    set horizons nobs=_nobs point=_point;
    target_var = fact1+  (fact2* val1)+(fact3* val2)+(fact4*val3)+ (fact5*val4);
    output;
  end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or as a SQL:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table want2 as
    select 
      f.*
      ,h.*
      ,f.fact1+  (f.fact2* h.val1)+(f.fact3* h.val2)+(f.fact4*h.val3)+ (f.fact5*h.val4) as target_var
    from 
      factors as f, horizons as h
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 03:41:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378489#M90966</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-07-23T03:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: creating column with Changing formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378513#M90976</link>
      <description>&lt;P&gt;Yes &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;, point of view cacula, that's right. I can even mention as it is resolved, but is there a way to have the results for each effect in column and not online of the form target_var1 target_var2 target_var3 .... for each effect.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 09:46:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378513#M90976</guid>
      <dc:creator>soumri</dc:creator>
      <dc:date>2017-07-23T09:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: creating column with Changing formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378523#M90983</link>
      <description>&lt;P&gt;For each effect it is a calculation of row * column repeated n times without in each case modifying the values of fact1 .... Fact5 relating to this effect. Only the values of val1 ... val4 which will be modified each time.&lt;BR /&gt;The results are mentioned in a new column which bears the name of this effect.&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt; answered me somewhat but I want the results to be put side by side vertically.&lt;BR /&gt;thank you.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 11:44:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378523#M90983</guid>
      <dc:creator>soumri</dc:creator>
      <dc:date>2017-07-23T11:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: creating column with Changing formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378524#M90984</link>
      <description>&lt;P&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447" target="_blank"&gt;@Patrick&lt;/A&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I want that results appear with this form:&lt;/P&gt;&lt;P&gt;target_var1 &amp;nbsp; target_var2....&lt;/P&gt;&lt;P&gt;target_var1 for effect 1 (HP11)&lt;/P&gt;&lt;P&gt;target_var2 for effect 2 (HP12)&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2017 12:02:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378524#M90984</guid>
      <dc:creator>soumri</dc:creator>
      <dc:date>2017-07-23T12:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: creating column with Changing formula</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378549#M90995</link>
      <description>&lt;P&gt;Next code is based on&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;code with sligh changes in steps 2 and 3&lt;/P&gt;
&lt;P&gt;I hope this will fit to what you want:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data factors;
input Effect $ fact1 fact2 fact3 fact4 fact5;
datalines;
HP11 0.1 -0.2 0.1 0.1 -0.3 
HP12 0.2 -0.3 0.3 0.4 0.1 
HP13 0.1 0.2 0.3 0.4 0.5 
HP21 0.3 -0.4 0.7 0.2 -0.3 
HP22 0.1 -0.7 0.2 0.2 -0.2 
HP23 0.2 0.2 0.2 0.2 0.5 
HP32 0.1 0.5 0.1 0.1 0.2 
HP34 0.1 0.3 0.1 0.1 0.3 
HP35 0.7 -0.1 0.6 0.3 0.1 
SP11 0.3 -0.4 0.7 0.7 -0.3 
SP12 0.1 0.2 0.2 0.2 -0.1 
SP13 0.9 -0.1 0.5 0.1 0.3 
SP21 0.4 -0.1 0.7 0.1 -0.3 
SP22 0.5 -0.2 0.1 0.7 -0.3 
SP23 0.1 -0.2 0.1 0.3 -0.2 
SP32 0.6 -0.2 0.5 0.3 -0.1 
SP34 0.7 -0.4 0.5 0.2 0.3 
SP35 0.9 -0.2 0.1 0.1 0.1 
;
run;

data horizons;
  retain n; drop n;
  infile datalines truncover;
  input time val1 val2 val3 val4; 
  n+1;
  if time=99 then call symput('_nobs',left(n-1));
  else output;
datalines;
1 0.01 0.02 0.05 0.08
2 0.02 0.03 0.02 0.08
3 0.07 0.02 0.03 0.03
4 0.02 0.02 0.04 0.08
5 0.04 0.07 0.01 0.08
6 0.01 0.07 0.01 0.02
7 0.02 0.05 0.02 0.07
8 0.06 0.02 0.02 0.04
9 0.01 0.06 0.02 0.08
10 0.03 0.06 0.06 0.08
11 0.02 0.04 0.05 0.08
12 0.02 0.01 0.05 0.08
13 0.07 0.01 0.04 0.08
14 0.09 0.01 0.03 0.02
15 0.02 0.06 0.02 0.08
16 0.01 0.07 0.03 0.04
17 0.02 0.09 0.06 0.02
18 0.02 0.02 0.02 0.02
19 0.08 0.01 0.07 0.03
20 0.06 0.03 0.02 0.02
21 0.01 0.02 0.03 0.05
22 0.06 0.04 0.01 0.06
23 0.02 0.04 0.02 0.05 
24 0.04 0.01 0.05 0.09
25 0.01 0.01 0.03 0.01
99
;
run;
%put No of Values = &amp;amp;_nobs;

data want;
  set factors;
  retain tar1-tar&amp;amp;_nobs;
  array tar {&amp;amp;_nobs} tar1-tar&amp;amp;_nobs;
  do _point=1 to &amp;amp;_nobs;
    set horizons point=_point;
    tar(time) = fact1+  (fact2* val1)+(fact3* val2)+(fact4*val3)+ (fact5*val4);
  end;
  drop time val1-val4;
  output; 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 Jul 2017 18:45:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-column-with-Changing-formula/m-p/378549#M90995</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-07-23T18:45:14Z</dc:date>
    </item>
  </channel>
</rss>

