From: William Shakespeare on 22 Dec 2009 14:46 I have data that are sorted by customer number and transaction date. I want to flag the first and last transaction for each customer: proc sort data=sasdata.have; by id date; run; data sasdata.want; set sasdata.have; by id; if first.date then first_flag=1;else first_flag=0; if last.date then last_flag=1;else last_flag=0; run; SAS successfully executes the sort and then runs the data step with this note: NOTE: Variable first.date is uninitialized. NOTE: Variable last.date is uninitialized. These variables exist. What am I doing wrong?
|
Pages: 1 Prev: proc power question for McNemar test Next: Getting data from Excel - Sheets |