data qw;
input pid $ sex age race $ color$;
cards;
p001 1 18 as w
p002 2 23 af b
p003 1 24 as w
p004 2 27 af b
;
data qw2;
set qw;
length s $ 7 r $ 9 c $ 8 ;
if sex=1 then s='male';
else s='female';
if race='as' then r='asian';
else r='african';
if color='w' then c='white';
else c='black';
drop sex race color;
rename s=sex r=race c=color;
run;
proc print data=qw2;
run;
No comments:
Post a Comment