Date: Thu, 5 Jun 2008 16:19:46 -0400
Reply-To: Chang Chung <chang_y_chung@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Chang Chung <chang_y_chung@HOTMAIL.COM>
Subject: Re: Pathname and quotes
hi,
sorry. I was too much in a hurry. Here is a correction.
chang
%macro ind;&sysindex.%mend ind; /* NEW */
%*-- returns a new libref which is not being used --*;
%macro libref;
%local r;
%do %until(%qsysfunc(pathname(&r))=);
%let r=libref%ind; /* CORRECTED */
%put r=&r.;
%end;
&r
%mend libref;
%macro test;
%local myRef;
%*-- create a clean libref --*;
%let myRef = %libref;
%*-- use the libref here on via mvar, myRef --*;
libname v9 &myRef. "d:\your dir";
%*-- use it like --*;
data &myRef..one;
one=1;
run;
proc print data=&myRef..one;
run;
%*-- and so on ... --*;
%mend test;
|