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
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.
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.
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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.