<?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 records with &amp;quot;OCT&amp;quot; in them in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Delete-records-with-quot-OCT-quot-in-them/m-p/695571#M212268</link>
    <description>&lt;P&gt;You need to show us what type of variable that is. It may be a datetime variable, numeric with a format assigned like datetime21.2. In which case "OCT" is not part of the value. Run Proc Contents on your data set to confirm variable type and any associated format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that is the case then the code would be something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If month(datepart(time))= 10 then delete.&lt;/P&gt;</description>
    <pubDate>Fri, 30 Oct 2020 18:11:25 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-10-30T18:11:25Z</dc:date>
    <item>
      <title>Delete records with "OCT" in them</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-records-with-quot-OCT-quot-in-them/m-p/695565#M212264</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have variable "time", example: 30OCT2019:23:46:26.83 I want to delete all the "time" when it has "OCT" in the value. I wrote:&amp;nbsp;IF ((scan(time,2,'2019')) = 'OCT' THEN Delete; but it didnt work, any ideas on how to do it? Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 18:02:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-records-with-quot-OCT-quot-in-them/m-p/695565#M212264</guid>
      <dc:creator>yichentian226</dc:creator>
      <dc:date>2020-10-30T18:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Delete records with "OCT" in them</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-records-with-quot-OCT-quot-in-them/m-p/695569#M212267</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*if DT is Character*/
data have;
 dt='30OCT2019:23:46:26.83';
 output;
 dt='30NOV2019:23:46:26.83';
 output;
run;

data want;
 set have;
 where month(input(dt,date9.)) ne 10;
run;

/*if DT is numeric*/
data have;
 dt='30OCT2019:23:46:26.83'dt;
 output;
 dt='30NOV2019:23:46:26.83'dt;
 output;
 format dt datetime20.;
run;

data want;
 set have;
 where month(datepart(dt)) ne 10;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/318223"&gt;@yichentian226&lt;/a&gt;&amp;nbsp; Basically, you need to be aware whether your variable is numeric or character. Since you want to exclude OCT values,those are 10th month of the year. You can use an informat in case your variable is char to get the appropriate numeric SAS date and filter. In case your datetime values are numeric, you extract the datepart and then filter with the same condition --&amp;gt;not equal to 10th month&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 18:13:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-records-with-quot-OCT-quot-in-them/m-p/695569#M212267</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-10-30T18:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: Delete records with "OCT" in them</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-records-with-quot-OCT-quot-in-them/m-p/695571#M212268</link>
      <description>&lt;P&gt;You need to show us what type of variable that is. It may be a datetime variable, numeric with a format assigned like datetime21.2. In which case "OCT" is not part of the value. Run Proc Contents on your data set to confirm variable type and any associated format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that is the case then the code would be something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If month(datepart(time))= 10 then delete.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 18:11:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-records-with-quot-OCT-quot-in-them/m-p/695571#M212268</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-10-30T18:11:25Z</dc:date>
    </item>
  </channel>
</rss>

