- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I've created a table where I extracted all the data I need using proc sql, now from that code I want to get a count of the data in one column.. does anyone have any tips?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
PROC FREQ.
proc freq data=sashelp.class;
table age;
run;
Otherwise, show an example of what you're looking to calculate overall.
@celbel wrote:
I've created a table where I extracted all the data I need using proc sql, now from that code I want to get a count of the data in one column.. does anyone have any tips?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
doing this would isolate the one column I'm looking at but what I really want is to be able to get a count of how many rows are in that column
so for example, let's say that column contains all the ingredients I need for a recipe, I actually just want a count, so a number of how many things are on that list
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Ok, lots of ways to get that value.
What are you planning to do with it? Depending on what the next step is you may want it in a macro variable or data set. If you're looking for verification or to check it, that information is also in the log after the creation.
proc means data=have N;
run;
You can also use PROC CONTENTS to view a description of the data set:
proc contents data=have;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
table age;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
To get the number of non-missing values in a column, use the COUNT() summary function in SQL.