Creating Excel Worksheets

In addition to being able to read Excel data, SAS can also create Excel worksheets from SAS data sets.
To do this, you use the SAS/ACCESS LIBNAME statement. For example, to create a new worksheet named high_stress from the temporary SAS data set work.high_stress and save this worksheet in the new Excel file newExcel.xlsx, you would submit the following LIBNAME statement and DATA step:
libname clinic 'c:\Users\mylaptop\admitxl.xlsx' mixed=yes;
data clinic.admit;
   set work.admit;
run;

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.