| number | year1 | year2 | year3 | year4 |
| Males | 6,621 | 7,076 | 7,194 | 7,135 |
| Females | 5,047 | 5,530 | 5,426 | 5,495 |
| Persons(d) | 11,668 | 12,606 | 12,620 | 12,630 |
| Rate | ||||
| Males | 2.3 | 2.4 | 2.2 | 2.4 |
| Females | 2.0 | 2.0 | 2.2 | 2.3 |
| Persons(d) | 2.1 | 2.2 | 2.2 | 2.3
|
How should I format the output?
proc report nowd data=sashelp.class;
col name sex age weight height;
compute height;
if sex='F' then do;
do i = 3 to 5;
call define(i,'format','dollar8.2');
end;
end;
endcomp;
run;
I *think* you can add a grouping variable and then conditionally format the lines using a COMPUTE statement.
@walterwang wrote:
number year1 year2 year3 year4 Males 6,621 7,076 7,194 7,135 Females 5,047 5,530 5,426 5,495 Persons(d) 11,668 12,606 12,620 12,630 Rate Males 2.3 2.4 2.2 2.4 Females 2.0 2.0 2.2 2.3 Persons(d) 2.1 2.2 2.2 2.3
How should I format the output?
proc report nowd data=sashelp.class;
col name sex age weight height;
compute height;
if sex='F' then do;
do i = 3 to 5;
call define(i,'format','dollar8.2');
end;
end;
endcomp;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.