<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Proc report compute block - create a blank line except the last in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984864#M84134</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/480815"&gt;@TK12&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;(...) adding "&lt;SPAN&gt;@R/RTF'\fs8&lt;/SPAN&gt;" to text doesnt seem to work&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Have you tried using style attributes rather than raw RTF specifications?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;ods rtf file='C:\Temp\test_report.rtf' style=default;

&lt;FONT color="#999999"&gt;proc report data=have;
column name ord;
define ord / order;
compute after ord&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt; / style(lines)={font_size=5pt}&lt;/STRONG&gt;&lt;/FONT&gt;;
  text=' ';
  len=(ord ne 3);
  line text $varying. len;
endcomp;
run;&lt;/FONT&gt;

ods rtf close;&lt;/PRE&gt;
&lt;P&gt;I have used &lt;STRONG&gt;5&lt;/STRONG&gt;pt to make the height difference more obvious:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test_report.png" style="width: 119px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113658iEEC5A7B4375329EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="test_report.png" alt="test_report.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Mar 2026 12:16:51 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2026-03-17T12:16:51Z</dc:date>
    <item>
      <title>Proc report compute block - create a blank line except the last</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984756#M84121</link>
      <description>&lt;P&gt;Hello, i have a question&amp;nbsp; regarding proc report to oinsert empty line;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;example dataset below&lt;/P&gt;&lt;P&gt;name, ord&lt;BR /&gt;jame, 1&lt;/P&gt;&lt;P&gt;kev, 1&lt;/P&gt;&lt;P&gt;ann, 2&lt;/P&gt;&lt;P&gt;liz, 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if i use below, it will create empty like after every new ord, but i dont want the blank row after ord=3&lt;BR /&gt;&lt;BR /&gt;compute after ord;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;line "";&lt;BR /&gt;endcomp;&lt;BR /&gt;&lt;BR /&gt;i tried using a conditional stqatement like below, but it jsut get ignore?&lt;BR /&gt;&lt;BR /&gt;compute after ord;&lt;BR /&gt;&amp;nbsp; if ord ne 3 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; line "";&lt;/P&gt;&lt;P&gt;end;&lt;BR /&gt;endcomp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;any idea?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2026 14:59:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984756#M84121</guid>
      <dc:creator>TK12</dc:creator>
      <dc:date>2026-03-13T14:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report compute block - create a blank line except the last</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984762#M84122</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/480815"&gt;@TK12&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LINE statements in COMPUTE blocks are executed after all other statements. This is why your conditional approach fails.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you can use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n0gyd5fptpa0ufn100pj7ghozy6i.htm" target="_blank" rel="noopener"&gt;$VARYING&lt;EM&gt;w&lt;/EM&gt;. format&lt;/A&gt;&amp;nbsp;with a length variable whose value is assigned conditionally:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input name $ ord;
cards;
jame 1
kev 1
ann 2
liz 3
;

proc report data=have;
column name ord;
define ord / order;
compute after ord;
  text=' ';
  len=(ord ne 3);
  line text $varying. len;
endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The assignment statement&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;len=(ord ne 3);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is just a shorthand for&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if ord ne 3 then len=1; else len=0;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;With &lt;FONT face="courier new,courier"&gt;len=0&lt;/FONT&gt; the space character in temporary variable &lt;FONT face="courier new,courier"&gt;text&lt;/FONT&gt; is not written, i.e., no blank line occurs.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2026 15:49:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984762#M84122</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2026-03-13T15:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report compute block - create a blank line except the last</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984766#M84123</link>
      <description>&lt;A href="https://support.sas.com/kb/37/763.html" target="_blank"&gt;https://support.sas.com/kb/37/763.html&lt;/A&gt;</description>
      <pubDate>Fri, 13 Mar 2026 16:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984766#M84123</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2026-03-13T16:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report compute block - create a blank line except the last</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984813#M84124</link>
      <description>&lt;P&gt;Thanks that solve the issue, but is there a way to change the text size(to change line height)?&amp;nbsp;&lt;/P&gt;&lt;P&gt;with line, i can do line "@R/RTF'\fs5"; to change how tall the row is. but that doesnt work here&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2026 14:45:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984813#M84124</guid>
      <dc:creator>TK12</dc:creator>
      <dc:date>2026-03-16T14:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report compute block - create a blank line except the last</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984814#M84125</link>
      <description>&lt;DIV&gt;nvm figured it out; below works&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;compute after ord;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; text="";&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; len=(ord ne 3);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; line "@R/RTF'\fs8" text $varying. len;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;endcomp;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 16 Mar 2026 15:00:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984814#M84125</guid>
      <dc:creator>TK12</dc:creator>
      <dc:date>2026-03-16T15:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report compute block - create a blank line except the last</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984816#M84126</link>
      <description>nvm it doesnt work</description>
      <pubDate>Mon, 16 Mar 2026 15:06:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984816#M84126</guid>
      <dc:creator>TK12</dc:creator>
      <dc:date>2026-03-16T15:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report compute block - create a blank line except the last</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984828#M84127</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/480815"&gt;@TK12&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;DIV&gt;nvm figured it out; below works&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;compute after ord;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; text="";&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; len=(ord ne 3);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; line "@R/RTF'\fs8" text $varying. len;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;endcomp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That will always write a line because you included a string literal in the LINE statement.&lt;/P&gt;
