Hello,
I am tyring to output the data, with one variable treated as group variable , using following codes, but somehow the group option does not work.
"define var_label/ display "Demographic and Clinical characteristics " spacing=0 group flow order;"
var_label
Gender, n(%)
Gender, n(%)
I would like to show one Gender, n(%) , but somehow, it still showes two.
proc REPORT data= _table_1 nowd headline missing nocenter spacing=0 ls=256 ps=1000 split='^' style(header)=[font_weight=bold just=center] style(column)=[just=center];
column vord rord var_label var_level _2007 _2008 _2009 _2010 _2011 _2012 _2013 _2014 Total ;
define vord/noprint order;
define rord/noprint order;
define var_label/ display "Demographic and Clinical characteristics " spacing=0 group flow order;
define var_level/display "" spacing=0 order;
define _2007/display "Index_year_2007 (N=&gp_2007)" width=18;
define _2008/display "Index_year_2008 (N=&gp_2008)" width=18;
define _2009/display "Index_year_2009 (N=&gp_2009)" width=18;
define _2010/display "Index_year_2010 (N=&gp_2010)" width=18;
define _2011/display "Index_year_2011 (N=&gp_2011)" width=18;
define _2012/display "Index_year_2012 (N=&gp_2012)" width=18;
define _2013/display "Index_year_2013 (N=&gp_2013)" width=18;
define _2014/display "Index_year_2014 (N=&gp_2014)" width=18;
define Total/display "Index_year_total (N=&gp_Total)" width=18;
title "Table 1. Baseline demographic and clinic characteristics ";
run;
quit;
Thank you,
Ivy
You have var_label listed twice - two define statements.
You're correct, I misread it.
I'm not familiar enough with Proc Report to help beyond this, especially without sample input data. I'm sure someone else will help.
It may help if you post an image of what you're getting and an example of what you want as well.
Good Luck.
Examples data;
Var_label var_level ..........................
Gender, n(%) Male
Gender, n(%) Female
Output table I want:
Var_label Var_level ........................
Gender, n(%) Male
Female
Thanks.
You define Var_label as both group and order. Try having it as just order.
Can't test without data but those sort of conflict and often the last option mentioned controls when conflicting.
You'd better post some data to let us test your code and reproduce the problem. And try compute block: compute var_label; if var_label ne lag(var_label) then call missing(var_label); endcomp;
That is reason why I ask OP to post data . We all just guessing. We don't know if GROUP could work or COMPUTE could work .
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.