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 (April 2003, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 30 Apr 2003 09:12:33 -0400
Reply-To:   "Droogendyk, Harry" <Harry.Droogendyk@CIBC.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Droogendyk, Harry" <Harry.Droogendyk@CIBC.COM>
Subject:   Re: Macro for referencing a library
Content-Type:   text/plain; charset="iso-8859-1"

Rune:

Macro is really just text replacement / generation. Once the macro variable is resolved, your statement looks like:

proc sql; create table "SKVE9499".Sakstab as select * from "SKVE9499".sak; etc... quit;

As you know, that's invalid SQL. What you want follows ( note the double periods, the first to end the macro variable name, the second as needed for the typical libname.dataset syntax )

proc sql; create table &bibl..Sakstab as select * from &bibl..sak; quit;

-----Original Message----- From: Rune Runnestoe [mailto:rune@FASTLANE.NO] Sent: April 30, 2003 8:27 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Macro for referencing a library

I want to replace the library SKVE9499 with a macro in the following code.

proc sql; create table SKVE9499.Sakstab as select * from SKVE9499.sak;

I define the macro like this: %let bibl=SKVE9499;

and try to reference the macro like this: proc sql; create table "&bibl".Sakstab as select * from "&bibl".sak;

but receive error in the log. How is the correct table reference ?

Regards Rune Runnestoe


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