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 (August 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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 aka: libref

> in a macro A and passing that > libname

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

> libref

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.

my guess:

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.

%Macro A; %Let Libref = Temp; libname &Libref. 'C:\temp'; %mend;

%Macro B(lib=);

Data &Lib..Test;

%mend;

%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


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