LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2011, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 24 Aug 2011 06:45:19 -0700
Reply-To:     "Adams, Nicholas" <NRAdams@CVTY.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Adams, Nicholas" <NRAdams@CVTY.COM>
Subject:      Conditional Macro
Content-Type: text/plain; charset="us-ascii"

I have a program that has a series of data steps and proc sqls. I have one section of it that I want to run if a condition is true. I set a macro variable called gastro at the begining of the code to be either Y of N. I cant seen to get the syntax right of running the section of code conditionally.


%let Gastro='Y';

Proc Sql and Data steps

%if &Gastro=Y %then %do;

Data Steps


Rest of Proc Sql and Data Steps

Thanks, Nick

Email Confidentiality Notice: The information contained in this transmission is confidential, proprietary or privileged and may be subject to protection under the law, including the Health Insurance Portability and Accountability Act (HIPAA).

The message is intended for the sole use of the individual or entity to whom it is addressed. If you are not the intended recipient, you are notified that any use, distribution or copying of the message is strictly prohibited and may subject you to criminal or civil penalties. If you received this transmission in error, please contact the sender immediately by replying to this email and delete the material from any computer.

Back to: Top of message | Previous page | Main SAS-L page