<?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: delete obs according to percentage specified in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306376#M65498</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60507"&gt;@RTelang&lt;/a&gt; wrote:&lt;BR /&gt;@ballward my criteria is i calculate, want to delete a certain percent of obs values from the DS observations.. dont want to keep the specific number of values i.e i want to directly calculate 20% of 300 that is 40 &amp;amp; then delete 40 obs from the total 300 obs tats it....&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's like saying 2 + 3 is different from 3 + 2.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Oct 2016 17:17:09 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-10-21T17:17:09Z</dc:date>
    <item>
      <title>delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306245#M65458</link>
      <description>&lt;P&gt;Below &amp;nbsp;code is to get the percent of the obs, I hav 300 obs in test dataset i want to delete certain random oberservations according to the percent provided to my code parameter. means if the delete_freq=20 then 20% of &amp;nbsp;300 ie from the dataset 60 obs should be deleted and only 240 observations in test1 should be remaining.&lt;/P&gt;
&lt;P&gt;Am at a fix to populate a condition to delete the obs according to the delete_freq parameter any help is appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%macro delobs(delete_freq=)&lt;BR /&gt;data test;&lt;BR /&gt;set key.test1;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc sort data= test;&lt;BR /&gt;by name;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc freq data=work.test;&lt;BR /&gt;tables name / out=counts (KEEP=name count percent);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data all;&lt;BR /&gt;merge counts test;&lt;BR /&gt;by name;&lt;BR /&gt; if count &amp;lt;= &amp;amp;delete_Freq then delete variable_obs;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;%mend;&lt;BR /&gt;%delobs(delete_freq=12);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 10:37:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306245#M65458</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2016-10-21T10:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306251#M65460</link>
      <description>&lt;PRE&gt;%macro delobs(delete_freq=)
  data test;
    set key.test1;
  run;
  proc sort data= test;
    by name;
  run;
  proc freq data=work.test;
    tables name / out=counts (KEEP=name count percent);
  run;
  data all;
    merge counts test;
    by name;
    if count &amp;gt; &amp;amp;delete_Freq. then output;
  run;
%mend delobs;
%delobs(delete_freq=12);&lt;/PRE&gt;
&lt;P&gt;Reverse your logic and only output if count &amp;gt; paramter.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 11:20:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306251#M65460</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-21T11:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306263#M65464</link>
      <description>&lt;P&gt;Do you need to delete exactly 60 obs, or would it be okay to give each record a 20% chance of deletion, which could result in more or less records deleted, depending on chance?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 12:34:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306263#M65464</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2016-10-21T12:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306269#M65469</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin﻿&lt;/a&gt;&amp;nbsp;I was thinking it would be easier to select 80% of the records using SURVEYSELECT.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 12:48:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306269#M65469</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-10-21T12:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306273#M65473</link>
      <description>&lt;P&gt;The datastep in NOT RANDOM. It always get sorted by name and removes all within specified range.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look into PROC SURVEYSELECT instead.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 13:04:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306273#M65473</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-21T13:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306283#M65474</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin﻿&lt;/a&gt; i want to randomly delete obs from my data that is in terms of percentage. has mentioned above i hav 300 obs so if my parameter value is 20 so 20% of 300 is 240 so in the output dataset 240 obs should be remaining.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 13:49:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306283#M65474</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2016-10-21T13:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306304#M65478</link>
      <description>&lt;P&gt;Agree with the suggestions from others that this is what PROC SURVEYSELECT was made for.&amp;nbsp; Gone are the days when you might have created a variable with random numbers, sorted, and then selected records yourself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc surveyselect 
  data=sashelp.shoes
  method=srs
  n=240
/*  samprate=.8 */
  out=MySample
  seed=0
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can specify the count of records to select, or the sampling rate.&amp;nbsp; Of course you could wrap that in a macro, which could compute the count you want from the rate, or ...&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 14:39:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306304#M65478</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2016-10-21T14:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306309#M65480</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt; can't my code be updated to randomly delete  certain specific percent of observations from the total observations in the dataset... as i am new to surveyselect don't know its working....</description>
      <pubDate>Fri, 21 Oct 2016 14:53:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306309#M65480</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2016-10-21T14:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306333#M65485</link>
      <description>&lt;P&gt;Your example code does not even look like it was attempting to create a subset of a specific percentage size of the original data. It looks&amp;nbsp;like it was attempting to delete records whose identification variable, Name, appeared fewer than a specified number of times.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So which do you want to do: Select a random subset of a specified number of records or remove very specific identified records that appear with low frequency?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The basic approach you started with will not remove a "random" anything. As a minimum you need a random value somewhere if the goal is actually a random subset. And Surveyselect will not require passing the data through multiple data steps or procedures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 15:50:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306333#M65485</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-21T15:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306336#M65486</link>
      <description>&lt;P&gt;@ballarwd&amp;nbsp;I want to delete observations from the dataset based on the delete_freq=20 parameter i.e delete only 20% of the total observations. for example i have 200obs &amp;amp; have value 20 in delete_freq then just delete 20% of total 200 obs i.e any 40 obs will be deleted and only 160 obs will be left...&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 16:05:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306336#M65486</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2016-10-21T16:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306338#M65487</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60507"&gt;@RTelang&lt;/a&gt; wrote:&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt; can't my code be updated to randomly delete certain specific percent of observations from the total observations in the dataset... as i am new to surveyselect don't know its working....&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I suggest reading the documentation then.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 15:54:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306338#M65487</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-21T15:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306339#M65488</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60507"&gt;@RTelang&lt;/a&gt; wrote:&lt;BR /&gt;I want to delete observations from the dataset based on the delete_freq=20 parameter i.e delete only 20% of the total observations. for example i have 200obs &amp;amp; have value 20 in delete_freq then just delete 20% of total 200 obs i.e any 40 obs will be deleted and only 160 obs will be left...&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;'s reply with Surveyselect code is your best bet.&lt;/P&gt;
