Very often programmers find themselves re-running the same code with slight modifications to reflect a new filename, date or directory. How many times have you found yourself making minor edits to existing code to help it run on a new day or handle a slightly different input file? How many times have administrative notes not been updated such as who ran the code or where it is located? Even worse, how many times have deadlines been missed because a program’s author wasn’t there to make the necessary minor edits to the code? Thankfully SAS has a number of tools to help you reduce the tedium of manual updates and avoid their associated errors. SAS provides a number of resources that can be easily incorporated in your code to make your programs more extensible and robust. Many hard-coded dataset and variable references in your code can be replaced through the use of SAS dictionaries. Through the use of automatic macro variables, DATA steps and PROCs can be run conditionally based on the proper execution of previous code. Automatic macro variables and information from the operating system can also enhance logs with runtime information. This paper will introduce the basics of dictionaries, automatic macro variables, and operating system environment variables as well as provide a number of examples of how they might be used to automate code and control program flow
To submit an update or takedown request for this paper, please submit an Update/Correction/Removal Request.