Hi, I have an issue while applying multiple formats based on the variable values. I saw previous posts, but it was not helpful for me. Mistake might be from my end while applying proper formats. Please help me how to resolve this issue.
INPUT DATA:
============
TYPE TOTALS
A 39442499
B 828727452.170335
B 519125592.249982
B 1491576104.14236
B 31241133938.0128
C 2026005
C 2949321.99999995
REQUIRED OUTPUT:
================
TYPE TOTALS
A 39,442,499
B $8,28,727,452.17
B $ 519,125,592.25
B $1,491,576,104.14
B $31,241,133,938.01
C 2,026,005
C 2,949,322
I tried the code as below but I am getting missing values under totals variable in excel sheet.
ods tagsets.excelxp file='C:\Test\test.xls' style=sasweb;
proc report data=sum nowd;
Column TYPE TOTALS;
define TYPE/ display style(column)={just=l};
define TOTALS/computed style(column)={just=l};
compute TOTALS;
if x='B' then do;
*call define(_col_,'format','dollar19.2');
call define(_col_,'style','style={tagattr="Format:$#,##0.00"}');
end;
else do;
*call define(_col_,'format','comma12.');
call define(_col_,'style','style={tagattr="Format:#,###"}');
end;
endcomp;
run;
ods _all_ close;
PLEASE HELP ME ON THIS. THANKS IN ADVANCE.
... View more