I'm new to using proc SQL, but I'm using it to look at counts of states by race/ethnicity (separate categories).
I want to include a new group called "all" for both race and ethnicity, so it would be combining (for each of race and ethnicity) the total counts for the 2 categories.
What is the easiest way to do this? To create this table, I'm using two separate tables that already have race and ethnicity broken down; would it be easier to modify those primary tables, or somehow create a new variable within the new table?
I'm using two separate tables that already have race and ethnicity broken down
Can you show us a portion of these two tables? Can you show us the desired output?
@SAS93 wrote:
What is the easiest way to do this?
If you want a dataset, use proc Means. If you want a report table, use proc Tabulate.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.