Hi All, I'd like to ask if you can help about this. Thanks a lot!!! data new; input ID store_number visit_date yymmdd10.; format visit_date yymmdd10.; datalines; 1 21 20050615 1 21 20050708 1 21 20051023 1 28 20041203 2 10 20060123 2 60 20050709 2 19 20060825 3 25 20041010 3 91 20051201 3 64 20040609 4 13 20050606 5 26 20040809 5 26 20030911 ; run; I’d like to get a new dataset to show that if a consumer has regular store to visit. That is, if he/she visited the same store(store number only between 10-29)more than 50% of his/her total store visits within 2 years of period, then he/she had regular store to visit. (But no including the person who only had one store to visit during the period, such as consumer #4). The new dataset should be like the following table. Id Regular_store_to_visit (yes=1, no=0) 1 1 2 0 3 0 4 . 5 1
... View more