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

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

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

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);

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

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);

--
Paige Miller
Kalai2008
Pyrite | Level 9
Thank you!..It worked.I was confused with the proc sql.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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