BookmarkSubscribeRSS Feed
shivanshmishra
Calcite | Level 5

As per my understanding libname can connect to excel files and create SAS libraries for the same and the proc import can do the same job. Also, I think libname cannot import unstructured data but proc import can. Is my understanding correct?
Also what other differences does both of these features have i.e. what is the difference between libname and proc import.

3 REPLIES 3
Kurt_Bremser
Super User

Both proc import with dbms=excel and libname excel try their best in guessing the types for columns in the spreadsheet. But it is still, for both, guesswork, and will not lead to consistently repeatable results.Types, lengths, formats may change with what is contained in the rows that they inspect for making the guesses.

So your best bet is always to use an other, text-based file format for bringing spreadsheet data into SAS. This allows you (by using the same data step, not proc import!) to have full control over the process.

 

libname allows you to use proc copy to "bulk import" several spreadsheets contained in a workbook. proc import can only import one sheet at a time.

shivanshmishra
Calcite | Level 5

Hi kurt,

 

Thanks for your prompt reply but if we are not talking in the context of excel, what all other differences does libname and proc import have?

 

Thanks for the effort,

Shivansh

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2867 views
  • 2 likes
  • 2 in conversation