DATA Step, Macro, Functions and more

Using ODS to write to Excel is using Labels instead of SAS Names

Reply
Frequent Contributor
Posts: 82

Using ODS to write to Excel is using Labels instead of SAS Names

Hi all,

 

I have a quick question - I can find info on how to use Labels instead of SAS Names when writing to Excel in an ODS statement, but I want it the other way around.  I would think that this would be the default.  But in my case it's using the Labels.

 

Here is my code:

 

     ods excel file=outdisp options(sheet_interval="none" columns="&varfrq" sheet_name="Person Freqs");

 

I want the ODS to use the SAS Names which are listed in the &varfrq macro.

 

Thanks for any help.

SASHunter

 

 

Super User
Posts: 7,761

Re: Using ODS to write to Excel is using Labels instead of SAS Names

Posted in reply to SASHunter

Look at the code that actually produces the report. I guess you have an option there that causes labels to be used.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
SAS Super FREQ
Posts: 8,862

Re: Using ODS to write to Excel is using Labels instead of SAS Names

Posted in reply to SASHunter
There's nothing in the ODS statement about the variable labels. It is the procedure you are running that controls this. For example, PROC REPORT and PROC TABULATE use labels if they are in place. But PROC PRINT does not. So look at your procedure output.
cynthia
Ask a Question
Discussion stats
  • 2 replies
  • 220 views
  • 1 like
  • 3 in conversation