Date: Tue, 4 Nov 2008 23:23:12 -0600
Reply-To: Joe Matise <snoopy369@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Joe Matise <snoopy369@GMAIL.COM>
Subject: Re: Why suddenly this warning?
Content-Type: text/plain; charset=ISO-8859-1
One important thing I haven't seen mentioned so far: your put statement is
BEFORE the macro invocation. Even if you'd declared it as a global macro
variable (%global (var) is the proper syntax for that), it still wouldn't
have been defined based on %same( ) because you hadn't actually run it yet.
Also, to add to the other thread of discussion, perhaps it's supposed to be
upcase(x.libname) = "WORK"?
On Tue, Nov 4, 2008 at 3:46 AM, Franz <firstname.lastname@example.org> wrote:
> Dear all,
> I have written a small macro (SAS 8.2) to find out common variables between
> 2 SAS Data Sets. The macro in the past also did his job! But I am suddenly
> getting this warning:
> WARNING: Apparent symbolic reference COMMON not resolved.
> What is suddenly wrong with the syntax?
> %macro same_var(d1= ,d2=);
> proc sql noprint;
> select trimn (x.name) into:common separated by ' '
> from sashelp.vcolumn x,
> sashelp.vcolumn y
> where x.libname = upcase ('work')
> and y.libname = upcase ('work')
> and x.memname = upcase ('&d1')
> and y.memname = upcase ('&d2')
> and x.name = y.name
> and x.type = y.type
> %mend same_var;
> %put &common;
> %same_var(d1=test_1, d2=test_2);
> Any other way to achieve this?
> Thanks & Kind regards,