Help using Base SAS procedures

Group By

Reply
Contributor
Posts: 28

Group By

data have;  input acc$ sub accs$  ;  cards;  a 1 d  a 2 d  a . a  a . d  b 3 a  b 4 d  c . a  d . a ; run;

data want ;

c . a;

d .a;

run;

proc sql;

  select count(acc),acc from test where sub is  null group by acc ;

  quit;

Super User
Posts: 10,046

Re: Group By

Posted in reply to LearnByMistk

You don't explain your question yet .

data test;  
input acc $ sub accs $ @@;
cards;  
a 1 d  a 2 d  a . a  a . d  b 3 a  b 4 d  c . a  d . a 
;
run;

 
proc sql;
  select * from test where sub is  null group by acc having count(*) eq 1  ;
  quit;

Xia Keshan

Contributor
Posts: 28

Re: Group By

got it by my own ....thanks for your effort

Ask a Question
Discussion stats
  • 2 replies
  • 204 views
  • 0 likes
  • 2 in conversation