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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.