<?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: Deleting and adding specific row/column in SAS output in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Deleting-and-adding-specific-row-column-in-SAS-output/m-p/730212#M227361</link>
    <description>&lt;P&gt;What would go on that "total" row?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your Have data step is likely incorrect and you want either (if dz is supposed to be only "stroke" and area is numeric&lt;/P&gt;
&lt;PRE&gt;DATA HAVE;
input year dz :$8. area;
cards;
2000 stroke 08
2000 stroke 06
2000 stroke 06
;
run;&lt;/PRE&gt;
&lt;P&gt;OR if area is supposed to be character.&lt;/P&gt;
&lt;PRE&gt;DATA HAVE;
input year dz :$8. area $;
cards;
2000 stroke 08
2000 stroke 06
2000 stroke 06
;
run;&lt;/PRE&gt;
&lt;P&gt;I suspect you are not providing enough information as with this small sample you get the same counts and percentages with:&lt;/P&gt;
&lt;PRE&gt;proc freq data=have;
   tables area;
run;
 &lt;/PRE&gt;
&lt;P&gt;Perhaps you are looking for a different reporting procedure. Here is a "total" row done with Proc Tabulate:&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=have;
   class area;
   tables area=' ' all='Total',
          n='Frequency' pctn='Percent'
          /box=area
   ;
run;
 &lt;/PRE&gt;
&lt;P&gt;Tabulate has a different set of options as it does different statistics and has the ability to nest variables in both row, column and Page(separate table) dimensions. The Area=' ' suppresses the default label of the Area variable, box places it into what would normally be an empty box in the upper left. "All" requests a total within a dimension, the ='Total' provides a label. N requests a count and Pctn asks for the basic percentage and again the ='text' provides a label other than the default N or PCTN.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Mar 2021 21:43:11 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-03-30T21:43:11Z</dc:date>
    <item>
      <title>Deleting and adding specific row/column in SAS output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-and-adding-specific-row-column-in-SAS-output/m-p/730203#M227358</link>
      <description>&lt;P&gt;I have the following data&lt;/P&gt;&lt;P&gt;DATA HAVE;&lt;BR /&gt;input year dz $8. area;&lt;BR /&gt;cards;&lt;BR /&gt;2000 stroke 08&lt;BR /&gt;2000 stroke 06&lt;BR /&gt;2000 stroke 06&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After using proc freq&lt;/P&gt;&lt;P&gt;proc freq data=have;&lt;BR /&gt;table area*dz/ list nocum ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the below output&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Priyamvada07_0-1617136480788.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/56679iE37D9EED97D3B1F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Priyamvada07_0-1617136480788.png" alt="Priyamvada07_0-1617136480788.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this output&lt;/P&gt;&lt;P&gt;1. I want to delete the 'dz', what can I do to delete this column?&lt;/P&gt;&lt;P&gt;2. I want a row in the end that gives 'total', what can I do to get a 'total' row?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 20:40:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-and-adding-specific-row-column-in-SAS-output/m-p/730203#M227358</guid>
      <dc:creator>Priyamvada07</dc:creator>
      <dc:date>2021-03-30T20:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting and adding specific row/column in SAS output</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Deleting-and-adding-specific-row-column-in-SAS-output/m-p/730212#M227361</link>
      <description>&lt;P&gt;What would go on that "total" row?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your Have data step is likely incorrect and you want either (if dz is supposed to be only "stroke" and area is numeric&lt;/P&gt;
&lt;PRE&gt;DATA HAVE;
input year dz :$8. area;
cards;
2000 stroke 08
2000 stroke 06
2000 stroke 06
;
run;&lt;/PRE&gt;
&lt;P&gt;OR if area is supposed to be character.&lt;/P&gt;
&lt;PRE&gt;DATA HAVE;
input year dz :$8. area $;
cards;
2000 stroke 08
2000 stroke 06
2000 stroke 06
;
run;&lt;/PRE&gt;
&lt;P&gt;I suspect you are not providing enough information as with this small sample you get the same counts and percentages with:&lt;/P&gt;
&lt;PRE&gt;proc freq data=have;
   tables area;
run;
 &lt;/PRE&gt;
&lt;P&gt;Perhaps you are looking for a different reporting procedure. Here is a "total" row done with Proc Tabulate:&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=have;
   class area;
   tables area=' ' all='Total',
          n='Frequency' pctn='Percent'
          /box=area
   ;
run;
 &lt;/PRE&gt;
&lt;P&gt;Tabulate has a different set of options as it does different statistics and has the ability to nest variables in both row, column and Page(separate table) dimensions. The Area=' ' suppresses the default label of the Area variable, box places it into what would normally be an empty box in the upper left. "All" requests a total within a dimension, the ='Total' provides a label. N requests a count and Pctn asks for the basic percentage and again the ='text' provides a label other than the default N or PCTN.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 21:43:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Deleting-and-adding-specific-row-column-in-SAS-output/m-p/730212#M227361</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-30T21:43:11Z</dc:date>
    </item>
  </channel>
</rss>

