Or create a sub category variable and use a simple proc SQL:
data have;
input ID $ cat$ value;
cards;
101 in1 30
101 out1 60
101 in2 .
101 out2 .
102 in1 20
102 out1 30
102 in2 69
102 out2 .
103 in1 20
103 out1 .
104 in1 10
104 out1 .
104 in2 .
104 out2 .
;
proc sql;
create table want as
select *, compress(cat,,'kd') as _cat from have
group by id, _cat
having not missing(sum(value));
quit;
Haikuo
data card;
input id cat $ value;
datalines;
101 in1 30
101 out1 60
101 in2 .
101 out2 .
102 in1 20
102 out1 30
102 in2 69
102 out2 .
103 in1 20
103 out1 .
;
run;
proc print ; run ;
proc sort data = card ; by id value ; run ;
data card_nodups dups ;
set card ;
by id value ;
if first.value and last.value then output card_nodups ;
else output dups ;
run ;
proc print card_nodups ; run ;
I hope this will help ..
How to perform ANOVA and multiple comparisons with PROC surveymeans?
This question is Not Answered.(Mark as assumed answered)
but no answers available yet. I am not sure if I posted it correcetly. Could you please let me know because this is my first experience.
Or DOW.
data have; input ID $ cat$ value; cards; 101 in1 30 101 out1 60 101 in2 . 101 out2 . 102 in1 20 102 out1 30 102 in2 69 102 out2 . 103 in1 20 103 out1 . 104 in1 10 104 out1 . 104 in2 . 104 out2 . ; data want; n=0; do until(cat eq: 'out'); set have; if missing(value) then n+1; end; do until(cat eq: 'out'); set have; if n ne 2 then output; end; run;
Ksharp
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.