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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 2 replies
  • 1271 views
  • 0 likes
  • 2 in conversation