As the first step in the decommissioning of the site has been converted to read-only mode.

Here are some tips for How to share your SAS knowledge with your professional network.

Talk:Conditionally Executing Global Statements

From sasCommunity
Jump to: navigation, search

Excellent example. However one word of caution about this technique. If the macro variable values being referenced in the logical expression require macro quoting, you will often get a syntax error. For the sample environment for my book, Building Web Applications with SAS/IntrNet: A Guide to the Application Dispatcher, I wrote a simple macro to do this and have discovered that it handles quoting much more gracefully than %sysfunc(ifc(....)).

Here is the macro source for this iif macro:

%macro iif
      (cond,      /* logical expression to evaluate */
       positive,  /* text to return if expression true */
       negative   /* text to return if expression false */
 /*            Web Applications with SAS/IntrNet(R):                  */
 /*            A Guide to the Application Dispatcher                  */
 /*          by Don Henderson, Henderson Consulting Services          */
 /*       Copyright(c) 2006 by SAS Institute Inc., Cary, NC, USA      */
 /*                   SAS Publications order                          */
 /*                   ISBN 978-1-59994-189-9                          */
 /* rest of comment blocked snipped                                   */

 %if &cond %then

%mend IIF;

--Donh 18:35, 7 March 2008 (EST)