You can always nest all the conditional manipulations under a single if statement if they follow a common condition. Like : IF X =1 THEN DO; /* Below mentioned 2 lines will be processed if this condition is met */ A =B; D=C; END; /* make sure you're closing the do block with an End statement */ data prim;
set adqrs1 (where=(param='Total Score'));
by usubjid ;
if fasfl='Y' and avisitn>0 ;
if parcat1 in ('GAD-7' 'WLQ Index Score' 'SDS' 'WPAI' 'WHODAS' 'DSST' 'CGI-I') then delete;
if parcat1='PDQ-D-20' then do; chg_pdq=chg;
base_pdq=base;
end;
else if parcat1='WLQ' then do; chg_wlq=chg;
base_wlq=base;
end;
else if parcat1='QIDS-SS' then base_qids=base; /*since the conditions are different we can't nest them */
else if parcat1='CGI_S' then base_cgis=base;
keep usubjid aage asexn chg_pdq chg_wlq avisit base_pdq base_wlq base_qids base_cgis;
run;
... View more