<?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: Cleaning address that begins with APT in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587674#M167866</link>
    <description>&lt;P&gt;You are the best! This worked for me. I wish I had half your brain..&lt;/P&gt;</description>
    <pubDate>Tue, 10 Sep 2019 20:30:15 GMT</pubDate>
    <dc:creator>IsaacYi881</dc:creator>
    <dc:date>2019-09-10T20:30:15Z</dc:date>
    <item>
      <title>Cleaning address that begins with APT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587541#M167833</link>
      <description>&lt;P&gt;I'm currently working on Geocoding addresses to census tract and I'm able to delete addresses with 'APT' followed by the number when its on the far right, however some of my data begins with APT X/APT XX/APT XXX. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;APT 6 651 DALE ST&lt;/P&gt;&lt;P&gt;APT 2618 1214 OLD LASCASSAS RD&lt;/P&gt;&lt;P&gt;APT 305 8384 RIVER FORK&amp;nbsp;&lt;/P&gt;&lt;P&gt;APT #D UNIVERSITY ST&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anyway to get ride of the APT along with whatever is followed up after?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 14:52:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587541#M167833</guid>
      <dc:creator>IsaacYi881</dc:creator>
      <dc:date>2019-09-10T14:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Cleaning address that begins with APT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587545#M167834</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if address=:'APT ' then delete;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Sep 2019 15:03:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587545#M167834</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-10T15:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cleaning address that begins with APT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587546#M167835</link>
      <description>&lt;P&gt;Also try regular expressions as below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if prxmatch('m/^APT.*/oi',address)=0;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Sep 2019 15:07:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587546#M167835</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-09-10T15:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Cleaning address that begins with APT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587610#M167846</link>
      <description>&lt;P&gt;I tried as both of you suggested however it did not work. It deletes some of my observations and it did not change the result. Here is my data and here is what I am trying to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have:&lt;/P&gt;&lt;P&gt;APT 6 651 DALE ST&lt;/P&gt;&lt;P&gt;APT 2618 1214 OLD LASCASSAS RD&lt;/P&gt;&lt;P&gt;APT 305 8384 RIVER FORK&amp;nbsp;&lt;/P&gt;&lt;P&gt;APT #D UNIVERSITY ST&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Want:&amp;nbsp;&lt;/P&gt;&lt;P&gt;651 DALE ST&lt;/P&gt;&lt;P&gt;1214 OLD LASCASSAS RD&lt;/P&gt;&lt;P&gt;8384 RIVER FORK&amp;nbsp;&lt;/P&gt;&lt;P&gt;UNIVERSITY ST&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code for eliminating addresses that have APT and number at the end:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data out.noapt1;&lt;BR /&gt;set out.zip;&lt;BR /&gt;new_address =upcase(streetc);&lt;BR /&gt;pos = indexw(new_address, 'APT');&lt;BR /&gt;if pos &amp;gt; 0 then new_address = substr(new_address,1, pos-2);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 17:35:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587610#M167846</guid>
      <dc:creator>IsaacYi881</dc:creator>
      <dc:date>2019-09-10T17:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Cleaning address that begins with APT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587613#M167849</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286624"&gt;@IsaacYi881&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I tried as both of you suggested however it did not work. It deletes some of my observations and it did not change the result. Here is my data and here is what I am trying to do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have:&lt;/P&gt;
