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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 2474 views
  • 2 likes
  • 2 in conversation