Date: Fri, 28 Mar 2003 08:22:11 -0500
Reply-To: "Fehd, Ronald J. (PHPPO)" <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J. (PHPPO)" <rjf2@CDC.GOV>
Subject: Re: Macro to conditionally run a SAS program
Content-Type: text/plain
> From: Greg Crawford [mailto:greg-crawford@COX.NET]
> I am a relative newcomer to using SAS macros.
one of the tips in my paper:
SUGI 26: 2001 Long Beach CA
Beg Tutor 66 Macro Tour
A Beginner's Tour of a Project using SAS(r) Macros
Led by SAS-L's Macro Maven
http://www2.sas.com/proceedings/sugi26/p066-26.pdf
involves a condition execution of an %INCLUDE
your problem may be solved by:
- - - report0.sas
DATA _NULL_;FILE PRINT;PUT 'ZERO MESSAGE';STOP;RUN;
%*OR;
%PUT 'ZERO MESSAGE';
RUN;
- - - report0.sas end
- - - report1.sas
DATA _NULL_;FILE PRINT;PUT 'ONE MESSAGE';STOP;RUN;
%*OR;
%PUT 'ONE MESSAGE';
RUN;
- - - report1.sas end
your choice program:
DATA _NULL_;
retain CHOICE '0';
Choice = put((<condition>),z1.);
call symput('CHOICE',Choice);stop;
run;%PUT CHOICE<&CHOICE.>;
%INCLUDE PGM(REPORT&CHOICE.);
Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov