<?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: Creating a accumulate totals in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-accumulate-totals/m-p/500902#M133465</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data = ia.literacy;
run;
proc sort data=ia.literacy out=sort_literacy;
   by Subject;
run;
data ia.literacy2(keep Subject id jaundice tot_jaundice);
	set ia.literacy;

by subject;
if first.subject then tot_jaundice =0;
tot_jaundice + jaundice;
if last.subject then output;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Oct 2018 19:08:57 GMT</pubDate>
    <dc:creator>VDD</dc:creator>
    <dc:date>2018-10-02T19:08:57Z</dc:date>
    <item>
      <title>Creating a accumulate totals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-accumulate-totals/m-p/500895#M133459</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data = ia.literacy;
run;
proc sort data=ia.literacy out=sort_literacy;
   by Subject;
run;
data ia.literacy2;
	set ia.literacy;
	tot_jaundice + jaundice;
	keep Subject id jaundice tot_jaundice;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;WARNING: The variable id in the DROP, KEEP, or RENAME list has never been referenced.&lt;/FONT&gt;&lt;BR /&gt;NOTE: There were 50 observations read from the data set IA.LITERACY.&lt;BR /&gt;NOTE: The data set IA.LITERACY2 has 50 observations and 3 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;This is instruction that I got&lt;/P&gt;&lt;P&gt;a. Use the literacy data set. Run proc contents and see what variables are in the data set. Sort the data by Subject number.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;b. Determine the number of subjects that correctly read the word jaundice by creating an accumulation variable. The variable jaundice will have the value of 1 for these subjects if correct, 0 otherwise. Create a temporary dataset and keep just the Subject id, jaundice and the accumulation variable that you create. Use proc means to check that the last observations is the sum of the jaundice variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I have trouble with solving b.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;could you help me with this please?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 18:57:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-accumulate-totals/m-p/500895#M133459</guid>
      <dc:creator>minsung</dc:creator>
      <dc:date>2018-10-02T18:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a accumulate totals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-accumulate-totals/m-p/500900#M133463</link>
      <description>&lt;P&gt;The data step should be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ia.literacy2;
	set ia.literacy;
	tot_jaundice + jaundice;
	keep Subject jaundice tot_jaundice;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Oct 2018 19:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-accumulate-totals/m-p/500900#M133463</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-10-02T19:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a accumulate totals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-accumulate-totals/m-p/500902#M133465</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data = ia.literacy;
run;
proc sort data=ia.literacy out=sort_literacy;
   by Subject;
run;
data ia.literacy2(keep Subject id jaundice tot_jaundice);
	set ia.literacy;

by subject;
if first.subject then tot_jaundice =0;
tot_jaundice + jaundice;
if last.subject then output;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 19:08:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-accumulate-totals/m-p/500902#M133465</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-10-02T19:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a accumulate totals</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-accumulate-totals/m-p/500905#M133466</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ia.literacy2;

retain tot_jaundice 0;
	set ia.literacy;

by subject;

if first.subject then tot_jaunice = 0;
	tot_jaundice + jaundice;

if last.subject then output;
	keep Subject id jaundice tot_jaundice;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Oct 2018 19:11:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-accumulate-totals/m-p/500905#M133466</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-10-02T19:11:08Z</dc:date>
    </item>
  </channel>
</rss>

