In the following example that produces a frequency based on a variable
proc iml;
call randseed(1);
Y = sample(2014:2020, 3000);
M = sample(1:12, 3000);
D = sample(1:31, 3000);
create Date var {Y M D};
append;
run;
data Date;
set Date;
format M z2. D z2.;
Year=put(Y, z4. -L);
Month=put(M, z2. -L);
Day=put(D, z2. -L);
drop Y M D;
run;
data Date;
set Date;
Date = catx('-', Year, Month, Day);
drop Year Month Day;
run;
proc sort data=Date; by Date; run;
proc sql;
create table Count as
select Date, count(*) as Frequency from Date
group by Date;
run;
is there a corresponding functionality in proc IML that does the same thing as the last proc sql part?