Return to Archive

SAS Tip of the Month
May 2007

Want to know which SAS modules are loaded on your system? Try the following SAS code and look at the log:

    proc setinit noalias;
    run;

Not every site has all the SAS modules, if fact there are very few - at last count there were 30+ separate modules available and the odds that all the SAS modules are on your system is remote. This is important as sometimes when I am creating an output I want to test which SAS modules are loaded on a system, and depending on what is available the program will do one process or another. You can test if a module is loaded or not using either the SYSPROD or %SYSPROD functions. The following example demonstrates its use:

    %if %sysprod(STAT)=1 %then %do;
        %*STAT module loaded then run macro using PROC TTEST;
        ... more SAS statements ...
    %end;
    %else %do;
        %*STAT module not loaded - use TTEST from R;
        ... more SAS statements ...
    %end;
________________________________
Updated May 1, 2007