BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
hhinohar
Quartz | Level 8

OK. Then dow loop provided might need a modification.

 

*case of multiple death obs;
data have;
infile datalines dlm="09"x;
input ID $ Transaction Age Death Parameter $;
datalines;
6	1	.	.	A	 
6	2	.	.	B	 
6	3	.	.	C	 
6	.	3	3.45	 	 
8	1	.	 	A	 
8	2	.	 	B	 
8	3	.	 	C	 
8	.	2	12	 	 
8	.	2	11	
8	.	2	10	
9	1	.	 	A	 
9	2	.	 	B	 
9	3	.	 	C	 
9	.	2	11	 	 
9	.	2	12	
9	.	2	13	 	 
9	.	2	11	
; 	 
run;

*1;
data want;
	do until(last.id);
		set have;
		by id;
		v=max(death,v);
	end;
	do until(last.id);
		set have;
		by id;
		if Parameter eq 'B' then
			value=v;
		else call missing(value);
		output;		
	end;
	drop v;
run;
bharath86
Obsidian | Level 7
Hi Thanks, This works to the extent, but not for multiple if statements. I need to do the same activity for other variables as well. Thanks again.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 16 replies
  • 3605 views
  • 4 likes
  • 5 in conversation