The SAS Output Delivery System and reporting techniques

ODS tableeditor tagset & Leading Zeros

Reply
Contributor
Posts: 52

ODS tableeditor tagset & Leading Zeros

I’m creating several pivot table reports using Chevell Parker’s SAS Global Forum 2010 paper, http://support.sas.com/resources/papers/proceedings10/003-2010.pdf.

My past history with leading zeros and tagsets doesn’t seem to be working this time.

I’ve tried the following within in my PROC PRINT, but it isn’t working.

var char_lead_zero / style(data)={tagattr="format:@"};

My current code follows my signature. The number_format, within the ODS statement, didn’t work either. I’m using SAS 9.13 SP 4.

TIA,
Kim LeBouton

data test;
input char_lead_zero $5. x year;
datalines;
01234 10 1999
02345 15 2000
12345 20 2001
;
run;

ods tagsets.tableeditor file="%sysfunc(getoption(work))\temp.html"
options(
/*button_text="Create PivotTable"*/
auto_excel="yes"
excel_open="yes"
pivotrow="char_lead_zero"
pivotcol="year"
pivotdata="x"

sheet_name="Test by Kim"
number_format="@"
excel_save_file="c:\\temp.xls"
quit="yes");

proc print data=work.test;
run;

ods tagsets.tableeditor close;
SAS Super FREQ
Posts: 8,744

Re: ODS tableeditor tagset & Leading Zeros

Hi:
I don't know about using the @ in the format. However, when I need leading zeroes in an HTML file that will be opened by Excel, I use the mso-number-format with the HTMLSTYLE style attribute. You might want to double check with Tech Support that this is OK. When I ran this code, I did get leading zeroes in the file that Excel opened. I tried number_format="00000" first, by itself, but that did not cause leading zeroes. Only using the HTMLSTYLE style attribute worked.

cynthia
[pre]
ods tagsets.tableeditor file="c:\temp\temp.html"
options(auto_excel="yes"
excel_open="yes"
pivotrow="char_lead_zero"
pivotcol="year"
pivotdata="x"
sheet_name="Test by Kim"
number_format="00000"
excel_save_file="c:\temp\temp_save.xls"
quit="yes");

proc print data=work.test;
var char_lead_zero / style(data)={htmlstyle='mso-number-format:00000'};
var x year;
run;

ods tagsets.tableeditor close;


[/pre]
Ask a Question
Discussion stats
  • 1 reply
  • 168 views
  • 0 likes
  • 2 in conversation