Help using Base SAS procedures

Please help with SAS code

Reply
N/A
Posts: 0

Please help with SAS code

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
SAS Super FREQ
Posts: 8,864

Re: Please help with SAS code

Posted in reply to deleted_user
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]
Ask a Question
Discussion stats
  • 1 reply
  • 100 views
  • 0 likes
  • 2 in conversation