06-17-2016 11:12 AM
The purpose is to rank the cust_num and acct_num in the below table due to confidential reason. I am thinking about ordering them into cus_rank and acct_rank. Anyone would be able to give me some advise?
Much appreciated for the help.
input cust_num acct_num cus_rank acct_rank;
123 89 1 1
123 90 1 2
234 95 2 3
345 95 3 3
06-17-2016 02:38 PM
I'm not sure how this helps with confidentiality. You can look into PROC RANK for starters or can hard code it. Below is an example of hard coding the rules.
data want; set have_want (Drop = cus_rank acct_rank); lag_cust_num=lag(cust_num); lag_acct_num =lag(acct_num); if cust_num ne lag_cust_num then cus_rank+1; if acct_num ne lag_acct_num then acct_rank+1; drop lag_:; run;