libname patients '/home/u63367626/PATIENTS';
data patients.patt1;
set patt2;
format dob1 date9.;
*removes spaces and adds / between values. Easier to use the MDY function;
dob=compress(cat(month,'/',day,'/',year));
dob1=input(dob,mmddyy10.);
*incorrect calculation of age, should be age = yrdif(dob1, '01jan2023'd, dob1);
age = yrdif(dob1,'01jan2023'd)/365;
*ends current data step;
run;
*outside of data step - does nothing/error;
output;
*outside of data step - does nothing/error;
=2;
*outside of data step - does nothing/error;
output;
*outside of data step - does nothing/error;
run;
/*evaluating the statistical parameters for age*/
proc sort data=patients.patt1;
*outside of data step - does nothing/error;
by ;
run;
proc means data=patients.patt1;
variables age; *usually see var age not the full word variables;
output out= agestsatz;
by ; *no variable specified to break up the analysis;
run;
See comments on your code.
... View more