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 (November 1999, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 18 Nov 1999 19:25:09 -0500
Reply-To:     Jon Weisz <jonweisz@BELLSOUTH.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jon Weisz <jonweisz@BELLSOUTH.NET>
Subject:      Re: include macro question
Content-Type: text/plain; charset="US-ASCII"


%macro exapmle(dataset,variable); data &dataset; set &dataset; var1= &variable +1; run;

%mend example;

to execute the macro program you will need to submit:

%example(&dataset,&variable) from program #2

---------- In article <811iol$6ik$>, Kyle Dane <> wrote:

> I'm interested in a solution to the following problem. I know I can > simply copy the code from one SAS program to another, but I foresee this > as something I'll want to do regularly in the future so bear with me. > > I have an existing program (program #1) that I want to use within > another program (#2). I understand that I can call #1 from #2 with the > macro command %include '<#1>'. > > But #1 has several proc and data steps, so I want to pass the arguments > <dataset> and <variable> into #1 from #2, so that statements such as > these will complete themselves properly: > > data <dataset>; > set <dataset>; > var1=<variable>+1; > > Thanks in advance for anyone who can give me a solution. > -- > Kyle Dane > Programmer/Analyst > UCSF Division of Geriatrics > > > > Sent via > Before you buy.

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