<?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: PRXPARSE with negatives in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PRXPARSE-with-negatives/m-p/672934#M202313</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data notes;
input text;
patient is not homeless
she said that she is currently working and it no longer homeless
he is afraid that he will become homeless
at the end of the month he is going to be homeless
Patient description: Homless? No
;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 28 Jul 2020 18:02:37 GMT</pubDate>
    <dc:creator>mar0000</dc:creator>
    <dc:date>2020-07-28T18:02:37Z</dc:date>
    <item>
      <title>PRXPARSE with negatives</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PRXPARSE-with-negatives/m-p/672920#M202309</link>
      <description>&lt;P&gt;I am looking to use prxparse to find homelessness in text. I need to be able to search for phrases like "is currrently homeless," "is homeless," "Homeless: Yes," and "Living situation: Homeless." In the text, the only phrases I want to exclude are phrases like "Homless: No" and "not homeless." Using prxparse, is there a way to search for the words "no" and "homeless" being very close to each other if not directly next to each other, so that I am able to remove them?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 17:04:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PRXPARSE-with-negatives/m-p/672920#M202309</guid>
      <dc:creator>mar0000</dc:creator>
      <dc:date>2020-07-28T17:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: PRXPARSE with negatives</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PRXPARSE-with-negatives/m-p/672932#M202312</link>
      <description>Could you please provide the exact sample data with 'no' as well</description>
      <pubDate>Tue, 28 Jul 2020 17:52:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PRXPARSE-with-negatives/m-p/672932#M202312</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-07-28T17:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: PRXPARSE with negatives</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PRXPARSE-with-negatives/m-p/672934#M202313</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data notes;
input text;
patient is not homeless
she said that she is currently working and it no longer homeless
he is afraid that he will become homeless
at the end of the month he is going to be homeless
Patient description: Homless? No
;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Jul 2020 18:02:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PRXPARSE-with-negatives/m-p/672934#M202313</guid>
      <dc:creator>mar0000</dc:creator>
      <dc:date>2020-07-28T18:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: PRXPARSE with negatives</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PRXPARSE-with-negatives/m-p/672935#M202314</link>
      <description>&lt;P&gt;Is this somewhat in the direction you're hoping? The code below uses PRXMATCH to see if each string contains 'homeless' and 'no' within 10 characters of each other. You can modify the gap length, as well as the logic for when that condition is met.&lt;/P&gt;
&lt;PRE&gt;data notes;
    input text $65.;
    cards;
    patient is not homeless
    she said that she is currently working and it no longer homeless
    he is afraid that he will become homeless
    at the end of the month he is going to be homeless
    Patient description: Homless? No
    ;
run;

data want;
   set notes;
   if prxmatch('/(.*)(HOMELESS(.{1,10}?)NO)|(NO(.{1,10}?)HOMELESS)(.*)/', upcase(text))
       then contains_homeless_and_no = 'yes';
   else contains_homeless_and_no = 'no';
run;&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;Edit: use the input data&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/322090"&gt;@mar0000&lt;/a&gt;&amp;nbsp; provided. (Note, the last record has the word "Homless"... Not sure if that typo is intentional, or to be included when looking for "hom&lt;STRONG&gt;e&lt;/STRONG&gt;less".)&lt;/EM&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 18:10:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PRXPARSE-with-negatives/m-p/672935#M202314</guid>
      <dc:creator>mklangley</dc:creator>
      <dc:date>2020-07-28T18:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: PRXPARSE with negatives</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PRXPARSE-with-negatives/m-p/672938#M202316</link>
      <description>This is definitely what I'm looking for. Thank you! (p.s. Homless was a typo on my end)</description>
      <pubDate>Tue, 28 Jul 2020 18:12:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PRXPARSE-with-negatives/m-p/672938#M202316</guid>
      <dc:creator>mar0000</dc:creator>
      <dc:date>2020-07-28T18:12:32Z</dc:date>
    </item>
  </channel>
</rss>

