<?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: Multiplying positive and negative numbers in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771408#M244795</link>
    <description>&lt;P&gt;can you post your data and code?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Sep 2021 16:01:14 GMT</pubDate>
    <dc:creator>tarheel13</dc:creator>
    <dc:date>2021-09-30T16:01:14Z</dc:date>
    <item>
      <title>Multiplying positive and negative numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771306#M244725</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am struggling to find the product of a negative and a positive number. My data is as below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Product&amp;nbsp; &amp;nbsp; &amp;nbsp; Year&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Variable1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Variable2&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2010&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.234&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -12345&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2011&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.545&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -59865&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2010&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.896&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -56896&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2011&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.568&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -13899&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to multiply variable 1 and variable 2. How do I deal with this? Would appreciate all your help. Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 04:11:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771306#M244725</guid>
      <dc:creator>PDevi</dc:creator>
      <dc:date>2021-09-30T04:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplying positive and negative numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771309#M244727</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;You can use assignment statement to multiply the two variables.&lt;BR /&gt;&lt;BR /&gt;Refer to documentation below.&lt;BR /&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/v_014/ds2ref/n1eexsj5t1lpn3n1bflloua85i1p.htm" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/pgmsascdc/v_014/ds2ref/n1eexsj5t1lpn3n1bflloua85i1p.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use he code below.&lt;BR /&gt;&lt;BR /&gt;data abc_mult; */creates a temporray data /*&lt;BR /&gt;set abc; */Read your data/*&lt;BR /&gt;var_prod=Variable1*Variable2; */Assignment Statement to multiply two variables/*&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;This assignment statement will help you to multiply positive and negative variable as well.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 05:12:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771309#M244727</guid>
      <dc:creator>SAS47</dc:creator>
      <dc:date>2021-09-30T05:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplying positive and negative numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771362#M244770</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/396961"&gt;@SAS47&lt;/a&gt; I was running this exact same code but it is returning only empty values; hence my struggle. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 30 Sep 2021 13:05:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771362#M244770</guid>
      <dc:creator>PDevi</dc:creator>
      <dc:date>2021-09-30T13:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplying positive and negative numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771368#M244772</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/225408"&gt;@PDevi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/396961"&gt;@SAS47&lt;/a&gt; I was running this exact same code but it is returning only empty values; hence my struggle. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show us the actual LOG for this data step, all of it, every single line, do not chop out parts of the log for this data step. Also, show us the results.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 14:19:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771368#M244772</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-09-30T14:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplying positive and negative numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771408#M244795</link>
      <description>&lt;P&gt;can you post your data and code?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 16:01:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771408#M244795</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-09-30T16:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplying positive and negative numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771425#M244806</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/225408"&gt;@PDevi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/396961"&gt;@SAS47&lt;/a&gt; I was running this exact same code but it is returning only empty values; hence my struggle. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;When you read the LOG did you see any "invalid data" messages?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or "Variable xxxxxx is unitialized"? That typically means you used a variable name with no values. Which happens when you mean to type "height" but misspell such as "hheight" "heght" or such. SAS will in this case 1) create a variable of the wrong name and 2) assign missing values to it and almost any calculation using that misspelled name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 16:57:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771425#M244806</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-09-30T16:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplying positive and negative numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771595#M244896</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;that was exactly the issue. I had made a very stupid mistake, the label and variable names were slightly different and that was causing this whole issue. Feeling very stupid right now. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help and time.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 14:44:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771595#M244896</guid>
      <dc:creator>PDevi</dc:creator>
      <dc:date>2021-10-01T14:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplying positive and negative numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771619#M244908</link>
      <description>&lt;P&gt;This is why we always ask to see the log, when the code isn't working right. From now on, please show us the log when the code isn't working, and you will then get faster and better answers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, this is why "Read the Log" has risen to number 2 in the "&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068" target="_self"&gt;Maxims of Maximally Efficient SAS Programmers&lt;/A&gt;".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 16:07:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771619#M244908</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-10-01T16:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Multiplying positive and negative numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771631#M244915</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;I will, thanks Paige. And sorry!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 17:57:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiplying-positive-and-negative-numbers/m-p/771631#M244915</guid>
      <dc:creator>PDevi</dc:creator>
      <dc:date>2021-10-01T17:57:53Z</dc:date>
    </item>
  </channel>
</rss>

