Help using Base SAS procedures

help with simple formatting in proc tabulate

Reply
Contributor
Posts: 40

help with simple formatting in proc tabulate

I'm sure this should be simple and I just don't know the syntax.

I've managed to use proc tabulate to produce tables just the way we need them except that I need to round the N values to the nearest 10 and I'm not sure how to.

My table statement for proc tabulate is this:

table (sex all)*(l7drdays all),wt07*(age all)*pctsum (age all)*wt07 (age all)*n;

and I think I'll just need to add *f ='something' to the end of (age all)*n - I just don't know what the 'something' should be for this formatting. Would really appreciate it if someone could help!

Nicola
Respected Advisor
Posts: 3,887

Re: help with simple formatting in proc tabulate

Hi
Below the closest I could figure out.
HTH
Patrick


proc format;
picture r10x (round)
low-high = "00000009 D"(mult=0.1 )
;
run;

data have(keep=j);
do j=1 to 5;
x=ceil(ranuni(8)*100);
do i=1 to x;
output;
end;
end;
run;

title1 'unformatted values';
proc tabulate data=have ;
class j;
table j;
run;

title1 'rounded to the next 10';
proc tabulate data=have ;
class j;
table j *f=r10x.;
run;
Valued Guide
Posts: 2,174

Re: help with simple formatting in proc tabulate

use Patrick's technique, or adapt it, if O is close enough to 0 ;-)
proc format;
picture r10x (round)
low-high = "00000009O"(mult=0.1 )
;
run;
Ask a Question
Discussion stats
  • 2 replies
  • 443 views
  • 0 likes
  • 3 in conversation