Marc Weinmann
2008-10-07 13:25:23 UTC
Hi all.
I have a dataset that has 12 numeric fields (among others) that I
would my sums made with proc means to use commas for thousands,
millions, billions, etc. The actual output of my proc means statement
is not using comma formatting, but as written the code compiles/runs
fine.
I tried putting the format statement within my Data step, that works,
but has no affect on the proc means statement. I can tell it works in
an execution sense from proc contents. I tried as below to put the
format in my proc means statement, that too seems to run fine but does
not format the output with commas.
I need a clue if I am trying to do the impossible or missing a simple
concept. How can I format the output of a proc means to use commas and
not have any fractional decimal amounts?
Thanks
Marc
proc means print data=LocData sum;
var RepValBldg RepValOstr RepValCont RepValTime
LimitValBldg LimitValOstr LimitValCont LimitValTime
Ded1 Ded2 Ded3 Ded4;
format RepValBldg RepValOstr RepValCont RepValTime
LimitValBldg LimitValOstr LimitValCont LimitValTime
Ded1 Ded2 Ded3 Ded4 comma16.;
run;
Snippet showing I had successfully set the format on the dataset (output
of proc contents)
20 RepValBldg Num 8 COMMA16.
22 RepValCont Num 8 COMMA16.
21 RepValOstr Num 8 COMMA16.
23 RepValTime Num 8 COMMA16.
My proc means output (without commas)
The MEANS Procedure
Variable Sum
----------------------------
RepValBldg 504885
RepValOstr 5197789
RepValCont 35976020
RepValTime 207403.00
LimitValBldg 5045885
LimitValOstr 5196789
LimitValCont 34576020
LimitValTime 7068562
Ded1 647801
Ded2 0
Ded3 0
Ded4 0
----------------------------
I have a dataset that has 12 numeric fields (among others) that I
would my sums made with proc means to use commas for thousands,
millions, billions, etc. The actual output of my proc means statement
is not using comma formatting, but as written the code compiles/runs
fine.
I tried putting the format statement within my Data step, that works,
but has no affect on the proc means statement. I can tell it works in
an execution sense from proc contents. I tried as below to put the
format in my proc means statement, that too seems to run fine but does
not format the output with commas.
I need a clue if I am trying to do the impossible or missing a simple
concept. How can I format the output of a proc means to use commas and
not have any fractional decimal amounts?
Thanks
Marc
proc means print data=LocData sum;
var RepValBldg RepValOstr RepValCont RepValTime
LimitValBldg LimitValOstr LimitValCont LimitValTime
Ded1 Ded2 Ded3 Ded4;
format RepValBldg RepValOstr RepValCont RepValTime
LimitValBldg LimitValOstr LimitValCont LimitValTime
Ded1 Ded2 Ded3 Ded4 comma16.;
run;
Snippet showing I had successfully set the format on the dataset (output
of proc contents)
20 RepValBldg Num 8 COMMA16.
22 RepValCont Num 8 COMMA16.
21 RepValOstr Num 8 COMMA16.
23 RepValTime Num 8 COMMA16.
My proc means output (without commas)
The MEANS Procedure
Variable Sum
----------------------------
RepValBldg 504885
RepValOstr 5197789
RepValCont 35976020
RepValTime 207403.00
LimitValBldg 5045885
LimitValOstr 5196789
LimitValCont 34576020
LimitValTime 7068562
Ded1 647801
Ded2 0
Ded3 0
Ded4 0
----------------------------