Hi, I need to select the first day of each month for multiple years. I have daily admissions for 10 years. I need this collapsed into one row for the first date of each month over the ten years. Ultimately, I need only 120 rows rather than 3650 rows. I have summed daily admissions (to hospital) for each month of each year. This gives me one column with the total admissions by month/year, but a row for each day of that month. When I try proc sort with no dupkey by month(date) it fails at the nodupkey step. /*Step 1 - works fine*/ proc sql; create table WANT_1 as select *, case when eventid>0 then count(eventid) else . end as monthly_admissions from HAVE group by month(evstdate); run; /*Step 2 - does not work fine*/ proc sort data=WANT_1 out=WANT_2 nodupkey ; by month(admission_date); run; At step 2, I get this error message beneath "by month(admission_date)" : ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, :, DECENDING, DESCENDING, DESENDING, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_. 33 proc sort data=count_month out=count_month_a nodupkey ; by month(admission_date); run; _ 200 ERROR 200-322: The symbol is not recognized and will be ignored. Can anybody help with this? Many, many thanks!
... View more