| Date: | Wed, 24 Jun 2009 11:15:51 -0500 |
| Reply-To: | Joe Matise <snoopy369@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Joe Matise <snoopy369@GMAIL.COM> |
| Subject: | Re: Calling Macrovariable in ' ' |
|
| In-Reply-To: | <6eca73440906240855s477cc43ajb3fa02abe7d481db@mail.gmail.com> |
| Content-Type: | text/plain; charset=ISO-8859-1 |
Perhaps the spaces are a problem?
%let myvar = 2007;
libname temp "C:\&myvar";
should work fine assuming you have a directory c:\2007\ ...
-Joe
On Wed, Jun 24, 2009 at 10:55 AM, OR Stats <stats112@gmail.com> wrote:
> Hello:
>
> I am running SAS 9.2 and I still get the error
>
> LIBNAME temp " C:\&myvar ";
> Library temp does not exist.
>
> when I run
> %let myvar=2007;
> LIBNAME temp " C:\&myvar ";
>
>
> It doesn't appear to be resolving &myvar.
>
>
> On Wed, Jun 24, 2009 at 10:49 AM, Nat Wooding <Nathaniel.Wooding@dom.com
> >wrote:
>
> > The SAS compiler does NOT resolve macro variables that are in single
> > quotes. Change your line to
> >
> >
> > libname "C:\&myvar";
> >
> > Nat Wooding
> > Environmental Specialist III
> > Dominion, Environmental Biology
> > 4111 Castlewood Rd
> > Richmond, VA 23234
> > Phone:804-271-5313, Fax: 804-271-2977
> > Cel Phone: 804-205-0752
> >
> >
> >
> > OR Stats
> > <stats112@GMAIL.C
> > OM> To
> > Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU
> > Discussion" cc
> > <SAS-L@LISTSERV.U
> > GA.EDU <http://ga.edu/>>
> > Subject
> > Calling Macrovariable in ' '
> >
> > 06/24/2009 11:46
> > AM
> >
> >
> > Please respond to
> > OR Stats
> > <stats112@GMAIL.C
> > OM>
> >
> >
> >
> >
> >
> >
> > Hello:
> >
> > I have the following
> >
> > %let myvar=2007;
> >
> > libname 'C:\&myvar';
> >
> > But it won't resolve the last line to my directory C:\2007, which I had
> > already created in Windows. I do I get SAS to read the directory path
> > correctly?
> >
> > Thanks!
> >
> >
> > CONFIDENTIALITY NOTICE: This electronic message contains
> > information which may be legally confidential and or privileged and
> > does not in any case represent a firm ENERGY COMMODITY bid or offer
> > relating thereto which binds the sender without an additional
> > express written confirmation to that effect. The information is
> > intended solely for the individual or entity named above and access
> > by anyone else is unauthorized. If you are not the intended
> > recipient, any disclosure, copying, distribution, or use of the
> > contents of this information is prohibited and may be unlawful. If
> > you have received this electronic transmission in error, please
> > reply immediately to the sender that you have received the message
> > in error, and delete it. Thank you.
> >
>
|