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
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>;
> Thanks in advance for anyone who can give me a solution.
> Kyle Dane
> UCSF Division of Geriatrics
> Sent via Deja.com http://www.deja.com/
> Before you buy.