Date: Mon, 28 Aug 2006 09:48:10 -0400
Reply-To: "Fehd, Ronald J. (CDC/CCHIS/NCHM)" <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J. (CDC/CCHIS/NCHM)" <rjf2@CDC.GOV>
Subject: Re: Libref Issue
Content-Type: text/plain; charset="us-ascii"
> From: Pankaj
> I am creating a
> library reference
> in a macro A and passing that
probable error in reference: libname is not equal to libref
> as a parameter to another macro B, after this i
> am trying to use this
which: libref, or libname
> in this macro B to create a
> dataset in that library but its giving me error for libref
> not assigned. Please help.
as others requested we need a log from you.
a library reference, libref,
does not allocate the library.
you must first use the libname statement,
of which libref is the pronoun
that you will later use to refer to the directory specification.
keyword libref=pronoun directory-specification
libname MyLibRef 'c:\temp';
so: macro A creates the libref MyLibRef
and you pass that libref
-- note: you said libname, which is incorrect --
to macro B.
whatever value libref has it is only a string
which you are passing to/from macros.
%Let Libref = Temp;
libname &Libref. 'C:\temp';
%B(lib = Temp);
the above will work;
however, since macro A knows the value of libref
how do you think some other programmer will be able to figure out
that libref = Temp
has already been allocated.
It would be better to have macro B allocate its own libname and libref.
Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov