<?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: Why this error comes up instead of simply calculating the variable newsale in the compute block? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937598#M368407</link>
    <description>&lt;P&gt;I had already attached the screenshot for&amp;nbsp;relevant issues in first place still if you want here is the full log&lt;/P&gt;
&lt;P&gt;I have moved the NEWSALE variable to the right of the MSRP still getting the same note as below&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nipun22_0-1722345562396.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98817i3A9D26E13F458659/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nipun22_0-1722345562396.png" alt="Nipun22_0-1722345562396.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jul 2024 13:21:32 GMT</pubDate>
    <dc:creator>Nipun22</dc:creator>
    <dc:date>2024-07-30T13:21:32Z</dc:date>
    <item>
      <title>Why this error comes up instead of simply calculating the variable newsale in the compute block?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937591#M368403</link>
      <description>&lt;P&gt;data cars;&lt;BR /&gt;set sashelp.cars;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc report data = cars;&lt;BR /&gt;col ('Report submitted by telecom pvt ltd' make type origin newsale msrp,(min max mean));&lt;BR /&gt;define make/ group;&lt;BR /&gt;define type/ group;&lt;BR /&gt;define origin/ group;&lt;BR /&gt;define newsale/ computed format=dollar7.;&lt;BR /&gt;compute newsale;&lt;BR /&gt;newsale = msrp + 100;&lt;BR /&gt;endcomp;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I saw that I can do this by using the across option in define statement of any of the variable and just mention the column number but I want to do this way by mentioning the variable name. Any logic with little explanation would be appreciated&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nipun22_0-1722344138915.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98816i90225DAEF5C6C030/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nipun22_0-1722344138915.png" alt="Nipun22_0-1722344138915.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 12:58:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937591#M368403</guid>
      <dc:creator>Nipun22</dc:creator>
      <dc:date>2024-07-30T12:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why this error comes up instead of simply calculating the variable newsale in the compute block?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937592#M368404</link>
      <description>&lt;P&gt;You did not get an ERROR, you got a NOTE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From now on when you get an ERROR or WARNING or NOTE that you don't understand, please show us the log for this PROC, including the code as it appears in the LOG. Showing us ERROR or WARNING or NOTE messages detached from the code is not as helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A couple of problems here:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;MSRP is not defined as an across variable.&lt;/LI&gt;
&lt;LI&gt;When you do a COMPUTE on variables, the COMPUTE can only use variables to the left in the COLUMNS statement. Since MSRP is to the right of NEWSALE in the columns statement, it cannot be used.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;When you define an across variable, this means that many of the columns in your PROC REPORT cannot be referred to by name, they can only be referred to by _Cn_&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 13:17:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937592#M368404</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-07-30T13:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why this error comes up instead of simply calculating the variable newsale in the compute block?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937598#M368407</link>
      <description>&lt;P&gt;I had already attached the screenshot for&amp;nbsp;relevant issues in first place still if you want here is the full log&lt;/P&gt;
