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 (March 2006, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: sas-l@uga.edu
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


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