DATA Step, Macro, Functions and more

retain value

Reply
Contributor
Posts: 53

retain value

[ Edited ]

Hi

I am trying to retain value of aval (where ablfl=y)in base_ for  same usubjid  ,I am getting missing values

wht can be issue?

 

proc sort data =  final3 out=final3_;
by usubjid avisit descending ablfl;
run;
data final4_;
set final3_;
by usubjid avisit descending ablfl;
retain aval_ base_;
if first.usubjid and ablfl='Y' then do;
aval_=aval;
end;
else aval_=aval_;


run;

img.png

PROC Star
Posts: 1,357

Re: retain value

if first.usubjid and ablfl='Y' then do;
aval_=aval;
end;
else aval=aval_;/*correction here i think*/
Ask a Question
Discussion stats
  • 1 reply
  • 68 views
  • 0 likes
  • 2 in conversation