&lt;P&gt;APT 6 651 DALE ST&lt;/P&gt;
&lt;P&gt;APT 2618 1214 OLD LASCASSAS RD&lt;/P&gt;
&lt;P&gt;APT 305 8384 RIVER FORK&amp;nbsp;&lt;/P&gt;
&lt;P&gt;APT #D UNIVERSITY ST&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Want:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;651 DALE ST&lt;/P&gt;
&lt;P&gt;1214 OLD LASCASSAS RD&lt;/P&gt;
&lt;P&gt;8384 RIVER FORK&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UNIVERSITY ST&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my code for eliminating addresses that have APT and number at the end:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data out.noapt1;&lt;BR /&gt;set out.zip;&lt;BR /&gt;new_address =upcase(streetc);&lt;BR /&gt;pos = indexw(new_address, 'APT');&lt;BR /&gt;if pos &amp;gt; 0 then new_address = substr(new_address,1, pos-2);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;address=tranwrd(address,'APT ','');
nextword=scan(address,1);
address=substr(address,length(nextword)+1);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Sep 2019 17:46:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587613#M167849</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-10T17:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: Cleaning address that begins with APT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587618#M167850</link>
      <description>&lt;P&gt;So getting closer, the code cuts off parts of the address. So when I run that code I'm getting&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Address:&lt;/P&gt;&lt;P&gt;6 651 DATE DT&lt;/P&gt;&lt;P&gt;8 1214 OLD LASCASSAS RD&lt;/P&gt;&lt;P&gt;5 8384 RIVER FORK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;nextword:&lt;/P&gt;&lt;P&gt;6&lt;/P&gt;&lt;P&gt;2618&lt;/P&gt;&lt;P&gt;305&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 18:02:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587618#M167850</guid>
      <dc:creator>IsaacYi881</dc:creator>
      <dc:date>2019-09-10T18:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cleaning address that begins with APT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587619#M167851</link>
      <description>&lt;P&gt;could you please try the below tested code &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
input address&amp;amp;$100.;
if address=prxchange('s/^(APT)(.*)/$2/i',-1,address);
cards;
APT 6 651 DALE ST
APT 2618 1214 OLD LASCASSAS RD
APT 305 8384 RIVER FORK 
APT #D UNIVERSITY ST
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Sep 2019 18:14:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587619#M167851</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-09-10T18:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Cleaning address that begins with APT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587620#M167852</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	address=left(tranwrd(address,'APT ','')); 
	nextword=scan(address,1);
	address=substr(address,length(nextword)+2);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Sep 2019 18:13:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587620#M167852</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-09-10T18:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cleaning address that begins with APT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587621#M167853</link>
      <description>&lt;P&gt;I tried this code and this is the log I get:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;970 data practice2;&lt;BR /&gt;971 set out.noapt1;&lt;BR /&gt;972 new_address=prxchange('s/^(APT)(.*)/$2/i',new_address);&lt;BR /&gt;---------&lt;BR /&gt;71&lt;BR /&gt;ERROR 71-185: The PRXCHANGE function call does not have enough arguments.&lt;/P&gt;&lt;P&gt;973 run;&lt;/P&gt;&lt;P&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).&lt;BR /&gt;972:43&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.PRACTICE2 may be incomplete. When this step was stopped there were 0 observations and 27 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.08 seconds&lt;BR /&gt;cpu time 0.07 seconds&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 18:14:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587621#M167853</guid>
      <dc:creator>IsaacYi881</dc:creator>
      <dc:date>2019-09-10T18:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Cleaning address that begins with APT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587624#M167855</link>
      <description>&lt;P&gt;Sorry my mistake, i posted the following code earlier, this is tested&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
input address&amp;amp;$100.;
if address=prxchange('s/^(APT)(.*)/$2/i',-1,address);
cards;
APT 6 651 DALE ST
APT 2618 1214 OLD LASCASSAS RD
APT 305 8384 RIVER FORK 
APT #D UNIVERSITY ST
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 18:22:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587624#M167855</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-09-10T18:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Cleaning address that begins with APT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587664#M167862</link>
      <description>&lt;P&gt;This code keeps deleting my observation. I even copied and pasted exactly what you posted and in the log I get:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1098 data want;&lt;BR /&gt;1099 input address&amp;amp;$100.;&lt;BR /&gt;1100 if address=prxchange('s/^(APT)(.*)/$2/i',-1,address);&lt;BR /&gt;1101 cards;&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.WANT has 0 observations and 1 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1106 ;&lt;BR /&gt;1107 run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it matters I have SAS 9.4&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 20:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587664#M167862</guid>
      <dc:creator>IsaacYi881</dc:creator>
      <dc:date>2019-09-10T20:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Cleaning address that begins with APT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587674#M167866</link>
      <description>&lt;P&gt;You are the best! This worked for me. I wish I had half your brain..&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 20:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Cleaning-address-that-begins-with-APT/m-p/587674#M167866</guid>
      <dc:creator>IsaacYi881</dc:creator>
      <dc:date>2019-09-10T20:30:15Z</dc:date>
    </item>
  </channel>
</rss>

