i am having problem for across report for parent child colmuns.
below is the code. there are two columns Currentatt which is parent and
Attend_Stat which is child. i am getting the values wrong. for each cell the calculation is
(sum of individual cell value /sum of row values )*1000.
piece of code:
Proc Report data=WORK.RuralPerson nocompletecols out=temp missing;
column cnt
sector_cd
('age-group' AgeDesc)
('level of current attendance' Currentatt,(Attend_Stat,(Multiplier Multiplier=mul Sr_Person=mul1))("Total" "" "" Multiplier=all)(Multiplier=all1))
("persons (5-30 yrs.)" "" ("estd.(00)" "" "" Multiplier=all_estpersons)("sample" "" "" Sr_Person=all_samper) SIZE);
define sector_cd / noprint;
define cnt / noprint group ;
define cnt1 / noprint group ;
define AgeDesc / group "" order=data;
define Currentatt / across "" order=data;
define attend_stat / across "" order=data;
define Multiplier / sum "" format=dottozero.;
define all_estpersons / sum "" format=8.;
DEFINE SIZE / COMPUTED NOPRINT;
define all / sum "" format=dottozero.;
DEFINE ALL1/ SUM "" NOPRINT;
DEFINE ALL2/sum "" NOPRINT;
define all_samper / n "" ;
define mul/sum noprint;
define mul1/n noprint;
break after cnt/summarize;
COMPUTE SIZE;
all=SUM(_C4_,_C7_,_C10_,_C13_,_C16_,_C19_,_C22_,_C25_,_C28_,_C31_,_C34_)/all *1000;
_C4_ = _C4_ /ALL1 *1000;
_C7_ = _C7_ /ALL1 *1000;
_C10_ = _C10_ /ALL1 *1000;
_C13_ = _C13_ /ALL1 *1000;
_C16_ = _C16_ /ALL1 *1000;
_C19_ = _C19_ /ALL1 *1000;
_C22_ = _C22_ /ALL1 *1000;
_C25_ = _C25_ /ALL1 *1000;
_C28_ = _C28_ /ALL1 *1000;
_C31_ = _C31_ /ALL1 *1000;
_C34_ = _C34_ /ALL1 *1000;
all_estpersons=all_estpersons/100;
ENDCOMP;
compute after cnt;
AgeDesc='estd. persons(00) (5-30 yrs.)';
_C4_=_C5_/100;
_C7_=_C8_/100;
_C10_=_C11_/100;
_C13_=_C14_/100;
_C16_=_C17_/100;
_C19_=_C20_/100;
_C22_=_C23_/100;
_C25_=_C26_/100;
_C28_=_C29_/100;
_C31_=_C32_/100;
_C34_=_C35_/100;
all=SUM(_C4_,_C7_,_C10_,_C13_,_C16_,_C19_,_C22_,_C25_,_C28_,_C31_,_C34_)/all *1000;
all3=.;
all_estpersons=.;
all_samper=.;
endcomp;
compute after;
AgeDesc='sample persons (5-30 yrs.)';
_C4_ = _C6_;
_C7_ = _C9_;
_C10_ = _C12_;
_C13_ = _C15_;
_C16_ = _C18_;
_C19_ = _C21_;
_C22_ = _C24_;
_C25_ = _C27_;
_C28_ = _C30_;
_C31_ = _C33_;
_C34_ = _C36_;
all=SUM(_C4_,_C7_,_C10_,_C13_,_C16_,_C19_,_C22_,_C25_,_C28_,_C31_,_C34_);
all3=.;
all_estpersons=.;
all_samper=.;
endcomp;
rbreak after / summarize ;
run;
end of code:
kindly give me some solution.