Bioclinical Data Services Inc.

 

home
services
why us?
contact us
validation
SAS tips


Bioclinical Data Services Inc.
1933 Coltrane Place, Escondido, CA 92027
,
(760) 738-4958

 


SAS TIPS

Question:  In our clinical environment, we are trying to emphasize reusable SAS code via the use of %include modules rather than the use of macros.  What considerations are important to effectively use %include modules instead of macro modules?

Answer:   For simplicity let us discuss the use of  %includes within directory oriented operating systems (i.e. Windows, UNIX, VMS). 

Keep the organization simple.  Since you are not using macros, you lose the convenience of an automated "module finder" with the use of the SAS autocall system option. 

Maintain these modules either (a)  in the same directory as other SAS source modules or (b) as children of the current directory.   In this way, you can avoid hardcoding the physical path that points to the module.  Instead, use relative references to the %includes.  In this way, one can move the  entire directory structure as needed  without destroying the pointers to these %includes.

If you choose to keep the %includes in the same directory as the other source modules, use a different extension such as ".inc" to differentiate them from our SAS source modules.

Typically three major categories of % includes will emerge:

  1. Utilities which are not part of an FDA submission.  Move these to their own directory.  This will simplify packaging of code when submitting to the FDA.
  2. Common code that can used by virtually every program.  (i.e. a routine that places titles and footnotes in each program).  
  3. Code that is common to different source modules that contain a common theme (i.e. code that repeatedly used by programs that calculate an efficacy parameter).  These are often developed by one programmer for their own "set" of programs.  

Place common code for constants and system options in a file in which each program calls at the start of each program (i.e. %include "init.inc" )  This will greatly reduce the maintenance load as all programmers on the team can be "on the same page."  Also, executing of this module can allow you to refresh the environment every time the program is run.  This is a nice feature particularly if you run jobs in display manager.

Remember, %includes should be rigorously tested just as if you were validating any other SAS program or macro.  Since these modules are often copied into a number of programs, an error can ultimately cause erroneous output in many programs.

Finally, document these modules in a directory file in which entries are listed alphabetically and contains a brief description of the file.  If the number of entries is quite extensive, you may consider organizing the directory list  alphabetically within function.