<?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: Subsetting a data set based on proc freq output in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Subsetting-a-data-set-based-on-proc-freq-output/m-p/837361#M36149</link>
    <description>&lt;P&gt;UNTESTED CODE (because you haven't given us actual data to work with)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This assumes both data sets are sorted by ID&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    merge dataset2(in=in2) dataset1(in=in1);
    by id;
    if in2 and not in1;
    drop freq perc;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Oct 2022 11:43:54 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-10-07T11:43:54Z</dc:date>
    <item>
      <title>Subsetting a data set based on proc freq output</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Subsetting-a-data-set-based-on-proc-freq-output/m-p/837360#M36148</link>
      <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;suppose to run a proc freq with an output that looks like this:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ID &amp;nbsp; &amp;nbsp; Freq &amp;nbsp; &amp;nbsp;Perc &amp;nbsp; &amp;nbsp; ..&lt;/P&gt;
&lt;P&gt;0001 &amp;nbsp; &amp;nbsp;..... &amp;nbsp; &amp;nbsp; &amp;nbsp;.....&lt;/P&gt;
&lt;P&gt;0002 &amp;nbsp; &amp;nbsp;..... &amp;nbsp; &amp;nbsp; &amp;nbsp;.....&lt;/P&gt;
&lt;P&gt;0008 &amp;nbsp; &amp;nbsp;..... &amp;nbsp; &amp;nbsp; &amp;nbsp;.....&lt;/P&gt;
&lt;P&gt;0005 &amp;nbsp; &amp;nbsp;..... &amp;nbsp; &amp;nbsp; &amp;nbsp;.....&lt;/P&gt;
&lt;P&gt;....... &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;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suppose also to have a data set that looks like this:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ID &amp;nbsp; &amp;nbsp; Value1 &amp;nbsp; &amp;nbsp;Value2 &amp;nbsp; &amp;nbsp;..&lt;/P&gt;
&lt;P&gt;0001 &amp;nbsp; &amp;nbsp;..... &amp;nbsp; &amp;nbsp; &amp;nbsp;.....&lt;/P&gt;
&lt;P&gt;0002 &amp;nbsp; &amp;nbsp;..... &amp;nbsp; &amp;nbsp; &amp;nbsp;.....&lt;/P&gt;
&lt;P&gt;0003 &amp;nbsp; &amp;nbsp;..... &amp;nbsp; &amp;nbsp; &amp;nbsp;.....&lt;/P&gt;
&lt;P&gt;0004 &amp;nbsp; &amp;nbsp;..... &amp;nbsp; &amp;nbsp; &amp;nbsp;.....&lt;/P&gt;
&lt;P&gt;....... &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;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to remove from the data set the IDs that appear in proc freq output?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Desired output:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID &amp;nbsp; &amp;nbsp; Value1 &amp;nbsp; &amp;nbsp;Value2 &amp;nbsp; &amp;nbsp;..&lt;/P&gt;
&lt;P&gt;0003 &amp;nbsp; &amp;nbsp;..... &amp;nbsp; &amp;nbsp; &amp;nbsp;.....&lt;/P&gt;
&lt;P&gt;0004 &amp;nbsp; &amp;nbsp;..... &amp;nbsp; &amp;nbsp; &amp;nbsp;.....&lt;/P&gt;
&lt;P&gt;....... &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;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 11:40:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Subsetting-a-data-set-based-on-proc-freq-output/m-p/837360#M36148</guid>
      <dc:creator>NewUsrStat</dc:creator>
      <dc:date>2022-10-07T11:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting a data set based on proc freq output</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Subsetting-a-data-set-based-on-proc-freq-output/m-p/837361#M36149</link>
      <description>&lt;P&gt;UNTESTED CODE (because you haven't given us actual data to work with)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This assumes both data sets are sorted by ID&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    merge dataset2(in=in2) dataset1(in=in1);
    by id;
    if in2 and not in1;
    drop freq perc;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 11:43:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Subsetting-a-data-set-based-on-proc-freq-output/m-p/837361#M36149</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-10-07T11:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting a data set based on proc freq output</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Subsetting-a-data-set-based-on-proc-freq-output/m-p/837363#M36150</link>
      <description>Thank you very much!&lt;BR /&gt;It works perfectly.</description>
      <pubDate>Fri, 07 Oct 2022 12:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Subsetting-a-data-set-based-on-proc-freq-output/m-p/837363#M36150</guid>
      <dc:creator>NewUsrStat</dc:creator>
      <dc:date>2022-10-07T12:02:10Z</dc:date>
    </item>
  </channel>
</rss>