&lt;P&gt;You need to write ZERO bytes in the LINE statement for PROC REPORT to not produce a line.&lt;/P&gt;
&lt;P&gt;I am not sure what you want to do but if the goal is to either write&amp;nbsp;"@R/RTF'\fs8" or not have a line at all you need to do something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;compute after ord;
&amp;nbsp; text="@R/RTF'\fs8";
&amp;nbsp; len=(ord ne 3)*length(text);
&amp;nbsp; line  text $varying. len;
endcomp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So when ORD is 3 then LEN is set to ZERO. Otherwise LEN is set to the length of TEXT.&lt;/P&gt;
&lt;P&gt;Perhaps it would be clearer to do it this way.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;compute after ord;
  if ord eq 3 then &amp;nbsp;text="@R/RTF'\fs8";
  else text=" ";
&amp;nbsp; len=lengthN(text);
&amp;nbsp; line text $varying. len;
endcomp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The newish LENGTHN() function gets the length of string ignoring the ALL of the trailing spaces.&amp;nbsp; So a string with only spaces will have a length of zero instead of the length of one that the older LENGTH() function calculates.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2026 16:24:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984828#M84127</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-03-16T16:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report compute block - create a blank line except the last</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984859#M84133</link>
      <description>&lt;P&gt;Thanks, what i am trying to do is&lt;BR /&gt;1 create blank line after each ord, except&amp;nbsp; the last one.&lt;BR /&gt;2. i need change the blank lines to smaller height, to fit the report into one page. (thats the reason i didnt want to extra blank at the end to save space );&lt;BR /&gt;&lt;BR /&gt;For example, below code works to change the line height to font size 8, but adding "&lt;SPAN&gt;@R/RTF'\fs8&lt;/SPAN&gt;" to text doesnt seem to work&lt;/P&gt;&lt;P&gt;compute after ord;&lt;BR /&gt;&amp;nbsp; if ord ne 3 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; line "&lt;SPAN&gt;@R/RTF'\fs8&lt;/SPAN&gt;";&lt;/P&gt;&lt;P&gt;end;&lt;BR /&gt;endcomp&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 09:07:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984859#M84133</guid>
      <dc:creator>TK12</dc:creator>
      <dc:date>2026-03-17T09:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report compute block - create a blank line except the last</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984864#M84134</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/480815"&gt;@TK12&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;(...) adding "&lt;SPAN&gt;@R/RTF'\fs8&lt;/SPAN&gt;" to text doesnt seem to work&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Have you tried using style attributes rather than raw RTF specifications?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;ods rtf file='C:\Temp\test_report.rtf' style=default;

&lt;FONT color="#999999"&gt;proc report data=have;
column name ord;
define ord / order;
compute after ord&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt; / style(lines)={font_size=5pt}&lt;/STRONG&gt;&lt;/FONT&gt;;
  text=' ';
  len=(ord ne 3);
  line text $varying. len;
endcomp;
run;&lt;/FONT&gt;

ods rtf close;&lt;/PRE&gt;
&lt;P&gt;I have used &lt;STRONG&gt;5&lt;/STRONG&gt;pt to make the height difference more obvious:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test_report.png" style="width: 119px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113658iEEC5A7B4375329EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="test_report.png" alt="test_report.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 12:16:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984864#M84134</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2026-03-17T12:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report compute block - create a blank line except the last</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984867#M84135</link>
      <description>thanks, that works!!</description>
      <pubDate>Tue, 17 Mar 2026 13:51:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-report-compute-block-create-a-blank-line-except-the-last/m-p/984867#M84135</guid>
      <dc:creator>TK12</dc:creator>
      <dc:date>2026-03-17T13:51:06Z</dc:date>
    </item>
  </channel>
</rss>

