BookmarkSubscribeRSS Feed
Eieioxinxin
Calcite | Level 5

Hello, 

I'm using the SAS Studio to do the Activity of Lesson 2:Understanding SAS Data:

 

"Write a LIBNAME statement to create a library named NP that reads np_info.xlsx in the course data as follows:

  • SAS Studio: Specify the full path to your EPG1V2/data folder and the complete file name."

I missed specifying the "XLSX" engine in the statement the first time, and the LOG showed "the Libref NP was successfully assigned," "Engind: EXCEL" as the pictures below.

Then I navigated to the list of libraries and open the NP library, there were four tables with "$" symbols of the tables' names, which were different from the correct results with the "XLSX" statement. 

 

May I ask:

Q1: Why the Libref NP was successfully assigned even if I missed the "XLSX" engine?

Q2: What is the difference between "Engind: EXCEL" and "Engind: XLSX"?

Q3: What is the "$" mean on the tables' names? and why are those results?

Q4: What is the effect of missing the "XLSX" engine when writing a LIBNAME statement and creating a library?

 

Thanks a lot! 

 

1. 

LIBNAME statement:  libname NP "S:/workshop/EPG1V2/data/np_info.xlsx";

Eieioxinxin_0-1683218281206.png

Screenshot 2023-05-04 123555.png

 

2. Correct results

LIBNAME statement: libname NP XLSX "S:/workshop/EPG1V2/data/np_info.xlsx";

The LOG showed "the Libref NP was successfully assigned," and "Engind: XLSX."

Screenshot 2023-05-04 123701.png

There are three tables in the NP library: ParksSpecies, and Visits.

Screenshot 2023-05-04 123650.png

 

1 REPLY 1
ballardw
Super User

@Eieioxinxin wrote:

Hello, 

I'm using the SAS Studio to do the Activity of Lesson 2:Understanding SAS Data:

 

"Write a LIBNAME statement to create a library named NP that reads np_info.xlsx in the course data as follows:

  • SAS Studio: Specify the full path to your EPG1V2/data folder and the complete file name."

I missed specifying the "XLSX" engine in the statement the first time, and the LOG showed "the Libref NP was successfully assigned," "Engind: EXCEL" as the pictures below.

Then I navigated to the list of libraries and open the NP library, there were four tables with "$" symbols of the tables' names, which were different from the correct results with the "XLSX" statement. 

 

May I ask:

Q1: Why the Libref NP was successfully assigned even if I missed the "XLSX" engine?

Q2: What is the difference between "Engind: EXCEL" and "Engind: XLSX"?

Q3: What is the "$" mean on the tables' names? and why are those results?

Q4: What is the effect of missing the "XLSX" engine when writing a LIBNAME statement and creating a library?

 

Q1 and Q4 are basically the same.

I do not know your set up but there is a SAS system option calle DLCREATEDIR. With limits that means when a LIBNAME statement is used and the last directory in the path doesn't exist then SAS will create it for you. But it should be Folder. Depending on your file system your might find that  you have folder in the Data folder with that Xlsx name in addition to the actual xlsx file.

Q2:  Which versions of Excel files are intended. Excel has been around for 30+ years and has gone through many file formats. One of the most noticeable changes are the numbers of rows and columns that may be used.

 

Not sure about the $ though.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
LIBNAME 101

Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 562 views
  • 0 likes
  • 2 in conversation