The SAS Output Delivery System and reporting techniques

ODS to EXCEL column labels not working

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

ODS to EXCEL column labels not working

After several updates (including SAS 9.2 to SAS 9.3), an ODS to EXCEL sequence that is one of my workhorses now works only partially. The only problem is a failure to add specified column labels.

The code is:

ods html path="c:\temp\" (url=none) file="&YEAR._H01.xls" style=minimal;

PROC PRINT NOOBS LABEL DATA=M6;

     TITLE1 'TABLE H01';

     TITLE2 'MARRIAGES BY COUNTY OF ISSUANCE OF LICENSE ';

     TITLE3 'BY MONTH OF MARRIAGE';

     TITLE4 "KANSAS, &YEAR";

     FORMAT COUNTY COUNTY_B.;

     LABEL COUNTY='COUNTY OF ISSUANCE' COL1='TOTAL' COL2='JAN' COL3='FEB'

                COL4='MAR' COL5='APR' COL6='MAY' COL7='JUN'

                COL8='JUL' COL9='AUG' COL10='SEP' COL11='OCT' COL12='NOV' COL13='DEC';

RUN;

ods html close;

The column labels that appear in the output are COUNTY, COL1, COL2, COL3, etc.

Does anyone have any idea what is going wrong?

Thanks,

David Oakley


 

TABLE H01


 

 

MARRIAGES BY COUNTY OF ISSUANCE
  OF LICENSE


 

 

BY MONTH OF MARRIAGE


 

 

KANSAS, 2012


 

 

COUNTY


 

 

COL1


 

 

COL2


 

 

COL3


 

 

COL4


 

 

COL5


 

 

COL6


 

 

COL7


 

 

COL8


 

 

COL9


 

 

COL10


 

 

COL11


 

 

COL12


 

 

COL13


 

 

Allen


 

 

71


 

 

3


 

 

4


 

 

6


 

 

5


 

 

5


 

 

12


 

 

10


 

 

4


 

 

6


 

 

9


 

 

5


 

 

2


 

 

Anderson


 

 

47


 

 

0


 

 

2


 

 

1


 

 

7


 

 

7


 

 

7


 

 

5


 

 

3


 

 

4


 

 

5


 

 

3


 

 

3


 

Accepted Solutions
Solution
‎03-27-2013 01:24 PM
SAS Super FREQ
Posts: 8,868

Re: ODS to EXCEL column labels not working


Hi, there is an option that will "turn off" the use of LABELS until you turn it back on again.

14973 - Labels not displayed with NOLABEL system option set

You might try:

options label;

before your ods html step. Perhaps your administrator turned off the use of labels as a default, for some reason.

SAS(R) 9.3 System Options: Reference, Second Edition

cynthia

View solution in original post


All Replies
Contributor
Posts: 66

Re: ODS to EXCEL column labels not working

I am not really sure why your labels do not work. But a quick fix would be rename those variables in a data step  and use your above code.

If you need to write your reports in spreadsheets frequently have a look at EXELXP tagset.

Base SAS: Demo: ExcelXP Tagset and Microsoft Excel

Solution
‎03-27-2013 01:24 PM
SAS Super FREQ
Posts: 8,868

Re: ODS to EXCEL column labels not working


Hi, there is an option that will "turn off" the use of LABELS until you turn it back on again.

14973 - Labels not displayed with NOLABEL system option set

You might try:

options label;

before your ods html step. Perhaps your administrator turned off the use of labels as a default, for some reason.

SAS(R) 9.3 System Options: Reference, Second Edition

cynthia

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 214 views
  • 0 likes
  • 3 in conversation