Hi folks! I've been googling and searching the site, but with no luck so far, so thought I'd ask. I'm looking for a good SUGI paper, blog post, site, whatever that has a really basic intro-level overview of writing a good SAS macro for data read-in and data cleaning (e.g. recoding). I've done this kind of thing before but it's been years, so I'm a little rusty, and I want to have a quick reference to share with colleagues.
Problem is, every macro program reference I can find online goes into one detail or another at a level far more detailed that what I need. They either go into details on how the macro processor works, how to do really complicated macros, or how to do macros that aren't for my context.
I'm just making a macro or "master file" that calls other programs and runs them in sequence. For example.
%macro check_and_clean ; %include _lib-assign.sas /* Sets libraries for this project */ %include _contents.sas /* Checks number of cases data */ %include _subset-national.sas /* Subsets from national data to state needed */ %include _raw-formats /* Includes formats for the "raw" data */ %include _new-formats /* Includes final formats for the to be used in analysis */ %include _freq-check.sas /* Checks cat vars needed for analysis */ %include _means-check.sas /* Checks cont vars needed for analysis */ %include _weight-check.sas /* Checks weight vars needed for analysis */ %include _freq-clean.sas /* Cleans cat vars */ %include _means-clean.sas /* Cleans cont vars */ %include _combine /* Combines multiple years of data and weights making them ready for analysis */ %mend check_and_clean ;
Thanks in advance! Maybe I just need to write the blog post myself. 🙂
... View more