Hi,
When I run the following code I get an empty blue box under the smoking status values. Does anyone know how I can adapt my code to remove this box so "Heavy (16-25)" and the other values are on the same line as status2, sex2 and bpstatus2?
Thanks,
data merged;
set sashelp.heart;
run;
proc report data=Merged split='~' nowd ;
column status status2 sex sex2 bp_status bp_status2 Smoking_Status,(MRW);
define Smoking_Status / Across;
define status / Group noprint;
define sex / Group noprint;
define bp_status / Group noprint;
define MRW / sum '';
define status2 / computed;
define sex2 / computed;
define bp_status2 / computed;
compute before bp_status;
_status=status;
_sex=sex;
_bp_status=bp_status;
endcomp;
compute status2/character length=40;
status2=_status;
endcomp;
compute sex2/character length=40;
sex2=_sex;
endcomp;
compute bp_status2/character length=40;
bp_status2=_bp_status;
endcomp;
run;
Change the order of variables in the COLUMN statement:
column status status2 sex sex2 bp_status bp_status2 MRW,Smoking_Status;
Or to use an even simpler example:
proc report data=Merged split='~' nowd ;
column status sex bp_status Smoking_Status,(MRW);
define Smoking_Status / Across;
define status / Group;
define sex / Group;
define bp_status / Group;
define MRW / sum '';
run;
The same holds true here too with the empty box in the results table.
Interesting, the whole table-header looks disgusting. The empty cell is cause by removing the label / variable name in the "define mrw" statement. It looks as if the number of empty cells for the status, sex and bp_status are calculated ignoring that mrw should not have a title.
Sounds like a task for tech support.
Change the order of variables in the COLUMN statement:
column status status2 sex sex2 bp_status bp_status2 MRW,Smoking_Status;
I have found it always better to place the "acrossed" variable(s) before the ACROSS variable.
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.