<?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 the entire records of each id if it has values as either missing or zero in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-entire-records-of-each-id-if-it-has-values-as/m-p/445107#M111500</link>
    <description>&lt;P&gt;how to remove the entire records of each id if it has values as either missing or zero.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i.e if i have id and have 5 values to it and next id 4 values and one of them is missing or zero than i want to ommit the entire id.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help&lt;/P&gt;</description>
    <pubDate>Tue, 13 Mar 2018 11:21:45 GMT</pubDate>
    <dc:creator>vraj1</dc:creator>
    <dc:date>2018-03-13T11:21:45Z</dc:date>
    <item>
      <title>how to remove the entire records of each id if it has values as either missing or zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-entire-records-of-each-id-if-it-has-values-as/m-p/445107#M111500</link>
      <description>&lt;P&gt;how to remove the entire records of each id if it has values as either missing or zero.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i.e if i have id and have 5 values to it and next id 4 values and one of them is missing or zero than i want to ommit the entire id.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 11:21:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-entire-records-of-each-id-if-it-has-values-as/m-p/445107#M111500</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2018-03-13T11:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove the entire records of each id if it has values as either missing or zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-entire-records-of-each-id-if-it-has-values-as/m-p/445108#M111501</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;data ds;&lt;BR /&gt;infile datalines;&lt;BR /&gt;input id val;&lt;BR /&gt;datalines;&lt;BR /&gt;1 1&lt;BR /&gt;2 0&lt;BR /&gt;3 5&lt;BR /&gt;4 0&lt;BR /&gt;5 2&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data ds1;&lt;BR /&gt;set ds;&lt;BR /&gt;array dat[*] _all_;&lt;BR /&gt;do i=1 to dim(dat);&lt;BR /&gt;if dat(i)=0 then delete;&lt;BR /&gt;end;&lt;BR /&gt;output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 11:32:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-entire-records-of-each-id-if-it-has-values-as/m-p/445108#M111501</guid>
      <dc:creator>srinath3111</dc:creator>
      <dc:date>2018-03-13T11:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove the entire records of each id if it has values as either missing or zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-entire-records-of-each-id-if-it-has-values-as/m-p/445109#M111502</link>
      <description>&lt;P&gt;It would help if you provided test data in the form of a datastep, and what the output should look like.&amp;nbsp; Just a guess:&lt;/P&gt;
&lt;PRE&gt;data have (drop=flag);
  set have;
  array n{*} _numeric_;
  array c{*} _character_;
  do over n;
    if n in (.,0) then flag=1;
  end;
  do over c;
    if c="" then flag=1;
  end;
  if flag ne 1;
run;&lt;/PRE&gt;
&lt;P&gt;Not tested as nothing provided.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 11:34:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-entire-records-of-each-id-if-it-has-values-as/m-p/445109#M111502</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-03-13T11:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove the entire records of each id if it has values as either missing or zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-entire-records-of-each-id-if-it-has-values-as/m-p/445110#M111503</link>
      <description>&lt;P&gt;Assuming that you mean that you have data like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input id value;
Cards;
1 3
1 4
1 3
2 0
2 3
3 .
3 5
3 6
4 1
;run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And you want to get rid of all the ID=2 records, because there is one with&amp;nbsp;VALUE=0, and all the&amp;nbsp;ID=3 records because there is one with a missing VALUE.&lt;/P&gt;&lt;P&gt;Then this should do the trick, provided your data is sorted by ID:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  merge have(where=(not value) in=null) have;
  by id;
  if not null;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 11:35:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-entire-records-of-each-id-if-it-has-values-as/m-p/445110#M111503</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2018-03-13T11:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove the entire records of each id if it has values as either missing or zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-entire-records-of-each-id-if-it-has-values-as/m-p/445111#M111504</link>
      <description>&lt;PRE&gt;data ds;
infile datalines;
input id val;
datalines;
1 1
1 0
2 0
2 1
2 2
2 0
3 5
4 0
5 2
;
run;&lt;/PRE&gt;
&lt;P&gt;In this case id 2 should not come as it has one value&amp;nbsp; val as 0. I dont want any id if has either 0 or missing and want the rest of the id and val&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 11:36:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-entire-records-of-each-id-if-it-has-values-as/m-p/445111#M111504</guid>
      <dc:creator>vraj1</dc:creator>
      <dc:date>2018-03-13T11:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove the entire records of each id if it has values as either missing or zero</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-entire-records-of-each-id-if-it-has-values-as/m-p/445114#M111505</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then try,&lt;/P&gt;&lt;P&gt;data ds2;&lt;BR /&gt;merge ds(where=(not val) in=null) ds;&lt;BR /&gt;by id;&lt;BR /&gt;if not null;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 11:41:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-remove-the-entire-records-of-each-id-if-it-has-values-as/m-p/445114#M111505</guid>
      <dc:creator>srinath3111</dc:creator>
      <dc:date>2018-03-13T11:41:44Z</dc:date>
    </item>
  </channel>
</rss>

