For a time series analysis, it is counterproductive to define an arbitrary "week" scale that runs 1 through N. Instead, use the week beginning date to define your time periods. With your data, you could approach the problem in this way:
data admits;
set have;
where diagnosis = 'VIRUS_A';
week_begin = intnx('week', admission, 0);
run;
proc freq data=admits;
tables week_begin / out=admissions (keep=week_begin count rename=(count=n_admissions));
run;
This gives you a variable named N_ADMISSIONS with the number of admissions for the week. Steps to be taken at a later point:
running the same process for all your variables, to generate a time series data set
filling in weeks that don't appear in your data with a zero for your n_admissions variable
Also note, SAS weeks run from Sunday through Saturday,. You might want to change this, if you decide that your study doesn't really begin on a Sunday. In that case, a parameter to the INTNX function can be set to determine which day of the week you would like your week definitions to begin. But all of this should be considered now, before the programming takes place.
... View more