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-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

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
  • 4349 views
  • 4 likes
  • 5 in conversation