<?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: Arithmetic operations in sas in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174781#M9026</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Arthur - Yes, if first id is not missing then your suggested solution is a definite choice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naeem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 May 2014 19:28:22 GMT</pubDate>
    <dc:creator>stat_sas</dc:creator>
    <dc:date>2014-05-30T19:28:22Z</dc:date>
    <item>
      <title>Arithmetic operations in sas</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174774#M9019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a data set and I attached it to my message.&amp;nbsp; You can see it below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to calculate bolt_volume. It looks simple but I couldn't get correct results. The formula has already written in excel sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bolt_volume[row2] = ( bolt_area[row1] + bolt_area[row2] ) / 2 * bolt_len[row2]&lt;/P&gt;&lt;P&gt;bolt_volume[row3] = ( bolt_area[row2] + bolt_area[row3] ) / 2 * bolt_len[row3]&lt;/P&gt;&lt;P&gt;...........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 378px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl75" height="20" width="64"&gt;tree_no&lt;/TD&gt;&lt;TD class="xl76" style="border-left: none;" width="64"&gt;bolt_no&lt;/TD&gt;&lt;TD class="xl76" style="border-left: none;" width="74"&gt;bolt_len&lt;/TD&gt;&lt;TD class="xl77" style="border-left: none;" width="90"&gt;bolt_area&lt;/TD&gt;&lt;TD class="xl78" style="border-left: none;" width="86"&gt;bolt_volume&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl71" height="19"&gt;1&lt;/TD&gt;&lt;TD class="xl72" style="border-left: none;"&gt;&lt;/TD&gt;&lt;TD class="xl72" style="border-left: none;"&gt;&lt;/TD&gt;&lt;TD class="xl73" style="border-left: none;"&gt;1.235344635&lt;/TD&gt;&lt;TD class="xl74" style="border-left: none;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0.89358336&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;2.128927995&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0.821784859&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;1.715368219&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0.346877809&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0.276875719&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.623753528&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0.226900035&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.503775754&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0.294638715&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="19" style="border-top: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0.193085235&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.48772395&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20" style="border-top: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl69" style="border-top: none; border-left: none;"&gt;0.185057629&lt;/TD&gt;&lt;TD align="right" class="xl70" style="border-top: none; border-left: none;"&gt;0.378142864&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 21:14:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174774#M9019</guid>
      <dc:creator>gencharitaci</dc:creator>
      <dc:date>2014-05-27T21:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Arithmetic operations in sas</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174775#M9020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work for the desired output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naeem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;bolt_volume=(bolt_area+lag(bolt_area))/2*bolt_len;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 21:30:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174775#M9020</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-05-27T21:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Arithmetic operations in sas</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174776#M9021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is one way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by tree_no;&lt;/P&gt;&lt;P&gt;&amp;nbsp; bolt_volume=ifn(first.tree_no,.,lag(bolt_area)+bolt_area) / 2 * bolt_len;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 21:34:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174776#M9021</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-05-27T21:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arithmetic operations in sas</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174777#M9022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="813022" data-username="stat%40sas" href="https://communities.sas.com/people/stat@sas" id="jive-81302216607338852175711"&gt;stat@sas&lt;/A&gt;&amp;nbsp; &lt;/STRONG&gt;and&amp;nbsp; &lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="1088" data-externalid="" data-presence="null" data-userid="149594" data-username="art297" href="https://communities.sas.com/people/art297" id="jive-14959416709803540344711"&gt;Arthur Tabachneck&lt;/A&gt; ,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="j-post-author "&gt;&lt;SPAN class="j-post-author "&gt;Both of your codes worked perfectly. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 02:26:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174777#M9022</guid>
      <dc:creator>gencharitaci</dc:creator>
      <dc:date>2014-05-29T02:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Arithmetic operations in sas</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174778#M9023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just be careful with &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Naeem&lt;/SPAN&gt;'s code as it will give you non-missing, and wrong values, for the 1st record of the 2nd thru Nth by groups.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 02:49:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174778#M9023</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-05-29T02:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Arithmetic operations in sas</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174779#M9024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@&lt;SPAN class="j-post-author "&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="1088" data-externalid="" data-presence="null" data-userid="149594" data-username="art297" href="https://communities.sas.com/people/art297" id="jive-14959416782334468907711"&gt;Arthur Tabachneck&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;My original data set has more than 2000 observations. After I saw your message, I checked your codes and Nadeem's codes for my data set. But I couldn't see wrong values 1st record of the 2nd through Nth by groups.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 00:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174779#M9024</guid>
      <dc:creator>gencharitaci</dc:creator>
      <dc:date>2014-05-30T00:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Arithmetic operations in sas</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174780#M9025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I stand corrected!&amp;nbsp; I hadn't noticed that bolt_len was always missing for your first record within an id.&amp;nbsp; If that is the case in all situations, then &lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Naeem&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;'s code will provide the correct result.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 02:54:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174780#M9025</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-05-30T02:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Arithmetic operations in sas</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174781#M9026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Arthur - Yes, if first id is not missing then your suggested solution is a definite choice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naeem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 19:28:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174781#M9026</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-05-30T19:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Arithmetic operations in sas</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174782#M9027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok. I see now. That's tender spot. &lt;/P&gt;&lt;P&gt;Thanks Arthur.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 19:54:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/174782#M9027</guid>
      <dc:creator>gencharitaci</dc:creator>
      <dc:date>2014-05-30T19:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Arithmetic operations in sas</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/366428#M19226</link>
      <description>&lt;P&gt;An &lt;A href="https://sascertified.wordpress.com/sas-operators/" target="_blank"&gt;&lt;STRONG&gt;operator in SAS&lt;/STRONG&gt;&lt;/A&gt; is a symbol which is used in a mathematical, logical or comparison expression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example Arithmetic Operators.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA MYDATA1;&lt;BR /&gt;input @1 COL1 4.2 @7 COL2 3.1;&lt;BR /&gt;Add_result = COL1+COL2;&lt;BR /&gt;Sub_result = COL1-COL2;&lt;BR /&gt;Mult_result = COL1*COL2;&lt;BR /&gt;Div_result = COL1/COL2;&lt;BR /&gt;Expo_result = COL1**COL2;&lt;BR /&gt;datalines;&lt;BR /&gt;11.21 5.3&lt;BR /&gt;3.11 11&lt;BR /&gt;;&lt;BR /&gt;PROC PRINT DATA=MYDATA1;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On running the above code, we get the following &lt;STRONG&gt;output&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://sascertified.wordpress.com/sas-operators/" target="_blank"&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9345i1A2DB3EDB9D66A92/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="operators_arithmrtic.jpg" title="operators_arithmrtic.jpg" /&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 12:12:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Arithmetic-operations-in-sas/m-p/366428#M19226</guid>
      <dc:creator>Justin_Allison</dc:creator>
      <dc:date>2017-06-14T12:12:58Z</dc:date>
    </item>
  </channel>
</rss>

