Learning SAS? Welcome to the exclusive online community for all SAS learners.

is there a way to export to excel?

Reply
N/A
Posts: 1

is there a way to export to excel?

Hi, I'm learning SAS and using SAS Studio University.  There are features that are very nice.  Under My Libraries, there is a subgroup for SAS Help.  Here contains some data sets.  Looking at the youtube video, it uses CARS as the example for choosing columns to show.  It also shows you how to export the data to pdf file.  I was wondering if there was a way to export the file in excel?  Is there some special code that needs to be added in order to be able to export to excel?

Super Contributor
Posts: 336

Re: is there a way to export to excel?

I don't know the youtube video, but it should be something like this:

Proc Export Data=Sashelp.Cars

                   Outfile="C:\Path\Cars.xls" /* input the right path .. */

                   DBMS=XLS Label Replace; /* "XLS" is the excel version, you need to check this .. */

  Sheet="Cars";

Run;

Super User
Posts: 17,828

Re: is there a way to export to excel?

You'll need to use Unix file name conventions and XLSX or Excel I think, but should work otherwise.

Can also use ODS EXCEL to mimic the PDF output with proc print:

This will generate a native XLSX file.

ODS EXCEL file="unix path to file here";

proc print data=sashelp.class;

run;

ODS EXCEL close;

Ask a Question
Discussion stats
  • 2 replies
  • 986 views
  • 0 likes
  • 3 in conversation