Hi,
I need someone to help me with the following....
Today I am using the following Syntax:
ods xml tagset=ExcelXP130
options(absolute_column_width = '15,15,15,15,15,15'
sheet_interval='None');
PROC REPORT DATA=if_unite_out_final
headline headskip norkeys missing nowindows;
COLUMN ("Final Report" category AMOUNT_ZERO_2 AMLA_ALL_2 AMLA_ALL_HASHKAL_2 ratio_aml_2) ;
DEFINE MON / order 'Date' format = mmyys7. ;
DEFINE category / display ' Category' format = cat_card.;
DEFINE AMOUNT_ZERO_2 / analysis 'Total Sum' format = COMMA20.2 style(column)={tagattr="format:###,##0.00" just=l};
DEFINE AMLA_ALL_2 / analysis 'Part' format = COMMA20.2 style(column)={tagattr="format:###,##0.00" just=l};
DEFINE AMLA_ALL_HASHKAL_2 / analysis 'Total include all' format = COMMA20.2 style(column)={tagattr="format:###,##0.00" just=l};
BREAK AFTER mon / SUMMARIZE UL OL style=[font_weight=bold];
compute after;
ORG = 999;
endcomp;
RUN;
I need the same output with the only difference that the field "MON" will be shown in each line. When I change "order" to "display" it does not give me the ability to summerize in the "MON" (month) level.
Anyone knows what can I do?
Thanks!
Try making another variable with the values of MON. Place it first in the Columns statement.
In the define make the new variable the ORDER variable with the option NOPRINT.
Make MON a display variable and change the Break After to use the new variable.
Here is a short example using data from the SASHELP.CLASS data set. I am using SEX in the role of your MON variable.
data work.class; set sashelp.class; og = sex; run; proc report data=work.class; columns og sex age height; define og /order noprint; define sex / display ; define age/ display; define height/analysis; break after og/summarize; run;
Great! Thank you!
I also need that the line of the summary will also include the value of the MON (in your example - the value of the sex 'F'/'M').
How can I do this?
Thanks!
Not sure, if i understood what you need. Do you need a list of all contributing class-values in the summary line?
Look at the example of sashelp.class.
the code "break after og/summarize;" gives me the summary of the sex.
Yet, in the output, in the line of the summary it is not written whether the summary is for 'F' of 'M'. only the sum is written.
I need that also the rellevant sex('F'/'M') will also appear in the line of the summary...
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.