Hi!
Im using SAS 9.4 and trying to do an proc report but can´t get the last finished touch to it. It seems as if there is a lot on this subjects, but none of the solutions I have tried has worked. All variables except for var0 and grp are numeric. The xml/xlsx-output is attached.
In short;
I have 2 groups of data (0 & 1). Between them I want first some space (i.e. an empty line) then a title above the next group. That is what I try to do in the code below with the "compute after grp" part of the code. For this reason I created the "grp"-variable (values 0 & 1) that does not show, and should not show, in the final report. But I haven´t fully grasped the "break", "rbreak", "compute after" code, because in my attempts I keep getting the empty line & a title between grp 0 and 1 AND BELOW GROUP 1. But I only want it between groups 0 and 1. Any suggestions on how to rewrite the code?
The code:
ods html;
ods _all_ close;
ODS NORESULTS;
ods tagsets.ExcelXP path='C:\Users\user\Desktop\testing' file='testfile.xml'
style=printer;
/*my proc code is here*/
compute after grp / style=[background=lightgray font_weight=bold];
if grp='0' then do;
line ' ';
line 'next_group';
end;
endcomp;
run; title1; title2; title3; title4; quit;
ods tagsets.excelxp close;
Many thanks for any suggestions & solutions!
Best regards!
I have no time to test your code , just some advice . and post a picture to explain your question, That would be better.
compute after grp / style=[background=lightgray font_weight=bold];
x='next_group';
if grp='0' then len=20;
else len=0;
line x $varying20. len ;
endcomp;
I have no time to test your code , just some advice . and post a picture to explain your question, That would be better.
compute after grp / style=[background=lightgray font_weight=bold];
x='next_group';
if grp='0' then len=20;
else len=0;
line x $varying20. len ;
endcomp;
Thanks a lot, that worked!
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.