BookmarkSubscribeRSS Feed
brianhoops1
Fluorite | Level 6

I'm stuck on the Exporting Data to an Excel Workbook on Lesson 6 SAS Programming 1.

 

On the Demo, it asks the following:

 

 

  • Add a LIBNAME statement to create a library named xlout that points to an Excel file named southpacific.xlsx.
    Note: 
    Use &outpath to provide the path to the file.

 

 

libname xlout xlsx "&outpath/southpacific.xlsx";

 

I have added xlout for this step and step 6. When I run the program, I receive the error:

brianhoops1_0-1697492806339.png

In the previous steps, we were instructed to add the Macro variable for output, but that does not seem to be working. Any advice on how to proceed?

2 REPLIES 2
Tom
Super User Tom
Super User

You are going to need more code than that to EXPORT data to an XLSX file.

 

First you have to have defined the macro variable outpath properly.

Second you have to have some code that will write something into the new XLSX file (actually do the exporting).

Once that is done then perhaps there will be sheet named South_Pacific in the XLSX file that the libref XLOUT is pointing to.

ballardw
Super User

Show the code where you assign a value to the macro variable outpath.

 

User defined macro variables like that do not persist across sessions. So if you did that in a different SAS session you need to do it again.

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!

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
  • 2 replies
  • 703 views
  • 0 likes
  • 3 in conversation