&lt;P&gt;I have moved the NEWSALE variable to the right of the MSRP still getting the same note as below&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nipun22_0-1722345562396.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98817i3A9D26E13F458659/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nipun22_0-1722345562396.png" alt="Nipun22_0-1722345562396.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 13:21:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937598#M368407</guid>
      <dc:creator>Nipun22</dc:creator>
      <dc:date>2024-07-30T13:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why this error comes up instead of simply calculating the variable newsale in the compute block?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937601#M368408</link>
      <description>&lt;P&gt;This is not the full log. I want to see the entire log for this PROC, &lt;FONT color="#FF0000"&gt;including the code as it appears in the log&lt;/FONT&gt;. And also please provide the log as text (not as screen capture), pasted into the window that appears when you click on the &amp;lt;/&amp;gt; icon.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png" style="width: 859px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66123iA4EF494F9CA0F6EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png" alt="2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 13:27:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937601#M368408</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-07-30T13:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why this error comes up instead of simply calculating the variable newsale in the compute block?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937605#M368409</link>
      <description>&lt;PRE&gt;1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 68         
 69         data cars;
 70         set sashelp.cars;
 71         run;
 
 NOTE: There were 428 observations read from the data set SASHELP.CARS.
 NOTE: The data set WORK.CARS has 428 observations and 15 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       user cpu time       0.00 seconds
       system cpu time     0.00 seconds
       memory              845.06k
       OS Memory           22180.00k
       Timestamp           07/30/2024 01:27:47 PM
       Step Count                        161  Switch Count  2
       Page Faults                       0
       Page Reclaims                     109
       Page Swaps                        0
       Voluntary Context Switches        10
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           272
       
 
 72         
 73         proc report data = cars;
 74         col ('Report submitted by telecom pvt ltd' make type origin msrp,(min max mean) newsale);
 75         define make/ group;
 76         define type/ group;
 77         define origin/ group;
 78         define newsale/ computed format=dollar7.;
 79         compute newsale;
 80         newsale = msrp + 100;
 81         endcomp;
 82         run;
 
 NOTE: Variable msrp is uninitialized.
 NOTE: Missing values were generated as a result of performing an operation on missing values.
       Each place is given by: (Number of times) at (Line):(Column).
       114 at 1:17   
 NOTE: There were 428 observations read from the data set WORK.CARS.
 NOTE: PROCEDURE REPORT used (Total process time):
       real time           0.08 seconds
       user cpu time       0.09 seconds
       system cpu time     0.01 seconds
       memory              9112.32k
       OS Memory           31160.00k
       Timestamp           07/30/2024 01:27:47 PM
       Step Count                        162  Switch Count  1
       Page Faults                       0
       Page Reclaims                     2128
       Page Swaps                        0
       Voluntary Context Switches        18
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           48
       
 
 83         
 84         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 94         &lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jul 2024 13:29:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937605#M368409</guid>
      <dc:creator>Nipun22</dc:creator>
      <dc:date>2024-07-30T13:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why this error comes up instead of simply calculating the variable newsale in the compute block?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937606#M368410</link>
      <description>&lt;P&gt;Please read carefully, I don't want the log of the entire program, I want the entire log for that PROC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UPDATE: See response from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 13:43:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937606#M368410</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-07-30T13:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why this error comes up instead of simply calculating the variable newsale in the compute block?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937607#M368411</link>
      <description>&lt;P&gt;WHICH statistic of MSRP did you want to use for Newsale??? You have msrp,(min max mean) so there are three statistics in play.&lt;/P&gt;
&lt;P&gt;After fixing the order of the variables on the Columns statement here is an example of using ONE of the statistics, in this case the MEAN to calculate Newsale.&lt;/P&gt;
&lt;P&gt;You are getting an "uninitialized" note because you did not provide enough information in the Compute block.&lt;/P&gt;
&lt;PRE&gt;proc report data = cars;
   columns  make type origin msrp,(min max mean) newsale ;
   define make/ group;
   define type/ group;
   define origin/ group;

   define newsale/ computed format=dollar7.;
   compute newsale;
      newsale = msrp.mean + 100;
   endcomp;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jul 2024 13:41:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937607#M368411</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-07-30T13:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why this error comes up instead of simply calculating the variable newsale in the compute block?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937610#M368412</link>
      <description>&lt;P&gt;Yes sure, I just wanted this kind of table where just a new variable NEWSALE is added at the last which will be calculated as MSRP + 100. Everything is good but the log keeps saying two things due to which the NEWSALE variable is empty -&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI id="sasLogNote4_1722346893265" class="sasNote"&gt;Variable msrp is uninitialized.&lt;/LI&gt;
&lt;LI id="sasLogNote5_1722346893265" class="sasNote"&gt;NOTE: Missing values were generated as a result of performing an operation on missing values. Each place is given by (Number of times) at (Line):(Column).&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nipun22_0-1722346926515.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98820iB5B6832C86A4424D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nipun22_0-1722346926515.png" alt="Nipun22_0-1722346926515.png" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;hope I you understood the problem and purpose of the code now&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 13:47:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937610#M368412</guid>
      <dc:creator>Nipun22</dc:creator>
      <dc:date>2024-07-30T13:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why this error comes up instead of simply calculating the variable newsale in the compute block?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937612#M368413</link>
      <description>Yes I know this syntax. I could have done this but I want different results. Please check my last reply where I have described by needs briefly</description>
      <pubDate>Tue, 30 Jul 2024 13:51:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937612#M368413</guid>
      <dc:creator>Nipun22</dc:creator>
      <dc:date>2024-07-30T13:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Why this error comes up instead of simply calculating the variable newsale in the compute block?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937616#M368415</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/420483"&gt;@Nipun22&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Yes I know this syntax. I could have done this but I want different results. Please check my last reply where I have described by needs briefly&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You have not clearly enough stated your requirement for Proc Report to calculate. To use any sort of compute to calculate you must meet the syntax rules. You have not stated what MSRP+100 in this context actually means. Which is in effect what Proc Report is also complaining about.&lt;/P&gt;
