I have the following dataset. I would like to extract first and last date per city and doing a count by city as well Have: City dates New York 1/5/2019 Boston 4/20/2019 Washington DC 8/20/2019 Washington DC 9/1/2019 Washington DC 10/19/2019 Washington DC 12/13/2019 Hartford 5/5/2019 Pittsburgh 6/4/2019 Philadelphia 4/6/2019 Philadelphia 6/14/2019 Philadelphia 9/8/2019 Want City Count firstDate LastDate New York 1 1/5/2019 1/5/2019 Boston 1 4/20/2019 4/20/2019 Washington DC 4 8/20/2019 12/13/2019 Hartford 1 5/5/2019 5/5/2019 Pittsburgh 1 6/4/2019 6/4/2019 Philadelphia 3 4/6/2019 9/8/2019 Possibly also percent per city? like NY will have 1/11, Boston 1/11 (9.1%), etc Here is waht i have done so far proc sql; select distinct city, count(*) as total_count, min(dates) as firstDate, max(dates) as lastDate from table group by city;quit; However when I run it, all the dates are converted into NUMBERS, not dates. How do I add n/total % ? THanks!!
... View more