Desktop productivity for business analysts and programmers

Export to Excel

Reply
Contributor
Posts: 30

Export to Excel

Good afternoon,

I need to export from SAS to Excel.

I tried with the proc export but it changed the format and it did not show the column names.

proc export

  data=WORK.xxx

  dbms=xls

  outfile="xxx.xls"

  replace;

run;

How can I export?

Thanks!

Valued Guide
Posts: 2,111

Re: Export to Excel

since you are in the EGuide GUI, you can just export using file --> export.

Frequent Contributor
Posts: 83

Re: Export to Excel

Insert "label" into the code before replace, this will export the labelled column names from SAS into excel. Mind you if you put labels onto the columns in SAS ie rather than UID you have the label "Unique ID variable", "Unique ID variable" is what will appear in Excel.

proc export

  data=WORK.xxx

  dbms=xls

  outfile="xxx.xls"

  label

  replace;

run;

If you have variable labels and wanted the SAS variable name to actually be output you could put this before your proc export statement

proc datasets lib=work memtype=data;

  modify xxx;

  attrib _all_ label=' ';

run;

Hope this helps.

Learner NK
Learner
Posts: 1

Re: Export to Excel

export it as in cvs format and then to excel

Ask a Question
Discussion stats
  • 3 replies
  • 305 views
  • 0 likes
  • 4 in conversation