Date: Tue, 7 Mar 2006 08:44:35 -0800
Reply-To: TK <Tony.Kelleher@CSO.IE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: TK <Tony.Kelleher@CSO.IE>
Organization: http://groups.google.com
Subject: Re: Sas variable inside macro
In-Reply-To: <1141720734.374300.55560@e56g2000cwe.googlegroups.com>
Content-Type: text/plain; charset="iso-8859-1"
Do you mean something like this ? You can just change the name of the
data set in the macro call statement (%check).
options mprint mlogic symbolgen;
data students;
input ID $ Name $ Class fees paid $;
cards;
1001 Rg 1 100 y
1002 Rv 2 200 n
1003 Re 5 300 y
1004 Su 4 400 y
1005 Ma 3 500 n
1006 Ni 6 600 y
;
RUN;
%macro check(dset, var);
data &dset;
set &dset;
if paid ='n' or paid = 'N' then &var = fees+500;
run;
%mend check;
%check (dset=students, var=check);
Regards,
Tony Kelleher
Central Statistics Office
Ireland