BookmarkSubscribeRSS Feed
pokepim
Calcite | Level 5

I'm trying to categorize variables in one tables based on the conditions coming from another table. Currently im using macro which assigns categories (by creating a new table and putting categories under the variables) to those values however it seems that it is assigining them even if the value doesnt not meet the conditions. For example 2nd value of first variable is 78 which should be category 2 but it still assigns it to category 1.

With this post I'm providing the two datasets(tables)- one is for categorization conditions and the other one is containing all the variables with values.

1 REPLY 1
ballardw
Super User

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.

 

 

Provide the minimum amount of data to demonstrate your issue and show us what the result should be for any supplied example data.

 

I'm not following your code as to what is to be accomplished but it almost sound like some of the "condition" information might be useable to build formats??

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 647 views
  • 0 likes
  • 2 in conversation