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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.