BookmarkSubscribeRSS Feed
snelll
Calcite | Level 5

I am fairly new to SAS and I am not a programmer. I have a report in which column A and Column B identify multiple organizations in which certain users have different responsibilities. In most cases, the organization name should be the same in both columns, however, we have discovered that this is not always the case. I would like to know if there is a way preferably in SAS VA or if not, in SAS EG that I run a query or report that will identify each row in which the value of Column A is not the same as the value in Column B.

Hoping you can help. Currently using SAS EG 7.1

4 REPLIES 4
Reeza
Super User

You can do it in Data Planner in SAS VA or EG.

 

Either way you're looking for ColA not equal to ColB which would be a filter in VA.

 

In EG, open a dataset, choose a filter and add the condition. However, if those are character fields, you may want to standardize them a bit first, because McDonalds is not the same as Mcdonalds.

 

 

snelll
Calcite | Level 5

thanks for you very quick reply Reeza. We're going to give it a try and I'll let you know if it does the trick for us.

snelll
Calcite | Level 5

Thanks everyone for you help. I was amazed at how quickly I got a response and will definitely reach out again when I need help. It turns out we were using the filter correctly but the data in two columns we were comparing were so slightly different (SSC|SPC  vs SSC-SPC) that we didn't notice this was why we were not getting the results we expected.

Your feedback made us look more closely as to why your advice confirmed our first approach but we were not getting the results. We used the filter in SAS EG as recommended by Reeza

ballardw
Super User

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 4 replies
  • 2267 views
  • 0 likes
  • 3 in conversation