The SAS Output Delivery System and reporting techniques

Problems with break after/compute after in Proc Report in ODS Excelxp tagset

Accepted Solution Solved
Reply
Contributor
Posts: 35
Accepted Solution

Problems with break after/compute after in Proc Report in ODS Excelxp tagset

[ Edited ]

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!

 

 


Accepted Solutions
Solution
‎02-01-2016 02:50 AM
Grand Advisor
Posts: 9,335

Re: Problems with break after/compute after in Proc Report in ODS Excelxp tagset

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;

View solution in original post


All Replies
Solution
‎02-01-2016 02:50 AM
Grand Advisor
Posts: 9,335

Re: Problems with break after/compute after in Proc Report in ODS Excelxp tagset

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;
Contributor
Posts: 35

Re: Problems with break after/compute after in Proc Report in ODS Excelxp tagset

Thanks a lot, that worked! 

Post a Question
Discussion Stats
  • 2 replies
  • 441 views
  • 0 likes
  • 2 in conversation