&lt;P&gt;The SAMPRATE option indicates what percentage of records to select (or keep). A SAMPRATE value less than one such as .8 is keep 80 percent, or if you use a value greater than one it is treated as percentage so Samprate=80 would keep 80 percent of the records.&lt;/P&gt;
&lt;P&gt;OR you can actually specifize the number of records to keep with SAMPSIZE if you prefer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you insist on using a removal percentage then have your code substract that value from 100 and place that in the SAMPRATE= option.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 15:58:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306339#M65488</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-21T15:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306356#M65490</link>
      <description>@ballward my criteria is i calculate, want to delete a certain percent of obs values from the DS observations.. dont want to keep the specific number of values i.e i want to directly calculate 20% of 300 that is 40 &amp;amp; then delete 40 obs from the total 300 obs tats it....</description>
      <pubDate>Fri, 21 Oct 2016 16:25:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306356#M65490</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2016-10-21T16:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306365#M65492</link>
      <description>&lt;P&gt;That is what surveryselect is doing.&amp;nbsp; You specify how many records&amp;nbsp;(or what proportion) to select, rather than delete.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really want to do it with data step code, this page presents surveyselect and two data step options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/24/722.html" target="_blank"&gt;http://support.sas.com/kb/24/722.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 16:55:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306365#M65492</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2016-10-21T16:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306376#M65498</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60507"&gt;@RTelang&lt;/a&gt; wrote:&lt;BR /&gt;@ballward my criteria is i calculate, want to delete a certain percent of obs values from the DS observations.. dont want to keep the specific number of values i.e i want to directly calculate 20% of 300 that is 40 &amp;amp; then delete 40 obs from the total 300 obs tats it....&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's like saying 2 + 3 is different from 3 + 2.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 17:17:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306376#M65498</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-21T17:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306436#M65516</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;Just a simple code that output depending on percentage.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; count(*) &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;Into&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;: OBSCOUNT&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; sashelp.class;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; pct=80 ; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="3"&gt;&lt;FONT color="#008000" face="Courier New" size="3"&gt;&lt;FONT color="#008000" face="Courier New" size="3"&gt;/* Percentage of observation to output */&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; test1;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; sashelp.class ;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; _N_=INT((&amp;amp;pct*&amp;amp;obscount)/&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;100&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;)+&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;stop&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 20:19:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306436#M65516</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2016-10-21T20:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306438#M65517</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83078"&gt;@SuryaKiran﻿&lt;/a&gt;&amp;nbsp;That's not a random selection - it selects the top N records.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 20:24:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306438#M65517</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-21T20:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306510#M65534</link>
      <description>&lt;P&gt;Yeah.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__﻿&lt;/a&gt;&amp;nbsp;,John King got the point.&lt;/P&gt;
&lt;P&gt;If you really want DELETE.&lt;/P&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;PRE&gt;&lt;CODE class=" language-sas"&gt;%let delete_freq=12;

proc surveyselect data=sashelp.cars group=100 out=want;
run;
data want;
 set want;
 if groupid le &amp;amp;delete_freq then delete;
 drop groupid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2016 04:04:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/306510#M65534</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-22T04:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/307323#M65799</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt; lil brief explanation of code wats it doing...?</description>
      <pubDate>Wed, 26 Oct 2016 06:54:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/307323#M65799</guid>
      <dc:creator>RTelang</dc:creator>
      <dc:date>2016-10-26T06:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: delete obs according to percentage specified</title>
      <link>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/307334#M65802</link>
      <description>&lt;P&gt;There is a thing called Base SAS - it is the programming language your are using, even if you insist on wrapping the whole system in macro code. &amp;nbsp;It is a well documented fully functional languange, and you can find all the documentation online at SAS:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#surveyselect_toc.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#surveyselect_toc.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 08:17:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/delete-obs-according-to-percentage-specified/m-p/307334#M65802</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-26T08:17:34Z</dc:date>
    </item>
  </channel>
</rss>

