Like making a LIBNAME with PCFILES for directory whose name contain a space ?
Ex : TB_Rep PCFILES PATH="C:\T EMP\Toto.mdb" SERVER = %sysget(computername) ;
You can use the TYPE= option to force it to treat the file as either Excel or Access file.
TYPE= EXCEL | ACCESS
specifies the file type in the PATH= statement.
Note:Use TYPE= if the file identified in the PATH= statement does not have an .xls or .mdb file extension.
can you please clarify the context of that syntax?
Using SAS 9.3 64-bit to access the 32-bit MS Office files
But folder name contains a space and the line of code does not work with file whose name contains a space.
43802 - Installing SAS® 9.3 PC Files Server and using it to convert 32-bit Microsoft Office files to...http://support.sas.com/kb/43/802.html
In WIndows if you want to reference a path with an embedded space you need to enclose it in quotes.
Since the SAS syntax requires quotes also the internal quotes need to be doubled.
LIBNAME TB_Rep PCFILES PATH="""C:\T EMP\Toto.mdb"""
SERVER = %sysget(computername)
;
You can use the QUOTE() function to make the necessary conversion for you.
LIBNAME TB_Rep PCFILES PATH=%sysfunc(quote("C:\T EMP\Toto.mdb"))
SERVER = %sysget(computername)
;
I tried your thing and I received this error mesage :
647 LIBNAME TB_Rep PCFILES PATH= %sysfunc(quote("C:\T EMP\Toto.mdb"))
648 SERVER = %sysget(computername);
ERROR: Unable to determine file type from PATH= option.
ERROR: Error in the LIBNAME statement
I found the solution :
TB_Rep PCFILES PATH=%sysfunc(quote(C:\T EMP\Toto.mdb)) SERVER = %sysget(computername)
So that is the same code that you started with. Check to make sure that you have not entered your code into something like Microsoft Office. That program has an extremely nasty habit of changing quotes into strange ASCII codes so that they look "pretty".
You can use the TYPE= option to force it to treat the file as either Excel or Access file.
TYPE= EXCEL | ACCESS
specifies the file type in the PATH= statement.
Note:Use TYPE= if the file identified in the PATH= statement does not have an .xls or .mdb file extension.
Perfect,it works great with option :
TYPE= EXCEL | ACCESS and %sysfunc(quote())
Tank you Tom
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.