Hi,
I was wondering why
- hash are converted to a dot and
- dot are causing an issue
when used in a variable label exported in an Excel file
using the excel engine or dmbs=excel.
It works fine with dmbs=xlsx.
Is it just a reported bug?
libname demo excel "&demo./reporting/test.xlsx"; data demo.test (dblabel=yes); label x01 = '1 #test' x2 = '2. test'; retain x01 1 x02 2 ; run; libname demo;
It seems to be a problem related to the Excel library engine (which uses MS software and is only available on Windows).
This code transferred the characters correctly:
ods excel file="/folders/myfolders/test.xlsx";
data test;
label
x01 = '1 #test'
x02 = '2. test'
;
retain x01 1 x02 2 ;
run;
proc print data=test label;
run;
ods excel close;
It seems to be a problem related to the Excel library engine (which uses MS software and is only available on Windows).
This code transferred the characters correctly:
ods excel file="/folders/myfolders/test.xlsx";
data test;
label
x01 = '1 #test'
x02 = '2. test'
;
retain x01 1 x02 2 ;
run;
proc print data=test label;
run;
ods excel close;
Maybe it was a shortcoming in the old (pre-XLSX) format that needed to be addressed.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.