<?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: first. and last. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185641#M35217</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a ton!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can we do this in data step with first. and last.? Because I'm interested to get the solution via &lt;SPAN style="font-size: 13.3333330154419px;"&gt;first. and last.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 28 Feb 2015 13:43:30 GMT</pubDate>
    <dc:creator>Babloo</dc:creator>
    <dc:date>2015-02-28T13:43:30Z</dc:date>
    <item>
      <title>first. and last.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185632#M35208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a raw data file with some 3K records. I need to find out &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;customers with different names and same address.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this code, but got note as follows. &lt;/P&gt;&lt;TABLE width="550px"&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data rawdata2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set rawdata1;&amp;nbsp; /*(my .csv which has name, address and zip)*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.name and last.Address and last.zip_code;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: Variable 'first.name'n is uninitialized.&lt;/P&gt;&lt;P&gt;NOTE: Variable 'last.Address'n is uninitialized.&lt;/P&gt;&lt;P&gt;NOTE: Variable 'last.zip_code'n is uninitialized.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can someone suggest me to accomplish this task?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 09:51:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185632#M35208</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-02-27T09:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: first. and last.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185633#M35209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your missing a:&lt;/P&gt;&lt;P&gt;by name address zip_code;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I would suggest you do:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table WANT as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; distinct *&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HAVE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by&amp;nbsp; *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; having&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(*) gt 1;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note, not tested the above as no data, but something along those lines, if you only want those that appear more than once.&amp;nbsp; If you just want a nice list, then either distinct or proc sort with nodupkey will do the trick.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 10:00:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185633#M35209</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-02-27T10:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: first. and last.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185634#M35210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Read up on this:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/a001283274.htm" title="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/a001283274.htm"&gt;SAS 9.2 Language Reference: Concepts, Second Edition: BY-Group Processing in the DATA Step&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You are missing the basic concepts for this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 10:05:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185634#M35210</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-02-27T10:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: first. and last.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185635#M35211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ran your code and the log as follows. Am I doing something wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;108&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc sql;&lt;/P&gt;&lt;P&gt;109&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table rawdata3 as&lt;/P&gt;&lt;P&gt;110&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; distinct *&lt;/P&gt;&lt;P&gt;111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rawdata1&lt;/P&gt;&lt;P&gt;112&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by&amp;nbsp; Address,zip_code&lt;/P&gt;&lt;P&gt;113&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; having&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(*) gt 1;&lt;/P&gt;&lt;P&gt;NOTE: The query requires remerging summary statistics back with the original data.&lt;/P&gt;&lt;P&gt;NOTE: Table WORK.RAWDATA3 created, with 0 rows and 13 columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;114&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 10:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185635#M35211</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-02-27T10:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: first. and last.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185636#M35212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure about your data, the below code does work.&amp;nbsp; Try moving the count() up after distinct *, and see what count its returning, maybe your group by only ever means there is one of each:&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; name="AA"; address="ERTY"; zip_code="TYRY"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; name="AA"; address="ERTY"; zip_code="DFGH"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; name="BB"; address="WESR"; zip_code="TLKJH"; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table WANT as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select&amp;nbsp; distinct *&lt;/P&gt;&lt;P&gt;&amp;nbsp; from&amp;nbsp;&amp;nbsp; HAVE&lt;/P&gt;&lt;P&gt;&amp;nbsp; group by NAME,ADDRESS&lt;/P&gt;&lt;P&gt;&amp;nbsp; having count(*) gt 1;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 10:35:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185636#M35212</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-02-27T10:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: first. and last.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185637#M35213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I move the count(*) like below, then what aggregate function I should use in having clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc sql;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table rawdata3 as&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; distinct &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;count(*) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rawdata1&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by&amp;nbsp; Address,zip_code&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; having&amp;nbsp; //*&amp;lt;insert aggregate function&amp;gt;*/&amp;nbsp;&amp;nbsp; gt 1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 10:41:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185637#M35213</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-02-27T10:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: first. and last.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185638#M35214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I meant like this:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table WANT as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select&amp;nbsp; distinct *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(*) as CNT&lt;/P&gt;&lt;P&gt;&amp;nbsp; from&amp;nbsp;&amp;nbsp; HAVE&lt;/P&gt;&lt;P&gt;&amp;nbsp; group by NAME,ADDRESS;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the resultant table you can see the distinct values and what they have counted to.&amp;nbsp; I suspect your grouping is returning a count of 1 for each of them.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 10:44:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185638#M35214</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-02-27T10:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: first. and last.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185639#M35215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My data is likethis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name address zip&lt;/P&gt;&lt;P&gt;Ravi&amp;nbsp; abc 123&lt;/P&gt;&lt;P&gt;Raj&amp;nbsp;&amp;nbsp;&amp;nbsp; abc&amp;nbsp; 123&lt;/P&gt;&lt;P&gt;Hari&amp;nbsp;&amp;nbsp; def&amp;nbsp;&amp;nbsp; 456&lt;/P&gt;&lt;P&gt;Hari&amp;nbsp;&amp;nbsp; def&amp;nbsp;&amp;nbsp; 456&lt;/P&gt;&lt;P&gt;Kiran&amp;nbsp; ghi&amp;nbsp;&amp;nbsp; 789&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need output like,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;name address zip&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Ravi&amp;nbsp; abc 123&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Raj&amp;nbsp;&amp;nbsp;&amp;nbsp; abc&amp;nbsp; 123&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I need the output with same address and same zip with different names. All the variables are in character.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 14:55:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185639#M35215</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-02-27T14:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: first. and last.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185640#M35216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, slightly moved things around, this should work:&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile datalines;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input name $ address $ zip;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;Ravi&amp;nbsp; abc 123&lt;/P&gt;&lt;P&gt;Raj&amp;nbsp;&amp;nbsp;&amp;nbsp; abc&amp;nbsp; 123&lt;/P&gt;&lt;P&gt;Hari&amp;nbsp;&amp;nbsp; def&amp;nbsp;&amp;nbsp; 456&lt;/P&gt;&lt;P&gt;Hari&amp;nbsp;&amp;nbsp; def&amp;nbsp;&amp;nbsp; 456&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table WANT as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select&amp;nbsp; *&lt;/P&gt;&lt;P&gt;&amp;nbsp; from&amp;nbsp;&amp;nbsp; (select distinct NAME,ADDRESS,ZIP from HAVE)&lt;/P&gt;&lt;P&gt;&amp;nbsp; group by ADDRESS,ZIP&lt;/P&gt;&lt;P&gt;&amp;nbsp; having count(NAME) &amp;gt; 1;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 15:33:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185640#M35216</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-02-27T15:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: first. and last.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185641#M35217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a ton!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can we do this in data step with first. and last.? Because I'm interested to get the solution via &lt;SPAN style="font-size: 13.3333330154419px;"&gt;first. and last.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 13:43:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185641#M35217</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-02-28T13:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: first. and last.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185642#M35218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To use BY processing you need to:&lt;/P&gt;&lt;P&gt;SORT the data BY the variables of interest.&lt;/P&gt;&lt;P&gt;SET the data BY the variables of interest.&lt;/P&gt;&lt;P&gt;Then you can reference the FIRST. and LAST. flags.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's assume that you want records with more than one value of NAME for the same values of ADDRESS and ZIP.&lt;/P&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by zip address name ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if NOT (first.address and last.address);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 16:15:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185642#M35218</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-02-28T16:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: first. and last.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185643#M35219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom's approach will almost get you what you want, but not quite. However, it will work if you use the proc sort do get rid of the exact matches. e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input name $ address $ zip;&lt;/P&gt;&lt;P&gt;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;Ravi&amp;nbsp; abc 123&lt;/P&gt;&lt;P&gt;Raj&amp;nbsp;&amp;nbsp;&amp;nbsp; abc&amp;nbsp; 123&lt;/P&gt;&lt;P&gt;Hari&amp;nbsp;&amp;nbsp; def&amp;nbsp;&amp;nbsp; 456&lt;/P&gt;&lt;P&gt;Hari&amp;nbsp;&amp;nbsp; def&amp;nbsp;&amp;nbsp; 456&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=have out=want nodupkey;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by address zip name;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by address zip;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if not (first.zip and last.zip);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 16:45:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185643#M35219</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-02-28T16:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: first. and last.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185644#M35220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc sort data=have out=want;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by address;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data want;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set want;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if first.address=last.address then delete;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;you can also write a proc sort with nodupkey with name in the by statement if you have same name and same address.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Mar 2015 02:39:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185644#M35220</guid>
      <dc:creator>BharathBandi</dc:creator>
      <dc:date>2015-03-05T02:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: first. and last.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185645#M35221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is another variation..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=rawdata1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; by zip_code address name;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data differentNames_SameAddress;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set rawdata1;&amp;nbsp; /*(my .csv which has name, address and zip)*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by zip_code address name;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* select records with more than one address */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not (fist.address and and last.address) then do; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output differentNames_SameAddress;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2015 18:35:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-and-last/m-p/185645#M35221</guid>
      <dc:creator>RyanHoward</dc:creator>
      <dc:date>2015-03-06T18:35:50Z</dc:date>
    </item>
  </channel>
</rss>