&lt;P&gt;I don't know what number you expect to show for Newsale. Repeating the same incomplete information does not provide any clue as to a possible solution, if at all possible. The Note SAS is providing about "MSRP is uninitialized" is a clue that more information about how you expect to use MSRP is required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because you have used the syntax msrp,(min max mean) you have limited the easy to get values as MSRP.Min, MSRP.MAX and MSRP.MEAN as shown in the compute block that does not generate the note. IF you want something else then you have to find a way to provide the information to us and then we may come up with the procedure requirements. But without them we can't.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Computers are dumb. You have to tell them what you want. Regardless of what the AI folks are promising they still cannot read your mind as to what value is supposed to appear in the column Newsales.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 14:17:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937616#M368415</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-07-30T14:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why this error comes up instead of simply calculating the variable newsale in the compute block?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937622#M368417</link>
      <description>&lt;P&gt;Okay I have stated my issue in the simplest way I could. Let's take it this way forget whatever we have discussed till now. Here I am giving you this code of a table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data cars;
set sashelp.cars;
run;

proc report data = cars;
col ('Report submitted by telecom pvt ltd' make type origin msrp,(min max mean));
define make/ group;
define type/ group;
define origin/ group;
run;&lt;/PRE&gt;
&lt;P&gt;write syntax for new variable NEWSALE calculated as below-&lt;/P&gt;
&lt;P&gt;NEWSALE = MSRP + 100;&lt;/P&gt;
&lt;P&gt;In words - I want to add or increment MSRP by 100 and store it in a new variable called NEWSALE&lt;/P&gt;
&lt;P&gt;It is as simple as it sounds. Just write whatever you know. Also, let me know if it is programmatically possible or not.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 14:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937622#M368417</guid>
      <dc:creator>Nipun22</dc:creator>
      <dc:date>2024-07-30T14:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why this error comes up instead of simply calculating the variable newsale in the compute block?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937634#M368419</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/420483"&gt;@Nipun22&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Okay I have stated my issue in the simplest way I could. Let's take it this way forget whatever we have discussed till now. Here I am giving you this code of a table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data cars;
set sashelp.cars;
run;

proc report data = cars;
col ('Report submitted by telecom pvt ltd' make type origin msrp,(min max mean));
define make/ group;
define type/ group;
define origin/ group;
run;&lt;/PRE&gt;
&lt;P&gt;write syntax for new variable NEWSALE calculated as below-&lt;/P&gt;
&lt;P&gt;&lt;FONT size="7" color="#800000"&gt;&lt;STRONG&gt;NEWSALE = MSRP + 100;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;In words - I want to add or increment MSRP by 100 and store it in a new variable called NEWSALE&lt;/P&gt;
&lt;P&gt;It is as simple as it sounds. Just write whatever you know. Also, let me know if it is programmatically possible or not.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Still not a clear description of the &lt;STRONG&gt;value&lt;/STRONG&gt; that Newsale should have. Because you are in a Procedure like Report you have to define it in terms of what the procedure can do/allow. As a person, I don't know what you want as it is not clear whether you want to&lt;/P&gt;
&lt;P&gt;1) add 100 to a displayed statistic based on MSRP (easy but with the statistics&amp;nbsp; you have shown limits it to those three and would need to be stated)&lt;/P&gt;
&lt;P&gt;2) add 100 to a not-displayed statistic, which statistic would need to be stated and requires some additions to the code but likely not difficult&lt;/P&gt;
&lt;P&gt;3) something else that is not intuitively obvious that is quite likely to require a bit more coding. A description, starting with the data set of how to calculate it by hand is needed.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 15:20:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937634#M368419</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-07-30T15:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why this error comes up instead of simply calculating the variable newsale in the compute block?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937640#M368422</link>
      <description>&lt;P&gt;This is the generated DEFINE for the alias XMSRP.&amp;nbsp; &amp;nbsp;Don't know if this helps or not.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;DEFINE xmsrp / &lt;FONT color="#FF6600"&gt;SUM&lt;/FONT&gt; FORMAT= DOLLAR8. WIDTH=8 SPACING=2 RIGHT "MSRP" ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cars;
   set sashelp.cars;
   run;

