<?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 Why is the column sum displayed as *? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Why-is-the-column-sum-displayed-as/m-p/865341#M38239</link>
    <description>&lt;P&gt;I have a numeric column which records the number of deaths per year by gender. In order to calculate the total number of deaths per gender, I used the following code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC SUMMARY DATA=DATA1 NWAY;
VAR no_deaths;
CLASS GENDER_CODE;
OUTPUT OUT=OUT2 (DROP=_TYPE_) SUM=;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and this is what I get:&amp;nbsp;a * is displayed instead of displaying a numeric value. What might be the issue? I also tried using&amp;nbsp;query builder &amp;gt; computed columns, but the same problem persists.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Snap8.png" style="width: 333px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81793iE22AAF47C2DA88C6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snap8.png" alt="Snap8.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Mar 2023 02:25:01 GMT</pubDate>
    <dc:creator>SASnovice23</dc:creator>
    <dc:date>2023-03-21T02:25:01Z</dc:date>
    <item>
      <title>Why is the column sum displayed as *?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-is-the-column-sum-displayed-as/m-p/865341#M38239</link>
      <description>&lt;P&gt;I have a numeric column which records the number of deaths per year by gender. In order to calculate the total number of deaths per gender, I used the following code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC SUMMARY DATA=DATA1 NWAY;
VAR no_deaths;
CLASS GENDER_CODE;
OUTPUT OUT=OUT2 (DROP=_TYPE_) SUM=;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and this is what I get:&amp;nbsp;a * is displayed instead of displaying a numeric value. What might be the issue? I also tried using&amp;nbsp;query builder &amp;gt; computed columns, but the same problem persists.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Snap8.png" style="width: 333px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81793iE22AAF47C2DA88C6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snap8.png" alt="Snap8.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 02:25:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-is-the-column-sum-displayed-as/m-p/865341#M38239</guid>
      <dc:creator>SASnovice23</dc:creator>
      <dc:date>2023-03-21T02:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the column sum displayed as *?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-is-the-column-sum-displayed-as/m-p/865352#M38240</link>
      <description>&lt;P&gt;Somehow you have assigned a format that none of the resulting values will display with.&lt;/P&gt;
&lt;P&gt;Consider this small program that writes the value of the variable X to the results with 5 different formats:&lt;/P&gt;
&lt;PRE&gt;data example;
  x=12345;
  file print;
  put '5 display columns' x= best5.;
  put '4 display columns' x= best4.;
  put '3 display columns' x= best3.;
  put '2 display columns' x= best2.;
  put '1 display columns' x= best1.;
run;&lt;/PRE&gt;
&lt;P&gt;Which generates output like:&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;PRE&gt;5 display columns x=12345                                                                          
4 display columns x=12E3                                                                           
3 display columns x=1E4                                                                            
2 display columns x=**                                                                             
1 display columns x=*                                                                              

 


&lt;/PRE&gt;
You can see that when the value is longer than the number of columns allotted by the format that the BEST format shifts to exponential notation to try to fit the value but when the number of allowed digits is down to 2 or 1 it only displays the * because there is not valid way to show the number. The behavior will change depending on the format actually assigned.&lt;/DIV&gt;
&lt;DIV class="branch"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="branch"&gt;You could either assign a different format in the proc summary step adding something like :&lt;/DIV&gt;
&lt;DIV class="branch"&gt;
&lt;PRE&gt;format no_deaths f8.;&lt;/PRE&gt;
which would allow displaying values up to 8 digits (or use a wider format if needed), change the format in the data set Out2, or assign a different format when using the set. The table viewer you are uses the default assigned format which seems likely to be a 1 width format of some sort&lt;/DIV&gt;
&lt;DIV class="branch"&gt;See what this shows:&lt;/DIV&gt;
&lt;DIV class="branch"&gt;
&lt;PRE&gt;Proc print data=out2 noobs label;
   format no_deaths best16.;
run;&lt;/PRE&gt;
The data set has the value, you just don't see it because of the format. The proc print should show it.&lt;/DIV&gt;
&lt;DIV class="branch"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="branch"&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/441029"&gt;@SASnovice23&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a numeric column which records the number of deaths per year by gender. In order to calculate the total number of deaths per gender, I used the following code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;PROC SUMMARY DATA=DATA1 NWAY;
VAR no_deaths;
CLASS GENDER_CODE;
OUTPUT OUT=OUT2 (DROP=_TYPE_) SUM=;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and this is what I get:&amp;nbsp;a * is displayed instead of displaying a numeric value. What might be the issue? I also tried using&amp;nbsp;query builder &amp;gt; computed columns, but the same problem persists.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Snap8.png" style="width: 333px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81793iE22AAF47C2DA88C6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snap8.png" alt="Snap8.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 04:28:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-is-the-column-sum-displayed-as/m-p/865352#M38240</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-03-21T04:28:43Z</dc:date>
    </item>
  </channel>
</rss>

