DATA Step, Macro, Functions and more

Error in count function

Reply
Contributor
Posts: 70

Error in count function

Getting error like 

ERROR: Summary functions are restricted to the SELECT and HAVING clauses only.

 

proc sql;

select  acc, 

sum(amt) as tot_amt,

count(id1) as count1,
count(id2) as count2,
count(id3) as count3,
count(id4) as count4,
count(id5) as count5,
sum(calculated count1,calculated count2,calculated count3,calculated count4,calculated count5) as tot_id

from table

group by acc

run;

 

Each acct have 5 ids..some are blank.

Super User
Posts: 19,770

Re: Error in count function

Posted in reply to Kalai2008

Post your log. I'm not seeing what would cause that specific error.

Ask a Question
Discussion stats
  • 1 reply
  • 71 views
  • 0 likes
  • 2 in conversation