SELFC3 1 5
SELFC4 1 5
SCORE 0 30
Transpose data main.dat creating one
variable containing ;
all variables in the data
set ;
proc transpose data=main out=new;
by caseid;
proc sort data=new;
by _name_caseid;
proc sort data=limits;
by vname;
Merge this data set new with limits
data set ;
data new;
merge new (rename= (name=vname
col1=varval)) limits
(in=inlim);
by vname;
if inlim;
if varval ne. then do;
if varval < min then lessmin =
caseid;
else if varval > max then gtmax =
caseid;
end;
else misdat=caseid;
Delete observations with no values
outside limits/missing data ;
if sum (lessmin, gtmax, misdat) =. then
delete;
run;
proc print data = new label;
by vname;
id vname;
var lessmin misdat gtmax;
label vname = 'variable name'
lessmin = '<min'
misdat = 'missing'
gtmax = '>max';
title 'Out of Range Values and Missing
Data by Caseid';
run;
Figure 1: SAS program to check
missing and out-of-range values
**;
Filename: POWER1.JOB
;
Appendix 352