NOTE: The SAS System stopped processing this step because of errors.
Syntax, FREQ procedure:
PROC FREQ DATA=SAS-data-set <NLEVELS>;
TABLES variable(s);
RUN;
|
proc freq data=cert.pats; tables Gender Age; run;
Syntax, MEANS procedure:
PROC MEANS DATA=SAS-data-set <statistics>;
VAR variable(s);
RUN;
|
proc means data=cert.pats; var Age; run;The following figure shows the output for the MEANS procedure. It displays a range of 16 to 202, which clearly indicates that there is invalid data somewhere in the Age column.
G
in
the input data. This error might be the result of a data entry error.
If G
should actually be M
,
it is possible to correct the invalid data for Gender by using an
assignment statement along with an IF-THEN statement:
data work.pats_clean;
set cert.pats;
gender=upcase(Gender);
if Gender='G' then Gender='M';
run;
proc print data=work.pats_clean;
run;
data work.clean_data; set cert.pats; gender=upcase(Gender); if Gender='G' then Gender='M'; if id=1147 then age=65; else if id=5277 then age=75; run; proc print data=work.clean_data; run;
data work.clean_data;
set cert.pats;
gender=upcase(Gender);
if Gender='G' then Gender='M';
if Age>110 then delete;
run;
proc print data=work.clean_data;
run;