Date: Thu, 17 Apr 2008 09:48:02 -0600
Reply-To: Alan Churchill <savian001@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Alan Churchill <savian001@GMAIL.COM>
Subject: Re: dynamically set up libname
In-Reply-To: <200804171454.m3HAkmuj001961@malibu.cc.uga.edu>
Content-Type: text/plain; charset="iso-8859-1"
There are lots of ways of solving this problem. Here is one:
Ship your code with a configuration file and then dynamically allocate the
libname a needed.
Say you have a config file (parms.xml):
<?xml version="1.0" encoding="UTF-8"?>
<parms>
<library>c:\temp</library>
</parms>
...and some SAS code...
%macro allocate (libname=);
libname Test "&libname" ;
%mend allocate;
%allocate(libname=c:\temp);
Marry the 2 pieces and you should have a way to dynamically allocate your
libraries. You could also use a datastep and a %include instead of a macro
but there are dozens of variations here.
Alan
Alan Churchill
Savian
www.savian.net
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
SUBSCRIBE SAS-L Dan
Sent: Thursday, April 17, 2008 8:54 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: dynamically set up libname
SASLers:
I am having a task to dynamically set up the libname. Here is the situation:
libname derive 'I:\Test';
The data sets and programs are all reside at 'I:\Test';
Then we will copy the folder to a CD and give it to the client. They will
run on their own machine. Since now the physical location of the folder
will be changed to the client machine 'C:\"what ever their own machine
assign to the CD drive"\Test',
then how I am going to set up the libname in the program and let the client
do a "monkey" job to run the program? I think this is a mission impossible.
Thanks for the helping.
Dan