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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2956 views
  • 4 likes
  • 5 in conversation