Hi, im new to sas macros. how would I go about creating a macro to do the following:
# Does the comparison table have all columns present in the base dataset?
# Does the comparison table have any columns not present in the base dataset?
# Are corresponding columns between tables of the same data type?
# Are corresponding character columns of the same length?
# Do the tables have the same number of records?
any help is appreciated!
Without question, here is the right way to get started.
Cut out the macros.
Write a program that does all of this for two data sets, hard-coding the data set names.
Once you have working code, you can begin to think about how to change that to a macro.
Tip 1, use Base SAS.
Tip 2, use the appropriate procedure:
Proc compare is specifically designed to do these comparisons.
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 16. 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.