03-16-2016 05:41 PM - edited 03-22-2017 12:31 PM
After speaking with a few other members of SUGIR I was encouraged to post this. Over my short time in IR I have created a handful of Macros to make my life simpler. I was repeating a lot of code so I took some of that and turned them into Macros.
Link to the SAS Macro Toolbox: SAS Macro Toolbox
What is included:
- 11 macros that should be universal for anyone to use out of the box
- Program which contain samples as to how to use the macros
- Documentation related to the macros
- All of the included macros should work on any version of SAS starting with v9.2, Baylor is currently on SAS 9.4M3
- Baylor University has configured a system directory that auto-compiles these macros whenever a user launches a SAS Session
- The macro 'system_options' is utilized in a few of the other macros so be sure to compile that macro if needed
- The 'dset_*' macros are very useful if you need to do a data merge and are worried about data truncation. They also have uses towards saving storage space (though nowadays this should not be a concern)
- I do have 2 other macros that are not included in the zip archive because they are specifically configured for Baylor University
*TERM_LIST_GENERATOR: This macro will generate a list of terms based on parameters set and store it into a macro variable. If your Unviersity is a Banner school I would be happy to share this macro. You will most likey have to edit the macro to some extent as there is some specific coding for Baylor Terms
*ALL_ORACLE_TABLES: This macro is used to quickly declare oracle-based tables used at Baylor. Again, if you would like this macro please send me a message. I will need to scrub the macro first as it currently contains specific Baylor configurations.
After attending SAS Global Forum 2016, I have made a few updates to the macros. The overall functionality of the macros is the same. In order to download the updated macros please use the below link.
For the DSET_* macros I have changed the default value for option 'CHARONLY' to equal 'Y'. This means that by default the DSET_* macros will ONLY process character variables.
- Added new macro 'CONVERT_ALLVAR_NUM_TO_CHAR'. This macro will convert ALL numeric variables to character variables. This includes date variables
- Updated macro Get_Filepath to supresss warning messages if the directory path (aka filepath) or filename contains an '&'
- Fixed a bug within 'CONVERT_ALLVAR_NUM_TO_CHAR' and 'DSET_LENGTH_*' macros where temporary variables created would exceed 32 characters.
If you have any questions feel free to contact me.