Hello again and thanks for the quick answers! I was able to use your method but I get an error at the end... Here's the complete code DATA calc;
array T[11] $ 20 _temporary_ (
"Moins de 18 ans"
"De 18 à 24 ans"
"De 25 à 29 ans"
"De 30 à 34 ans"
"De 35 à 39 ans"
"De 40 à 44 ans"
"De 45 à 49 ans"
"De 50 à 54 ans"
"De 55 à 59 ans"
"De 60 à 64 ans"
"65 ans et plus"
);
Lotdeselection = &NUM_CTR.;
set DEMO (where=(type_ben = "Adhérent"));
if age < 18 then i = 1;
else if age < 25 then i = 2;
else if age > 64 then i = 11;
else i = 2 + ceil((age - 24) / 5);
TraLibelle = T[i];
drop i;
RUN;
proc tabulate data=calc /*format=Z3.1*/out=tbdN /*style=[1]*/;
class TraLibelle sexe LotdeSelection;
var prorata;
table TraLibelle*LotdeSelection,sexe*(prorata)*(sum /*colpctsum*F=7.2*/);
run;
ODS SELECT ALL ;
proc sort data=tbdN (drop=_page_ _TYPE_ _TABLE_);
by TraLibelle;
run;
proc transpose data=tbdN out=T_;
by TraLibelle LotdeSelection;
var prorata_Sum;
id SEXE;
run;
proc sql;
create table tbd5 as
select LotdeSelection,
TraLibelle,/*put(TraLibelle,$tranche_age.) as test,*/
round(Homme,1) as NbhFinsurv,
round(Femme,1) as NbfFinsurv
from T_
ORDER BY put(TraLibelle,$tranche_age.);
quit; and the problem is that whenever someone is less than eighteen, it displays a "." instead of "Moins de 18 ans". Is it because there are only 4 under 18 women and no under 18 men? Best regards
... View more