BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Hank
Fluorite | Level 6

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!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

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

2 REPLIES 2
Ksharp
Super User

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;
Hank
Fluorite | Level 6

Thanks a lot, that worked! 

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1640 views
  • 0 likes
  • 2 in conversation