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

I'm a SAS EG user and have limited experience with direct SAS programming. I'm currently using SAS EG version 8.2 Update 1 (8.2.1.1223). I would like to accomplish this project in SAS EG if possible.

 

I have two tables with the same variables and I would like to compare the two tables. Each table has the same 50 variables.

 

I would like to compare the frequency of values for 28 of the variables shared between the two tables by showing the total frequency for each value within those variables in each table. Additionally, I would like to see the percent change in those frequencies between the two tables.

 

Is this possible in SAS EG?

 

Any guidance is appreciated - Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Yes it's possible. It's not possible to do it in one step though, using EG tasks. 

 

1. Create a summary table for table 1 - use a task, store it to a dataset

2. Create a summary table for table 2 - use a task, store it to a dataset

3. Merge the two data sets by the common key variable, your category. Use Query Builder here

4. Create a computed column that will calculate the difference. Either use Query Builder again or modify your code from Step #3.

 

View solution in original post

2 REPLIES 2
Reeza
Super User

Yes it's possible. It's not possible to do it in one step though, using EG tasks. 

 

1. Create a summary table for table 1 - use a task, store it to a dataset

2. Create a summary table for table 2 - use a task, store it to a dataset

3. Merge the two data sets by the common key variable, your category. Use Query Builder here

4. Create a computed column that will calculate the difference. Either use Query Builder again or modify your code from Step #3.

 

runningjay
Fluorite | Level 6

Thanks for the insight and the steps on how to do this. I appreciate the help.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1243 views
  • 1 like
  • 2 in conversation