Monday, August 28, 2006

Sas symput

proc univariate data=nizul_kitun ;
var nizul_lifnei ;
output out= univout
pctlpre= pop_ pctlpts= 10 20 30 40 50 60 70 80 90;
run;
data _null_;
set univout;
call symput('pop_10',pop_10);
call symput('pop_20',pop_20);
call symput('pop_30',pop_30);
call symput('pop_40',pop_40);
call symput('pop_50',pop_50);
call symput('pop_60',pop_60);
call symput('pop_70',pop_70);
call symput('pop_80',pop_80);
call symput('pop_90',pop_90);

run;
data kkk;
set kkk;
if nizul_aharei<=&pop_10 then p=1;
else if nizul_aharei<=&pop_20 then p=2;
else if nizul_aharei<=&pop_30 then p=3;
else if nizul_aharei<=&pop_40 then p=4;
else if nizul_aharei<=&pop_50 then p=5;
else if nizul_aharei<=&pop_60 then p=6;
else if nizul_aharei<=&pop_70 then p=7;
else if nizul_aharei<=&pop_80 then p=8;
else if nizul_aharei<=&pop_90 then p=9;
else if nizul_aharei>&pop_90 then p=10;

run;

No comments: