DATA Step, Macro, Functions and more

Help in count function

Accepted Solution Solved
Reply
Contributor
Posts: 70
Accepted Solution

Help in count function

I dont want to use Proc SQL in my program.

 

 

I am trying to calculate a new column (Acc) with the count of all variables. pin_id1 is numeric.

 

data test.id;
set test.data ;
Acc= count(pin_id1,pin_id1,pin_id3);
run;

 


ERROR 72-185: The COUNT function call has too many arguments.

 

NOTE: Numeric values have been converted to character values at the places given by: (Line)Smiley SadColumn).
25:12 25:20 25:28 25:36 25:44
NOTE: The SAS System stopped processing this step because of errors.

 

Output like:

 

pin_id1   pin_id2   Pin_id3   Acc

235          465         987         3

223                           777       2


Accepted Solutions
Solution
‎07-17-2017 03:14 PM
Trusted Advisor
Posts: 1,934

Re: Help in count function

Posted in reply to Kalai2008

COUNT is not the proper function to use in this case.

 

You want to use the N function

 

acc=n(pin_id1,pin_id2,pin_id3);

View solution in original post


All Replies
Solution
‎07-17-2017 03:14 PM
Trusted Advisor
Posts: 1,934

Re: Help in count function

Posted in reply to Kalai2008

COUNT is not the proper function to use in this case.

 

You want to use the N function

 

acc=n(pin_id1,pin_id2,pin_id3);

Contributor
Posts: 70

Re: Help in count function

Posted in reply to PaigeMiller
Thank you!..It worked.I was confused with the proc sql.
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 117 views
  • 0 likes
  • 2 in conversation