From the course: SAS® 9.4 Cert Prep: Part 06 Exporting Results

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Demo: Exporting data to an Excel workbook

Demo: Exporting data to an Excel workbook - SAS Tutorial

From the course: SAS® 9.4 Cert Prep: Part 06 Exporting Results

Demo: Exporting data to an Excel workbook

- [Instructor] Another easy way to export data is to use a LIBNAME engine. In this scenario, you are creating the table, rather than exporting an existing table. You use a LIBNAME statement to create the data in the desired format. And then in your code, you can write results directly to that target data source. Of course, you need to have write permission to the target destination. As an example, this program uses the xlsx engine to define a library to a new Excel workbook named cars. The data statement references the library, and a worksheet named asiacars. This code extracts data about cars manufactured in Asia from sashelp.cars, an writes the results directly into the asiacars worksheet in the cars workbook. Let's see what else we can do with this in a demo. In this program, we'll use the xlsx LIBNAME engine to export sastables to multiple worksheets in an Excel workbook. We'll start with this program that…

Contents