proc report data = cars;
   col ('Report submitted by telecom pvt ltd' make type origin msrp=xmsrp newsale msrp,(min max mean));
   define make/ group;
   define type/ group;
   define origin/ group;
   define newsale/ computed format=dollar7.;
      compute newsale;
      newsale = xmsrp + 100;
      endcomp;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 444px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98828i1B34F9B61638A140/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC REPORT DATA=WORK.CARS LS=132 PS=60  SPLIT="/" CENTER ;
COLUMN  ( ("Report submitted by telecom pvt ltd"  Make Type Origin MSRP=xmsrp newsale MSRP,( min max mean ) ) );
 
DEFINE  Make / GROUP FORMAT= $13. WIDTH=13    SPACING=2   LEFT "Make" ;
DEFINE  Type / GROUP FORMAT= $8. WIDTH=8     SPACING=2   LEFT "Type" ;
DEFINE  Origin / GROUP FORMAT= $6. WIDTH=6     SPACING=2   LEFT "Origin" ;
DEFINE  xmsrp / SUM FORMAT= DOLLAR8. WIDTH=8     SPACING=2   RIGHT "MSRP" ;
DEFINE  newsale / COMPUTED FORMAT= DOLLAR7. WIDTH=7     SPACING=2   RIGHT "newsale" ;
DEFINE  MSRP / SUM FORMAT= DOLLAR8. WIDTH=8     SPACING=2   RIGHT "MSRP" ;
DEFINE  min / FORMAT= DOLLAR8. WIDTH=9     SPACING=2   RIGHT "min" ;
DEFINE  max / FORMAT= DOLLAR8. WIDTH=9     SPACING=2   RIGHT "max" ;
DEFINE  mean / FORMAT= DOLLAR8. WIDTH=9     SPACING=2   RIGHT "mean" ;

COMPUTE  newsale;
newsale = xmsrp +100;
ENDCOMP;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jul 2024 15:46:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937640#M368422</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2024-07-30T15:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why this error comes up instead of simply calculating the variable newsale in the compute block?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937642#M368424</link>
      <description>&lt;P&gt;For a variable that is being aggregated within a group you need to tell PROC REPORT which stat you want.&amp;nbsp; If you want the SUM then add .SUM to the variable name in the code block.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cars;
set sashelp.cars (obs=40);
run;

proc report data = cars;
col ('Report submitted by telecom pvt ltd' make type origin msrp
  newsale) 
;
define make/ group;
define type/ group;
define origin/ group;
define newsale / computed format=dollar10.;
compute newsale;
  newsale = msrp.sum + 100;
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result&lt;/P&gt;
&lt;PRE&gt;           Report submitted by telecom pvt ltd
  Make           Type      Origin      MSRP     newsale
  Acura          SUV       Asia     $36,945     $37,045
                 Sedan     Asia    $173,860    $173,960
                 Sports    Asia     $89,765     $89,865
  Audi           Sedan     Europe  $534,400    $534,500
                 Sports    Europe  $198,520    $198,620
                 Wagon     Europe   $89,930     $90,030
  BMW            SUV       Europe   $89,195     $89,295
                 Sedan     Europe  $490,740    $490,840

&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jul 2024 16:35:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937642#M368424</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-07-30T16:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why this error comes up instead of simply calculating the variable newsale in the compute block?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937649#M368428</link>
      <description>Thank you so much man. That's what I have been explaining for so long just to add 100 to the MSRP that's it.</description>
      <pubDate>Tue, 30 Jul 2024 17:33:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-this-error-comes-up-instead-of-simply-calculating-the/m-p/937649#M368428</guid>
      <dc:creator>Nipun22</dc:creator>
      <dc:date>2024-07-30T17:33:29Z</dc:date>
    </item>
  </channel>
</rss>

