<?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 adding an extra line, how to fix it? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-compute-block-adding-an-extra-line-how-to-fix-it/m-p/929402#M83473</link>
    <description>&lt;P&gt;I think you may need this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/37/763.html" target="_self"&gt;Sample 37763: Conditionally print a LINE statement in PROC REPORT&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2024 14:15:37 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2024-05-23T14:15:37Z</dc:date>
    <item>
      <title>PROC REPORT compute block adding an extra line, how to fix it?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-compute-block-adding-an-extra-line-how-to-fix-it/m-p/929398#M83472</link>
      <description>&lt;P&gt;Hello SAS Community,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please anyone tell me why I'm getting an extra line of text when using &lt;STRONG&gt;compute before/after&amp;nbsp;&lt;/STRONG&gt;for 2 variables. Below is an example code.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input visit $ paramcd $ aval;
if find(paramcd, 'EQOL') gt 0 then gr=2;
else gr=1; 
cards;
Screen EQOL0101 2
Screen EQOL0102 4
Screen EQOL0103 3
Screen EQOL0104 1
Screen EQOL0105 2
Screen PGIS	2
Screen CGIS 3
Week4 EQOL0101 2
Week4 EQOL0102 4
Week4 EQOL0103 3
Week4 EQOL0104 1
Week4 EQOL0105 2
Week4 PGIS	1
Week4 CGIS 2
Week4 PGIC	1
Week4 CGIC 2
Week8 EQOL0101 2
Week8 EQOL0102 4
Week8 EQOL0103 3
Week8 EQOL0104 1
Week8 EQOL0105 2
Week8 PGIS	1
Week8 CGIS 2
Week8 PGIC	1
Week8 CGIC 2
;
run; 

proc report data=have;
	column visit gr paramcd aval;
	define visit/ order noprint;
	define gr/ order noprint;
	define paramcd/ 'Item' display;
	define aval/'Value' display;
	compute before visit/style={just=c};
		line @1 text $40.;
		length text $40;
		if visit='Screen' then text='Screening';
		else if visit='Week4' then text= 'Week 4';
		else if visit='Week8' then text='Week 8';
	endcomp;
	compute before gr;
		line @1 text $40.;
		length text $40;
		if gr=2 then text='EQ-5D-5L';
	endcomp; 
run; 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 615px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96690i0B5252C932A0CA42/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 13:29:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-compute-block-adding-an-extra-line-how-to-fix-it/m-p/929398#M83472</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2024-05-23T13:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT compute block adding an extra line, how to fix it?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-compute-block-adding-an-extra-line-how-to-fix-it/m-p/929402#M83473</link>
      <description>&lt;P&gt;I think you may need this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/37/763.html" target="_self"&gt;Sample 37763: Conditionally print a LINE statement in PROC REPORT&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 14:15:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-compute-block-adding-an-extra-line-how-to-fix-it/m-p/929402#M83473</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2024-05-23T14:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT compute block adding an extra line, how to fix it?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-compute-block-adding-an-extra-line-how-to-fix-it/m-p/929496#M83475</link>
      <description>&lt;P&gt;You used TWO 'line' statement in two different computed blocks. Just combine these two computed blocks into ONE .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc report data=have;
	column visit gr paramcd aval;
	define visit/ order noprint;
	define gr/ order noprint;
	define paramcd/ 'Item' display;
	define aval/'Value' display;
	compute before gr;
		line @1 text $40.;
		length text $40;

		if visit='Screen' then text='Screening';
		else if visit='Week4' then text= 'Week 4';
		else if visit='Week8' then text='Week 8';

		if gr=2 then text='EQ-5D-5L';
	endcomp; 
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 May 2024 01:48:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-compute-block-adding-an-extra-line-how-to-fix-it/m-p/929496#M83475</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-05-24T01:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT compute block adding an extra line, how to fix it?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-compute-block-adding-an-extra-line-how-to-fix-it/m-p/929607#M83476</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;BR /&gt;Thank you for the suggestion. Interesting, VISIT is also a grouping variable that is handled inside another grouping variable GR. This eliminated the unnecessary extra row. Could we also keep the original justification of text in the report?&amp;nbsp; VISITs are centered, GR is left justified. I tried with ods escapechar style elements, it didn't help.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods escapechar='~';
proc report data=have;
	column visit gr paramcd aval;
	define visit/ order noprint;
	define gr/ order noprint;
	define paramcd/ 'Item' display;
	define aval/'Value' display;
	compute before gr/style={just=c};
		line @1 text $40.;
		length text $40;

		if visit='Screen' then text='Screening';
		else if visit='Week4' then text= 'Week 4';
		else if visit='Week8' then text='Week 8';

		if gr=2 then text="~S={just=left} EQ-5D-5L";
	endcomp; 
run; 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 May 2024 15:02:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-compute-block-adding-an-extra-line-how-to-fix-it/m-p/929607#M83476</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2024-05-24T15:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT compute block adding an extra line, how to fix it?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-compute-block-adding-an-extra-line-how-to-fix-it/m-p/929668#M83478</link>
      <description>&lt;P&gt;Or you could try data _null_; suggest to use format $varying.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;


proc report data=have nowd;
	column visit gr paramcd aval;
	define visit/ order noprint;
	define gr/ order noprint;
	define paramcd/ 'Item' display;
	define aval/'Value' display;
	compute before visit/style={just=c};
		line @1 text $40.;
		length text $40;
		if visit='Screen' then text='Screening';
		else if visit='Week4' then text= 'Week 4';
		else if visit='Week8' then text='Week 8';
	endcomp;
	compute before gr;
		line @1 text $varying40. len;
		length text $ 40;
		len=0;
		if gr=2 then do;len=10;text='EQ-5D-5L';end;
	endcomp; 
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1716617320523.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96764i83B8304DC0A0F72E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1716617320523.png" alt="Ksharp_0-1716617320523.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 May 2024 07:08:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-compute-block-adding-an-extra-line-how-to-fix-it/m-p/929668#M83478</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-05-25T07:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT compute block adding an extra line, how to fix it?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-compute-block-adding-an-extra-line-how-to-fix-it/m-p/929977#M83494</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp; for taking the time to look into the documentation and applying $varying format in my example.!&lt;BR /&gt;&lt;BR /&gt;Very grateful to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;&amp;nbsp;for the precious tips and guidance!&lt;BR /&gt;&lt;BR /&gt;Appreciate your help, guys!&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 13:21:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-REPORT-compute-block-adding-an-extra-line-how-to-fix-it/m-p/929977#M83494</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2024-05-28T13:21:42Z</dc:date>
    </item>
  </channel>
</rss>

