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 13:51:11 +0000
Reply-To:   "Fehd, Ronald J. (CDC/OCOO/ITSO)" <rjf2@CDC.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Fehd, Ronald J. (CDC/OCOO/ITSO)" <rjf2@CDC.GOV>
Subject:   Re: Conditional Macro
In-Reply-To:   <>
Content-Type:   text/plain; charset="us-ascii"

SAS does not speak the natural language English nor grok the initial letters of shaking head Yes or No.

instead use boolean:

%let Gastro=1;

%If &Gastro. %then %do;

Ron Fehd logical macro maven

> -----Original Message----- > From: [] > On Behalf Of Adams, Nicholas > Sent: Wednesday, August 24, 2011 9:45 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Conditional Macro > > 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. > > > example > > %let Gastro='Y'; > > Proc Sql and Data steps > > %if &Gastro=Y %then %do; > > Data Steps > > %end; > > 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