BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have the following code, I am a beginner SAS programmer;

I am trying to find the maximum number of frequency in category DIA_1 I think that I should sort by Patient ID first then find DIA_1 is that correct. How could I program: This is what I came up with but its wrong. Thanks.

proc sort data = report.FY08_datanodup;
by PAT_ID descending DIA_1;
run;
proc freq data = report.FY08_datanodup;
by DIA_1;
run; Message was edited by: RHUB
1 REPLY 1
Cynthia_sas
Diamond | Level 26
Hi:
Proc FREQ needs a TABLES statement so it knows which variables you want to get information about. Read the documentation on Proc FREQ
http://support.sas.com/documentation/cdl/en/statug/59654/HTML/default/freq_toc.htm
http://support.sas.com/documentation/cdl/en/statug/59654/HTML/default/statug_freq_sect010.htm
http://support.sas.com/documentation/cdl/en/statug/59654/HTML/default/statug_freq_sect023.htm

and experiment with these 2 programs that use SASHELP.SHOES. That approach might help you come up with syntax that works for your desired report.

cynthia
[pre]
ods listing;
proc freq data=sashelp.shoes;
title 'Table on Product Only';
by region;
tables product;
run;

proc freq data=sashelp.shoes nlevels;
title ' With NLEVELS option and no BY';
tables region product;
run;
[/pre]

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 837 views
  • 0 likes
  • 2 in conversation