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

Hello team,

 I need the total rows for a dataset. I use proc means to get the count of a variable in a dataset,

The query gives errors: log says: Variable memberletter in list doesn't match type prescribed for this list.

 

I assume memberletter is a character and means requires data type as number.

I used proc freq and that gave me the memberletter broken by the values that exists in the variable.

I need a total line.

 

I appreciate your response.

 

Regards,

Blue blue

 

Blue Blue
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Proc means will only do statistics for numeric variables. I have to assume you placed the name of a character variable on a VAR statement to generate that message.

 

And why are you using Proc means if you want a number of records in a data set? Proc Contents will do that.

 

Or you could use proc summary with the variable on a CLASS statement (NO var variables).

Or query sashelp.vtables.

 

Instead of piecemeal questions it might help to provide a description of where all this is going and some data.

View solution in original post

2 REPLIES 2
ballardw
Super User

Proc means will only do statistics for numeric variables. I have to assume you placed the name of a character variable on a VAR statement to generate that message.

 

And why are you using Proc means if you want a number of records in a data set? Proc Contents will do that.

 

Or you could use proc summary with the variable on a CLASS statement (NO var variables).

Or query sashelp.vtables.

 

Instead of piecemeal questions it might help to provide a description of where all this is going and some data.

PaigeMiller
Diamond | Level 26

PROC FREQ does give the total. It is the cumulative value in the last row:

 

proc freq data=sashelp.class;
    tables sex;
run;

This produces the total value of N, which is the value of 19 in the cumulative frequency in the last line

 

Capture.PNG

 



 

 

--
Paige Miller

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore 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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1428 views
  • 2 likes
  • 3 in conversation