Date: Mon, 31 Dec 2007 12:26:04 -0800
Reply-To: "William W. Viergever" <william@VIERGEVER.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "William W. Viergever" <william@VIERGEVER.NET>
Subject: Re: Automatic variables, First dot & Last dot
In-Reply-To: <9D918D83182AAD4DABC9D3E2E8CD067103F822C3@fr1-mx-usr02p.med
co.com>
Content-Type: text/plain; charset="us-ascii"; format=flowed
see the DUPOUT option that goes along w/ either the NODUPKEY or
NODUPRECS options
out
At 11:48 AM 12/31/2007, Zimmerman, Bernie wrote:
>Listers:
>
>You always come through for me, so if anyone is still out there reading,
>here goes ..
>
>I have a file of approx. 50 K records with approx 40 variables, e.g.
>First, Surname, SSN, Birth_Date, etc. Furthermore, I believe the file
>contains duplicate records. If I sort the file on: Surname, First,
>Birth_Date and SSN as follows:
>
> proc sort data= work.Wxyz_nroll
> out= work.Wxyz_sweep1 /* nodupkey */ ;
> by Surname First Birth_Date SSN ; run ;
>
>I would like to send all duplicate combinations to a file for printing
>and review. Every time I try using the First. And Last. Automatic
>variables I seem to get things wrong. The data step below does not give
>me the results I expected. Does anyone see what I need to change to get
>things right?
>
> data work.sweep1 ;
> set work.Wxyz_sweep1(in= _sweep1) ;
> by Surname First Birth_Date SSN ;
>
> if FIRST.Surname AND FIRST.First
> AND FIRST.Birth_Date AND FIRST.SSN then do ;
> dupes = 00 ;
>
>end ;
> dupes+ 1 ;
> if LAST.Surname AND LAST.First
> AND LAST.Birth_Date AND LAST.SSN then do ;
> if dupes GT 1 then do ;
> output work.sweep1 ;
> end ;
> end ;
> run ;
>
> title3 "First sweep -- by variables are .. " ;
> title4 " Surname First Birth_Date & SSN " ;
> proc print data= work.sweep1 ;
> var dupes
> Eff_Date DIS_Dte Surname First MI Birth_Date SSN
> Carrier Group Member Person HICn TRC TRtext ;
> run ;
>
>
>TIA and Happy New Year !
>
>Bernie Zimmerman
>Medco
>Eligibility Operations, Triage
>(201) 269- 6201
>
>
>
>
>
>-----------------------------------------
>This e-mail message and any attachments contain confidential
>information from Medco. If you are not the intended recipient, you
>are hereby notified that disclosure, printing, copying,
>distribution, or the taking of any action in reliance on the
>contents of this electronic information is strictly prohibited. If
>you have received this e-mail message in error, please immediately
>notify the sender by reply message and then delete the electronic
>message and any attachments.
---------------------------------------------------
William W. Viergever
Viergever & Associates
Health Data Analysis / Systems Design & Development
Sacramento, CA 95825
william@viergever.net
www.viergever.net
(916) 483-8398
---------------------------------------------------
|