<?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 correct entry in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/correct-entry/m-p/621956#M182914</link>
    <description>&lt;P&gt;Hi...I am trying to correct the withdrew entries for the student in the same program. The correction is based on the last record for the student in the same program and is when there are multiple records for the same student and program, the last record with a Withdrew entry is retained and all previous records are to have missing entries for Withdrew. if the Withdrew entry in the last record for the same student and program is missing then all Withdrew entries should be missing otherwise the last Withdrew entry should be retained. Not sure how to do this. Any suggestions would be greatly appreciated. Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;                                                                                                                                      
  input Student $ (start completion withdrew) (:6.) Program $30. ;                                                                                              
  datalines4;  
A  201509 201606 201603 AutoMechanics
A  201609 201706 201704 AutoMechanics
A  201809 201906 . AutoMechanics
A  201909 202006 . Carpentry
B  201509 201606    .    AutoMechanics
B  201609 201706 201703 AutoMechanics
B  201709 201806 . AutoMechanics
B  201809 201906 201905 AutoMechanics
;;;;

want:
A  201509 201606 . AutoMechanics
A  201609 201706 . AutoMechanics
A  201809 201906 . AutoMechanics
A  201909 202006 . Carpentry
B  201509 201606 . AutoMechanics
B  201609 201706 . AutoMechanics
B  201709 201806 . AutoMechanics
B  201809 201906 201905 AutoMechanics

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 03 Feb 2020 16:28:04 GMT</pubDate>
    <dc:creator>twildone</dc:creator>
    <dc:date>2020-02-03T16:28:04Z</dc:date>
    <item>
      <title>correct entry</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correct-entry/m-p/621956#M182914</link>
      <description>&lt;P&gt;Hi...I am trying to correct the withdrew entries for the student in the same program. The correction is based on the last record for the student in the same program and is when there are multiple records for the same student and program, the last record with a Withdrew entry is retained and all previous records are to have missing entries for Withdrew. if the Withdrew entry in the last record for the same student and program is missing then all Withdrew entries should be missing otherwise the last Withdrew entry should be retained. Not sure how to do this. Any suggestions would be greatly appreciated. Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;                                                                                                                                      
  input Student $ (start completion withdrew) (:6.) Program $30. ;                                                                                              
  datalines4;  
A  201509 201606 201603 AutoMechanics
A  201609 201706 201704 AutoMechanics
A  201809 201906 . AutoMechanics
A  201909 202006 . Carpentry
B  201509 201606    .    AutoMechanics
B  201609 201706 201703 AutoMechanics
B  201709 201806 . AutoMechanics
B  201809 201906 201905 AutoMechanics
;;;;

want:
A  201509 201606 . AutoMechanics
A  201609 201706 . AutoMechanics
A  201809 201906 . AutoMechanics
A  201909 202006 . Carpentry
B  201509 201606 . AutoMechanics
B  201609 201706 . AutoMechanics
B  201709 201806 . AutoMechanics
B  201809 201906 201905 AutoMechanics

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Feb 2020 16:28:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correct-entry/m-p/621956#M182914</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2020-02-03T16:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: correct entry</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correct-entry/m-p/621972#M182916</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4061"&gt;@twildone&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this code meet your expectations?&lt;/P&gt;
&lt;P&gt;I am not sure to have well understood the rule to correct the withdrew entry.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ref;
	set have;
	by Student Program;
	if last.Program then do;
		rename withdrew=withdrew_ref;
		output;
	end;
	keep Student Program withdrew;
run;

data want;
	merge have ref;
	by Student Program;
	if withdrew_ref ne . and not last.Program then withdrew= .;
	drop withdrew_ref;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Feb 2020 16:07:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correct-entry/m-p/621972#M182916</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-03T16:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: correct entry</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correct-entry/m-p/621981#M182919</link>
      <description>&lt;P&gt;Hi Ed_Sas_Member....Yes your code did what I had originally had asked for. I had made a mistake and is probably why you might have been confused...my apology. The first student should have all missing Withdrew entries because the last record had a missing Withdrew entry...I made the correction and apology again.....Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 16:33:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correct-entry/m-p/621981#M182919</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2020-02-03T16:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: correct entry</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correct-entry/m-p/621985#M182921</link>
      <description>&lt;P&gt;Hi Ed_Sas_Member....thanks for your help and suggestion. With your help and by adding the following statement I was able to get what I wanted.....Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; withdrew_ref = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;not&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; last.Program &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; withdrew ne &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; withdrew= &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 16:45:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correct-entry/m-p/621985#M182921</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2020-02-03T16:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: correct entry</title>
      <link>https://communities.sas.com/t5/SAS-Programming/correct-entry/m-p/621987#M182923</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4061" target="_blank"&gt;@twildone&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No problem&amp;nbsp;&lt;IMG class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" border="0" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 16:47:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/correct-entry/m-p/621987#M182923</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-03T16:47:00Z</dc:date>
    </item>
  </channel>
</rss>

