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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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