Hi,
I would like to know the equivalent of proc sql count distinct operation.
I want to count the number of contrats and the number of people in a dataset but for my purpose i want to do it in a proc report (if possible).
So i have id_contrat and id_person that are non numeric variables and i only managed to calculate the number of contrats corresponding to the number of observations. I don't want to display each id_contrat nor id_person.
I did this so far :
proc report data = a ;
columns ('Perimeter' var_to_group_by n) ;
define var_to_group_by / group ;
define n / 'nb_contracts' ;
run ;
Thanks
Like this?
See REPORT Procedure
data have ;
do group=1 to 3 ;
do members=1 to int(ranuni(0)*10) ;
output ;
end ;
end ;
run ;
proc report data=have ;
column group members ;
define group/group ;
define members/analysis n ;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.