Do you mean that you want to create a count of observations for the two possible values of gender?
A SQL approach would be
proc sql;
create table want as
select
'Male' as gender length = 6,
count(*) as count
from have
where gender = 'Male'
union all
select
'Female' as gender,
count(*)
from have
where gender = 'Female'
;
quit;
Note that this is very much a waste of code space and performance as this will do the same:
proc freq data=have noprint;
table gender / out=want (drop=percent);
run;
See Maxim 14.
... View more