Hello, I'm getting this error
ERROR: The PCFILES engine cannot be found.
ERROR: Error in the LIBNAME statement.
I'm trying to run this code:
libname custfm pcfiles path="&path/custfm.xls";
proc contents data=custfm._all_;
run;
data work.males;
run;
proc print data=work.males label;
run;
libname custfm clear;
Any thoughts as to what is wrong?
did the libname get successfully assigned?
if yes, do a test using
proc contents data=custfm._all_;/* this will list you the datasets in the excel that you are reading */
run;
If there aint any, well, you would have to know where your xls file is placed, i mean the exact location, find that, get it's path and replace exactly in the syntax and do again.
Alternatively, import the xls file to your SAS environment using the import wizard or proc import and get started with your SAS stuff. If this fails too, store the file as csv file and read with infile and input statements. Have fun!!!
I don't think you need to specify pcfiles engine and path= coz &path will just resolve to the defined path of macro by the macro processor by substituting it's value from the global symbol table and places it back into the input stack.
libname custfm "&path\custfm.xls"; *this should work getting your libname assigned.
Are you in SAS University Edition?
No, I'm not in the SAS University Edition.
Is PCFILES Server installed?
Do you need to use PCFILES at all? It's used when you have SAS 64 bit and Excel 32 Bit.
What version of SAS do you have and what bitness? Also what version of Excel and bitness?
Naveen, I got this error when running what you advised:
WARNING: Apparent symbolic reference PATH not resolved.
ERROR: Connect: 'C:\Users\cflach\Documents\&path\custfm.xls' is not a valid path. Make sure
that the path name is spelled correctly and that you are connected to the server on
which the file resides.
ERROR: Error in the LIBNAME statement.
Hi, &path will hold the value of the path. So if you are specifying the full path name, don't use macro &path
libname libref "your path"; *this is the syntax;
try this: libname custfm 'C:\Users\cflach\Documents\custfm.xls' ; * assuming this is where your xls file is located;
Reeza,
How do I know if PCFILES server is installed?
Where do I find the bitness for SAS and Excel?
Thanks!!
I would first try suggestion of hard coding the path, except with the EXCEL specified. Remember for macro variables to resolve you need to use double not single quotes.
libname custfm excel 'C:\Users\cflach\Documents\custfm.xls' ;
For PC File Server if you're on Windows desktop go to Programs>SAS>PC FILE SERVER should be in the list of applications.
For bitness of SAS, in SAS go to HELP>About SAS and see what is under Software Information.
When referencing a macro variable and other literal text you need a . after the macro variable to indicate the end of the variable and that the remainder text is appended. &path/custfm.xls is going to look for a macro variable with /custfm as part of the name, which isn't a legal name and won't exist. Use &path./custfm.xls or &path.\custfm.xls depending on Operating System.
Thank you, Naveen.
I think I'm getting closer. I did get this warning though with nothing in the output:
WARNING: No matching members in directory.
did the libname get successfully assigned?
if yes, do a test using
proc contents data=custfm._all_;/* this will list you the datasets in the excel that you are reading */
run;
If there aint any, well, you would have to know where your xls file is placed, i mean the exact location, find that, get it's path and replace exactly in the syntax and do again.
Alternatively, import the xls file to your SAS environment using the import wizard or proc import and get started with your SAS stuff. If this fails too, store the file as csv file and read with infile and input statements. Have fun!!!
I think that worked. Sorry, I'm super new to SAS. Thank you so much!!
I'm sorry, this is my first time. How do I mark a question answered?
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.