Hello,
I have a report where I have introduced one blank line after each section, however my last observation crosses the next page because of the empty line the report adds after that last observation.
Practically my last observation is the last section and now I am left with 1 row on the second page
Is there a way to condition this compute after, for it not to compute after the last observation?
compute after group;
line @1 "";
endcomp;
I've tried writing the number of observations (which is 26) in my dataset, and using it as a macro variable but now the whole empty line disappears, something like this.
%if &nobs. lt 26 %then %do;
compute after group;
line @1 "";
endcomp;
%end;
Thank you!
Diana
As a minimum share the entire Procedure code. Interactions of options and define are needed.
Best is to copy your entire procedure code and then paste it into text or code box opened on the forum with the </> or "running man" icons that appear above the message window.
The message windows on this forum will reformat pasted text and sometimes result in code that will not run because of inserted HTML character. Plus the box makes it clearer which is code and which is question. An example:
Proc print data=sashelp.class noobs; var name age; run;
As a minimum share the entire Procedure code. Interactions of options and define are needed.
Best is to copy your entire procedure code and then paste it into text or code box opened on the forum with the </> or "running man" icons that appear above the message window.
The message windows on this forum will reformat pasted text and sometimes result in code that will not run because of inserted HTML character. Plus the box makes it clearer which is code and which is question. An example:
Proc print data=sashelp.class noobs; var name age; run;
Hello,
Thank you for the reply.
I am working on sensitive data and with a lot of internal macros I can't share and I was trying to avoid having to blind the information, thought my question was clear, I apologize 🙂
Please see below the output dataset, I need one empty line in the RTF report after each GROUP value, except for the last value, so no empty line after GROUP=7.
Please note nothing can be changed to the page layout, it's a standard and I can't update the widths for anything related to the footers and titles.
Hope this is enough, if not I will remove the question since I can't add anything more.
Thankyou
Diana
/*
You could remove the last blank row by format $varying.
Like this:
*/
ods rtf file='c:\temp\temp.rtf';
proc report data=sashelp.class nowd;
define name/display;
define age/group;
compute before age;
n+1;
if n=1 then len=0;
else len=20;
x=' ';
line x $varying20. len;
endcomp;
run;
ods rtf close;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.