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):(Column).
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
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);
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);
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.