'proc import' versus libname for importing a xlsx file via pcfile server.

Reply
Occasional Contributor
Posts: 13

'proc import' versus libname for importing a xlsx file via pcfile server.

What are the pros and cons of each method? Which is better?

Historically I have tended to use a proc import statement to import data from a xlsx file, but lately I have noticed the process will hang. The only work around which appears to work is by creating a pcfile libname and accessing the data that way....which leads me to wonder what are the pros and cons of each method. Is the libname the 'better way?'xls

Super User
Posts: 3,261

Re: 'proc import' versus libname for importing a xlsx file via pcfile server.

Posted in reply to kruzewski

I've never struck the problems you are having with PROC IMPORT hence the choice of using IMPORT versus LIBNAME comes down to what it is to be used for.

PROC IMPORT is ideal for importing a single worksheet where you wish to explicitly name the output SAS dataset. The LIBNAME approach I find is better if you are importing several sheets from a workbook and want SAS to take care of the output dataset names. I find using PROC DATASETS with the LIBNAME is great for this.

We don't use the PC File Server as we use the 64-bit MS Office components with 64-bit SAS to avoid "bitness" issues that the PC File Server addresses, and it works very reliably.

Super User
Posts: 19,878

Re: 'proc import' versus libname for importing a xlsx file via pcfile server.

Posted in reply to kruzewski

The only time I've run into issues is when you're dealing with SAS 64bit and Office 32 bit.

I prefer the libname method in general myself because you can see the file before 'importing', but that has nothing to do with functionality.

Ask a Question
Discussion stats
  • 2 replies
  • 497 views
  • 0 likes
  • 3 in conversation