Hi: Tom is correct about the syntax of your IF statement. That would have to change. Also, the CALL DEFINE statement for FORMAT assumes that the variable CDE is numeric. If CDE is character, then you would need to turn the character string into a number (using the INPUT function) before applying a numeric format. cynthia Added: And, as much as I like PROC REPORT, this is one of those instances where PROC TABULATE might be a better choice, because you can get multiple statistics in the row dimension and then apply different formats to each statistic. This also means that you would not have to pre-summarize your data, but could, for example, get the N and the PCTN directly from the detail data. For example, SASHELP.CLASS has 19 total observations, 10 boys and 9 girls. It is possible to use TABULATE directly on SASHELP.CLASS to get the report you want. The PROC FORMAT step creates a PICTURE format, which you need because when TABULATE calculates PCTN, it does an automatic multiply by 100, and that means you can't use a regular SAS format because the PERCENT format also does a multiply by 100. This code produced the attached screen shot (results opened in Excel 2010). proc format; picture pct low-high='009.99%'; run; ods tagsets.excelxp file='c:\temp\use_tabulate.xml' style=sasweb; proc tabulate data=sashelp.class; class sex; table sex=' '*(n*f=comma9. pctn*f=pct.) all*(n*f=comma9. pctn*f=pct.), all='Statistics' /row=float box=sex; label sex='Gender'; run; ods _all_ close; Edited message to add TABULATE example
... View more