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

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

devnand
Obsidian | Level 7

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 ;

devnand
Obsidian | Level 7

I hope this will help ..

sstoline
Calcite | Level 5

I posted this question,

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.

Ksharp
Super User

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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 19 replies
  • 2394 views
  • 11 likes
  • 8 in conversation