Date: Fri, 29 Mar 1996 09:20:03 -0500
Reply-To: Joe Carpenter <jcarpent@GNU.UVM.EDU>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Joe Carpenter <jcarpent@GNU.UVM.EDU>
Subject: Calling Global Variables Conditionally from a Nested Macro
I would appreciate any help in calling global variables conditionally
from a nested macro. The program structure is similar to the following:
%global COUNT1 COUNT2 COUNT3 COUNT4 COUNT5;
%macro one (parameters);
macro statements;
call symput statements to set up global vars;
invoke macro 2 with parameters 1, 2, 3, 4, or 5, depending on which
global count variable is needed;
%mend macro 1;
%macro2 (countparameter);
%if &count&countparameter > 0 %then %do; e.g., &count3
program statements;
%end;
%mend macro2;
I would appreciate help with the %if statement - how to have the macro
variable be read as &count1 to &count5, depending on invocation.
Joe Carpenter
Data Analyst, Biometry Facility
University of Vermont
(802) 656-0619 email: jcarpent@zoo.uvm.edu