BookmarkSubscribeRSS Feed
LB
Quartz | Level 8 LB
Quartz | Level 8

Hi all;

Been awhile since I have used proc reporting/ODS  -so a little rusty.  This is a general question  so no data provided -

In short I have code that works for the most part -however I have a value  below-P_PCHI

If  put at the end (as below) it does not group per se

(See top pic in  document)  

 

However if I put it after another category that is grouped (category_ods)

It does group properly-just not where I want to place it. Is there a way to put it at the end where I want it or do I need to place it with other grouped variables-Thanks

 

 


proc report data= ODS_out   headline headskip nowd spanrows
style (column)={background=white  just=center color=black font =("arial",7.5pt)}
style (header)={background=#d4af37  just=center color=black font =("arial",8.0pt)};

columns cat_order category_ods  P_PCHI (GROUPING WORKS)  order1 cat2 &typ1._type &typ2._type P_PCHI ( GROUPING DOES NOT WORK) ;
define cat_order/order noprint ;
define category_ods/group "Table 1. Baseline Characteristics" format=$ODS. width=35;
define order1/order noprint;
define cat2/ ' ';

define &typ1._type/"&typ1/(&ct1)";
define &typ2._type/"&typ2/(&ct2)";
define P_PCHI/order group "P*";
run;

 

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

Hi:
Unfortunately, it's hard to comment without data. I do see an issue with your define statement you have "order group" which is unnecessary. GROUP is what you want, I think. And, your macro variables do not have a usage, so my guess is that they are character values and their usage is display by default. But even so, if I try what I think you want using SASHELP.CLASS I don't see the same behavior that you report.

Here's what I mean:

Cynthia_sas_0-1634661234632.png

 

Even when I move AGE to the far right as a GROUP item, PROC REPORT still does spanning rows and grouping.

You might want to try opening a track with Tech Support so they can look at ALL your data, ALL your code, including macro variables and NOPRINT items and see if they can help you.
Cynthia

LB
Quartz | Level 8 LB
Quartz | Level 8

Thanks Cynthia. 

Unfortunately  due to the way that the data is combined, it is displayed per se -that is n=x (%) 

ie 25,121 (23%)   so there is no summation being done by proc report. 

This was more of a general question.  

 

Thanks for your time.  I can see what tech support can do.

Best, 

 

 

 

ballardw
Super User

You are using a custom format for the variable of interest: category_ods  with the format $ODS.

"group" variables basically define a group for values of analysis variables in columns following (to the right). So I am not sure what you want with a group variable at the end.

 

IF you don't want to share your data then use one of the SAS data sets to show something similar.

 

From your images in the document I can't tell what you want. A small example data set along with the desired expected output is helpful.

 

I might guess that you do not mean "group" but "I want to display a single value that spans multiple rows as the last column". If that is the case then please say so. At which point we may get into a lot of odd style overrides or similar and possibly restructuring the data set a bit.

LB
Quartz | Level 8 LB
Quartz | Level 8

Fair enough not providing data.  

This  was more of a general question.   But Cynthia demonstrated to me that the issue is not with ODS limitations but rather my data is the problem . I will see if I can use the sashelp.class data to recreate the data and can I replicate the issue. 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 628 views
  • 0 likes
  • 3 in conversation