f



Re: SAS/ACCESS Libname: Reading Tables with Names Longer than 32 #3

Dan,

If you're correct he could capture the original name, use the Window's ren
command to shorten it, and then reset the true filename.

Art
-------
On Tue, 25 Aug 2009 17:56:29 -0700, Nordlund, Dan (DSHS/RDA)
<NordlDJ@DSHS.WA.GOV> wrote:

>> -----Original Message-----
>> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
>> Arthur Tabachneck
>> Sent: Tuesday, August 25, 2009 5:39 PM
>> To: SAS-L@LISTSERV.UGA.EDU
>> Subject: Re: SAS/ACCESS Libname: Reading Tables with Names Longer than 32
>> Characters
>>
>> Paul,
>>
>> I don't have access to SQL Server, but I use the following method for
>> shortening long directory names for Excel: use x to run Window's substr
>> command to assign the long directory name to an unused directory letter
(I
>> usually use X:\).
>>
>> i.e.,
>> x 'subst x: "\\winsrvp03\sastemp\art\test\long named folder\even longer
>> named folder"';
>>
>> libname test "x:\sufficiently long filename.xls";
>>
>>
>> If you choose to use that method, just make sure that you unassign the
>> directory.  I.e., x "subst x: /d";
>>
>> Art
>> ---------
>> On Tue, 25 Aug 2009 15:59:28 -0700, Paul Miller <pjmiller_57@YAHOO.COM>
>> wrote:
>>
>> >Hello Everyone,
>> >�
>> >I've recently learned about the SAS/ACCESS libname and manged to write
the
>> code for reading SQL Server tables that appears below. I'm receiving
>> databases that�contain tables with names�substantially longer than the
32
>> character�limit and was just wondering if anyone�knows a way of dealing
>> with this. My hope was that there might be an option that would tell SAS
to
>> truncate any table names that go beyond the 32 character�limit,�but I
>> haven't been able to find anything like that.
>> >�
>> >Thanks,
>
>Art,
>
>It sounds like Paul's problem may be that some table names (independent of
any path information) in SQL Server are too long to be valid SAS dataset
names.
>
>Paul,
>
>I don't know if SQL Server supports it, but in Oracle one can assign an
alias for table names.  If that is possible you could alias the table name
with a shorter name.  If you can't do that, then if you have SAS ACCESS ODBC
or SQL Server drivers, you could use pass-thru SQL to read the table and
create SAS datasets out of the returned results, but with shorter file names
>
>Hope this is helpful,
>
>Dan
>
>Daniel J. Nordlund
>Washington State Department of Social and Health Services
>Planning, Performance, and Accountability
>Research and Data Analysis Division
>Olympia, WA  98504-5204
0
art297 (4213)
8/26/2009 1:05:36 AM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
452 Views

Similar Articles

[PageSpeed] 38

Reply: