How do I keep # in a label name exported to sas

Reply
New Contributor
Posts: 2

How do I keep # in a label name exported to sas

When using the excel libname engine to export data to excel it replaces # in the label name with a dot.   It there a way to keep the # in the label and or column name?  I am using SAS 9.4.

PROC Star
Posts: 7,431

Re: How do I keep # in a label name exported to sas

The following worked for me:

 

data test;
  set sashelp.class;
  label weight='# of pounds';
  label height='# of centemeters';
run;

ods excel file="'/folders/myfolders/#test.xlsx'";
proc print data=work.test label noobs;
run;
ods excel close;

Art, CEO, AnalystFinder.com

 

New Contributor
Posts: 2

Re: How do I keep # in a label name exported to sas

Thanks Art.  I want to do it using the excel libname engine as I am updating an existing named range in excel.

PROC Star
Posts: 7,431

Re: How do I keep # in a label name exported to sas

If you're just replacing the values in that/those named range(s), then a third alternative would be the free macro you can download at: http://www.sascommunity.org/wiki/A_Poor/Rich_SAS_Users_Proc_Export

 

Art, CEO, AnalystFinder.com

 

Ask a Question
Discussion stats
  • 3 replies
  • 113 views
  • 1 like
  • 2 in conversation