<?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 how to remove error records in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-error-records/m-p/48452#M10019</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I have quite a big table with lots of fields. Wanted to filter the records looking for a error condition. &lt;BR /&gt;
&lt;BR /&gt;
Condition is there are member id's and ssn, one member can have only one ssn and the reverse is ony one ssn must be present for one member.&lt;BR /&gt;
&lt;BR /&gt;
But the table I have contains a same SSN for multiple member id's and multiple member ssn for same same member id's.&lt;BR /&gt;
&lt;BR /&gt;
There many records for same member and couple of records are like this.&lt;BR /&gt;
&lt;BR /&gt;
I dont get to know how to filter these members.&lt;BR /&gt;
&lt;BR /&gt;
Would appreciate you guys give a solution for this.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,</description>
    <pubDate>Sat, 11 Dec 2010 18:34:22 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-12-11T18:34:22Z</dc:date>
    <item>
      <title>how to remove error records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-error-records/m-p/48452#M10019</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I have quite a big table with lots of fields. Wanted to filter the records looking for a error condition. &lt;BR /&gt;
&lt;BR /&gt;
Condition is there are member id's and ssn, one member can have only one ssn and the reverse is ony one ssn must be present for one member.&lt;BR /&gt;
&lt;BR /&gt;
But the table I have contains a same SSN for multiple member id's and multiple member ssn for same same member id's.&lt;BR /&gt;
&lt;BR /&gt;
There many records for same member and couple of records are like this.&lt;BR /&gt;
&lt;BR /&gt;
I dont get to know how to filter these members.&lt;BR /&gt;
&lt;BR /&gt;
Would appreciate you guys give a solution for this.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,</description>
      <pubDate>Sat, 11 Dec 2010 18:34:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-error-records/m-p/48452#M10019</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-12-11T18:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove error records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-error-records/m-p/48453#M10020</link>
      <description>Suggest sorting your file and then using a DATA step, investigate using BY GROUP PROCESSING (see Google search below - you will be using FIRST.&lt;VARNAME&gt; and/or LAST.&lt;VARNAME&gt; in your code) to detect and DELETE (or OUTPUT to another separate SAS file) your "exception condition" observations.  Or you may be able to use SAS PROC SORT with NODUPKEY to remove duplicates and/or again with PROC SORT use the DUPOUT= parameter to save off your duplicates (based on the BY statement variable list).&lt;BR /&gt;
&lt;BR /&gt;
First off, I would recommend you address each of the statement requirements individually as a task and then work to integrate/combine the tasks so that your final output file(s) address the data manipulation objective.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
data step by group processing site:sas.com

Message was edited by: sbb&lt;/VARNAME&gt;&lt;/VARNAME&gt;</description>
      <pubDate>Sat, 11 Dec 2010 19:17:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-error-records/m-p/48453#M10020</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-12-11T19:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove error records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-error-records/m-p/48454#M10021</link>
      <description>Hello Activa,&lt;BR /&gt;
&lt;BR /&gt;
This is a possible solution:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data i;&lt;BR /&gt;
  id=1; ssn=100; output;&lt;BR /&gt;
  id=1; ssn= 90; output;&lt;BR /&gt;
  id=1; ssn= 80; output;&lt;BR /&gt;
  id=2; ssn=200; output;&lt;BR /&gt;
  id=3; ssn=200; output;&lt;BR /&gt;
  id=4; ssn=400; output;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=i out=s;&lt;BR /&gt;
  by ID;&lt;BR /&gt;
run;&lt;BR /&gt;
data BadID;&lt;BR /&gt;
  set s;&lt;BR /&gt;
  if NOT (First.ID=1 and Last.ID=1);&lt;BR /&gt;
  by ID;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=i out=s;&lt;BR /&gt;
  by SSN;&lt;BR /&gt;
run;&lt;BR /&gt;
data BadSSN;&lt;BR /&gt;
  set s;&lt;BR /&gt;
  if NOT (First.SSN=1 and Last.SSN=1);&lt;BR /&gt;
  by SSN;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Mon, 13 Dec 2010 15:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-error-records/m-p/48454#M10021</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2010-12-13T15:45:26Z</dc:date>
    </item>
  </channel>
</rss>

