简单点就用proc sql
[code:1f5b4]proc sql noprint;
create table freq as
select '028' as class, count(*) as num
from data028
where age>25;
quit;[/code:1f5b4]
想写的灵活点,用proc freq + format + macro的形式
I will type my reply in English. Sorry, my Chinese input skill is too bad.
For your conditional sum problem ( I assume you know how to parse acsii file into SAS dataset)
===========
name age sex
zhang 34 na
lisan 20 nv
lishi 19 nv
zhangd 28 na
===========
If use pure BASE datastep code:
data largerthan25;
(readin your data here);
class='028';
run;
data test;
set test end=eof;
retain numbercount;
if age>25 then numbercount+1;
if eof the then output largerthan25;
run;
If use SAS procedure:
proc means data=test(where=(age>25)) noprint;
var class;
output out=largerthan25 n=numbercount;
run;
proc print data=largerthan25;
run;