Hey SAS folks, I will have to work with Telco CDR data,that is Call Data Record ; basically, one phone number associated with one phone number and details on communication (such as operator). The table is sorted according to time (as one can expect -- this is tracking). From those data, I have to extract a list of distinct phone numbers and their latests status (say phone operator). I can think of reading data, outputing per CDR two records (phone numbers) with the date and perform a PROC SORT nodedupkey on it. I was wondering wether there is a way to perform the task reading only once the source data. In particular, is there the place where hashkey could help? Sample code and what needed: DATA CDR; INPUT phone1 phone2 date:date9. phone1_status:$1. phone2_status:$1.; format date date9.; CARDS; 1 2 01JAN2007 A B 1 3 02JAN2007 A B 2 3 03JAN2007 A B 2 4 04JAN2007 C A 4 1 05JAN2007 C B RUN; * should already be sorted; proc sort data=cdr; by date; run; * ; data phones_dup(keep=phone status date); set cdr; phone=phone1; status=phone1_status; output; phone=phone2; status=phone2_status; output; run; proc sort data=phones_dup out=phones_dup; by phone date; run; data phones; set phones_dup; by phone; if last.phone; run; proc print; run; Thank you for any insight, Eric
... View more