NOTE: This is the Excel XP tagset (Compatible with SAS 9.1.3 and above, v1.131, 04/23/2015
@JasonNC This is the latest version of the tagset. As mentioned I tested my code on SAS 9.4 with the latest tagset and correct format it works as desired.
Finding the correct format is an Excel, not SAS issue, but Google still functions.
Good Luck.
1. Please review the code Cynthia provided in comparison to yours. You haven't specified your style for the column, have extra quotation marks, and have quotations in the wrong place.
3. You also need to specify a SAS format so that it's exported in the format you want. In your code there is no format.
Making these changes, with the latest version of tagsets generates exactly what you state you want.
Data Dolr_test;
format dolrs 15.2;
input Agent $ Dolrs;
datalines;
George 31918175.55
Adam 9013533.98
Danny 59407.72
;
run;
ods tagsets.excelxp file="/folders/myfolders/sample_out.xml" style=meadow;
proc report data=Dolr_test split='*';
column Agent Dolrs;
define Agent/ order order=data;
define Dolrs / " $ Dollars * (000)" FORMAT=15.2 style={tagattr="format:[$$-409]#,##0"};
run;
ods tagsets.excelxp close;
Yes, typo on my part here. The equals should be a colon:
Data Dolr_test; input Agent $ Dolrs 15.2; datalines; George 31918175.55 Adam 9013533.98 Danny 59407.72 ; run; ods tagsets.excelxp file = "s:\temp\rob\Dolr_test.xml" ; proc report data=Dolr_test split='*' ; column Agent Dolrs; define Agent/ order order=data; define Dolrs / " $ Dollars * (000)" style={tagattr="Format:[$$-409]#,##0"}; run; ods tagsets.excelxp close;
Thank you Reeza,RW9 & Cyntia for your patience and support.Sorry for getting back late
It worked and in the format the only modification was adding comma after the 0 in the format which worked.
style={tagattr="Format:[$$-409]#,##0,"}
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.