<?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 select the data without the first three letters in alphabet and next three letters is static? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-the-data-without-the-first-three-letters-in/m-p/801775#M315569</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to select the data from the table which has a ContractNo column.&lt;/P&gt;&lt;P&gt;In this column, values are consist of numbers and alphabets.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The length of each row is not the same, but it has 11 to 13 letters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Condition for subtraction is&amp;nbsp;&lt;/P&gt;&lt;P&gt;ContractNo without the first three letters are Alphabet characters and the next three letters are not 098.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this kind of data must not be selected.&lt;/P&gt;&lt;P&gt;ABC098LIOPU&amp;nbsp;&lt;/P&gt;&lt;P&gt;EFD0981234511&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data below must be selected.&lt;/P&gt;&lt;P&gt;1A20982345&amp;nbsp;&lt;/P&gt;&lt;P&gt;1230986754&lt;/P&gt;&lt;P&gt;ADBDEF0981&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I could get any help, I will appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 12 Mar 2022 04:11:23 GMT</pubDate>
    <dc:creator>seohyeonjeong</dc:creator>
    <dc:date>2022-03-12T04:11:23Z</dc:date>
    <item>
      <title>How to select the data without the first three letters in alphabet and next three letters is static?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-the-data-without-the-first-three-letters-in/m-p/801775#M315569</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to select the data from the table which has a ContractNo column.&lt;/P&gt;&lt;P&gt;In this column, values are consist of numbers and alphabets.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The length of each row is not the same, but it has 11 to 13 letters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Condition for subtraction is&amp;nbsp;&lt;/P&gt;&lt;P&gt;ContractNo without the first three letters are Alphabet characters and the next three letters are not 098.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this kind of data must not be selected.&lt;/P&gt;&lt;P&gt;ABC098LIOPU&amp;nbsp;&lt;/P&gt;&lt;P&gt;EFD0981234511&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data below must be selected.&lt;/P&gt;&lt;P&gt;1A20982345&amp;nbsp;&lt;/P&gt;&lt;P&gt;1230986754&lt;/P&gt;&lt;P&gt;ADBDEF0981&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I could get any help, I will appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2022 04:11:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-the-data-without-the-first-three-letters-in/m-p/801775#M315569</guid>
      <dc:creator>seohyeonjeong</dc:creator>
      <dc:date>2022-03-12T04:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to select the data without the first three letters in alphabet and next three letters is sta</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-the-data-without-the-first-three-letters-in/m-p/802042#M315698</link>
      <description>&lt;P&gt;Have you thought of using the COMPRESS() function with the third parameter 'KA' (keep alphabet characters)? This line of code in a DATA step might work:&lt;BR /&gt;&lt;BR /&gt;if length(compress(substr(var, 1, 3), , 'ka')) = 3 and substr(var, 4, 3) = '098' then delete;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 19:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-the-data-without-the-first-three-letters-in/m-p/802042#M315698</guid>
      <dc:creator>svh</dc:creator>
      <dc:date>2022-03-14T19:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to select the data without the first three letters in alphabet and next three letters is sta</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-the-data-without-the-first-three-letters-in/m-p/802046#M315702</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if notalpha(contractno)=4 and substr(contractno,4,3)='098' then delete;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Mar 2022 19:45:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-the-data-without-the-first-three-letters-in/m-p/802046#M315702</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-03-14T19:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to select the data without the first three letters in alphabet and next three letters is sta</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-the-data-without-the-first-three-letters-in/m-p/802058#M315708</link>
      <description>&lt;P&gt;Or here an approach using a regular expression.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  infile datalines truncover;
  input contractNo $13.;
  datalines;
ABC098LIOPU 
EFD0981234511
1A20982345 
1230986754
ADBDEF0981
;

data want;
  set have;
  if prxmatch('/^[a-z]{3}098/oi',strip(contractNo)) then delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1647290353149.png" style="width: 151px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69455iAA96EEB3B4EEE7F8/image-dimensions/151x159?v=v2" width="151" height="159" role="button" title="Patrick_0-1647290353149.png" alt="Patrick_0-1647290353149.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 20:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-the-data-without-the-first-three-letters-in/m-p/802058#M315708</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-03-14T20:39:47Z</dc:date>
    </item>
  </channel>
</rss>

