<?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: Last observation: total of column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Last-observation-total-of-column/m-p/308017#M66025</link>
    <description>&lt;P&gt;Pay attention that TOTAL rows are with missing date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use PROC IMPORT then you need add a second step, otherwise you can do it in same data step&lt;/P&gt;
&lt;P&gt;reading your csv file to sas:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want; set have;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; if date = . then delete; &amp;nbsp;&lt;/STRONG&gt;/* or if missing(date) then delete */&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Oct 2016 20:13:47 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2016-10-28T20:13:47Z</dc:date>
    <item>
      <title>Last observation: total of column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Last-observation-total-of-column/m-p/308012#M66023</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a csv table, and at the end of each column, I have the total of the column that appears. I would separate the last line, and that the line is not an observation but the total.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;..... &amp;nbsp;, ...... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , ...;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;02/10/2016,126,473&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;03/10/2016,213,648&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;04/10/2016,242,809&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;05/10/2016,235,807&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;06/10/2016,285,1013&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;07/10/2016,260,905&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;08/10/2016,132,400&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;09/10/2016,150,446&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/10/2016,256,655&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;11/10/2016,249,790&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;,611246,1864947&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN&gt;,611246,1864947 &amp;nbsp;&lt;/SPAN&gt;here in the last line, the total of column 2 and 3.&lt;/P&gt;&lt;P&gt;I want : &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ......... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;....&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV align="center"&gt;&lt;BR /&gt;&lt;DIV class="branch"&gt;&lt;DIV align="center"&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5563i23F4257F32621CD9/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="sas.JPG" title="sas.JPG" /&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your help.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 20:00:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Last-observation-total-of-column/m-p/308012#M66023</guid>
      <dc:creator>WilliamB</dc:creator>
      <dc:date>2016-10-28T20:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Last observation: total of column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Last-observation-total-of-column/m-p/308017#M66025</link>
      <description>&lt;P&gt;Pay attention that TOTAL rows are with missing date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use PROC IMPORT then you need add a second step, otherwise you can do it in same data step&lt;/P&gt;
&lt;P&gt;reading your csv file to sas:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want; set have;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; if date = . then delete; &amp;nbsp;&lt;/STRONG&gt;/* or if missing(date) then delete */&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 20:13:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Last-observation-total-of-column/m-p/308017#M66025</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-10-28T20:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Last observation: total of column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Last-observation-total-of-column/m-p/308064#M66051</link>
      <description>&lt;PRE&gt;

filename x temp;
data _null_;
file x;
input;
put _infile_;
datalines;
02/10/2016,126,473
03/10/2016,213,648
04/10/2016,242,809
05/10/2016,235,807
06/10/2016,285,1013
07/10/2016,260,905
08/10/2016,132,400
09/10/2016,150,446
10/10/2016,256,655
11/10/2016,249,790
,611246,1864947
;
run;



data have;
length id $ 20;
infile x dsd truncover end=last;
input date : ddmmyy10. x y;
format date ddmmyy10.;
id=put(_n_,best. -l);
if last then id='Total';
run;
proc print noobs;run;


&lt;/PRE&gt;</description>
      <pubDate>Sat, 29 Oct 2016 04:53:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Last-observation-total-of-column/m-p/308064#M66051</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-29T04:53:28Z</dc:date>
    </item>
  </channel>
</rss>

