Macros for download
I have made a number of macros that I use frequently in my own use of SAS.
I plan to put out more of these later, but some of these need some improvement
first: here are a few that I consider generally useful.
- Main macros
- User assistance macros
- This gives help on which macros are available in the SASAUTOS catalogues,
and prints help on these (top commented block in the files) to the log.
- Parses the log and extracts warnings and errors. Reports these in a brief format.
This is useful if you have a long log and wish to find if there were any reported problems.
- Takes quoted SAS code as a parameter and runs it once. Afterwards, it will not
be rerun unless a rerun is triggered by some other event: e.g. change in the code, or
by the rerunning of some other RunOnce on which it depends. This is particularly
useful if you have some code that needs to be run at the start, e.g. to generate data,
but takes a while to run: an alternative to commenting it out.
- Data handling
- Writes contents of a SAS data set to a text file. Format of output is customizable,
including column separator, column labels, formats, which columns are included and
- Parse a text file which contains a data table, try to interpret the format, and
generate data step code for reading it.
- Data analysis macros
- Quantile normalization. NB: Experimental!
- Utility macros
- Loop over integers (e.g. p,...,q) substituting the integer into a given expression.
Similar to %DoOver which loops over an arbitrary list of words/strings.
- Loops over a list of words/strings, substituting them into a given expression.
Similar to %Seq which loops over integers p,...,q.
- Substitute one substring with another. Runs substitutions until no more
- Supporting macros