<?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: Trying to multiply same value for a month across in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-multiply-same-value-for-a-month-across/m-p/717426#M221868</link>
    <description>Thanks.</description>
    <pubDate>Sun, 07 Feb 2021 17:12:11 GMT</pubDate>
    <dc:creator>ubshams</dc:creator>
    <dc:date>2021-02-07T17:12:11Z</dc:date>
    <item>
      <title>Trying to multiply same value for a month across</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-multiply-same-value-for-a-month-across/m-p/717343#M221817</link>
      <description>&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;I am creating a variable4 which takes the Month 4 value of variable 3 and multiplies it by the value of &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;(variable2/variable3). Right now I am manually typing the Month 4 value of 105 to get create variable4. Can this be automated by code? &lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;I created a new column with _N values but stuck on whether to use this or not. &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; month variable1 variable2 variable3;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;cards&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 501 500 95&lt;/P&gt;
&lt;P&gt;2 500 502 96&lt;/P&gt;
&lt;P&gt;3 510 502 101&lt;/P&gt;
&lt;P&gt;4 509 400 105&lt;/P&gt;
&lt;P&gt;5 506 402 106&lt;/P&gt;
&lt;P&gt;6 512 400 98&lt;/P&gt;
&lt;P&gt;7 400 399 95&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; want;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;variable4= (variable2/variable3)*&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;105&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;n = _N_;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Feb 2021 01:53:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-multiply-same-value-for-a-month-across/m-p/717343#M221817</guid>
      <dc:creator>ubshams</dc:creator>
      <dc:date>2021-02-07T01:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to multiply same value for a month across</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-multiply-same-value-for-a-month-across/m-p/717345#M221818</link>
      <description>&lt;P&gt;Sure.&amp;nbsp; Here's one way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   if _n_=1 then set have (rename=(variable3=month4_value) where=(month=4));
   set have;
   variable4= (variable2/variable3)*month4_value;
   n = _N_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 07 Feb 2021 02:29:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-multiply-same-value-for-a-month-across/m-p/717345#M221818</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-02-07T02:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to multiply same value for a month across</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trying-to-multiply-same-value-for-a-month-across/m-p/717426#M221868</link>
      <description>Thanks.</description>
      <pubDate>Sun, 07 Feb 2021 17:12:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trying-to-multiply-same-value-for-a-month-across/m-p/717426#M221868</guid>
      <dc:creator>ubshams</dc:creator>
      <dc:date>2021-02-07T17:12:11Z</dc:date>
    </item>
  </channel>
</rss>

