Date: Fri, 12 Jun 2009 11:37:19 -0700
Reply-To: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Organization: http://groups.google.com
Subject: Re: Dynamic name for SAS Dataset in Version 9.2
Content-Type: text/plain; charset=ISO-8859-1
On Jun 11, 9:55 pm, stats...@GMAIL.COM (OR Stats) wrote:
> Hello SAS:
>
> I have 9.2 installed and getting an error that I did not encounter in 9.1.
> Before, when I write a macro
>
> LIBNAME mydir 'C:\Documents and Settings\';
> %maco mymac(name);
> DATA mydir.tab&name;
> ...
> run;
>
> %mend mymac;
> %mymac('myname');
>
> Before, it would create a table called t a b m y n a m e in the
> library m y d i r . But now, in the logs, it tries to create two
> tables, one called t a b and the other called m y n a m e in m
> y d i r .
>
> How do I get SAS 9.2 to create just one table called tabmyname. Where the
> 'myname' is picked up from a macro variable that I introduce as input in my
> macro function?
>
> Thx!!!
Use
%mymac(myname)
Testing this brought up an interesting observation.... In windows,
using a literal for the table name has these effects.
1. a libref WC00000n is created to correspond to the current folder
(as shown in the status bar)
2. a single level table name can be used to reference files in the
current folder.
create a table in WORK:
data foo;
set sashelp.class;
run;
create a table in current folder
data 'foo';
set sashelp.class;
run;
I suspect the same is true in Unix, however, case sensitivity may be
enforced on the table name (i.e. 'foo' and 'Foo' might be different
tables).
Furthermore, when using a single level name literal, the created table
is in WORK!
data 'foo'N;
set sashelp.class;
run;
--
Richard A. DeVenezia
http://www.devenezia.com