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 12:29:25 -0800
Reply-To:     "Berryhill, Tim" <TWB2@PGE.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Berryhill, Tim" <TWB2@PGE.COM>
Subject:      Re: include macro question
Comments: To: Kyle Dane <kyledane@MY-DEJA.COM>
Content-Type: text/plain

Two solutions come to mind. Each makes it difficult to use #1 by itself.

First, you could change #1 to a macro, so that #2 can specify parameter values during the call.

Second, you could write #1 referencing macro variables (but with no other macro syntax). Then you could initialize the macro variables with %let or CALL SYMPUT statements in #2 before calling #1. This might make it easier to call #1 without #2 if you wanted to do that.

> ---------- > From: Kyle Dane[SMTP:kyledane@MY-DEJA.COM] > Reply To: Kyle Dane > Sent: Thursday, November 18, 1999 11:07 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: include macro question > > 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 > kdane@medicine.ucsf.edu > > > Sent via Deja.com http://www.deja.com/ > Before you buy. >


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