<?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 Text Lines and Indentation in PROC REPORT in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Text-Lines-and-Indentation-in-PROC-REPORT/m-p/649348#M194653</link>
    <description>&lt;P&gt;I have a data table which is already aggregated the way I want it for PROC REPORT.&amp;nbsp; I am only using PROC REPORT for the formatting and overall appearance of the report itself.&amp;nbsp; Below is my code.&amp;nbsp; Row is simply the row number in the table and is not outputted, Name is a descriptive text field, and the other fields are numeric values.&amp;nbsp; There are 35 rows of data in the input data set.&amp;nbsp; In the report,&amp;nbsp; &amp;nbsp;I want to add a Line of text after row 5, after row 12 and after row 33 (say: "GROUP A", "GROUP B", "GROUP C" respectively).&amp;nbsp; I want the lines of text to stretch across all columns.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to successfully format rows as either percents, dollars, or numeric comma formats.&amp;nbsp; However, I cannot find any formatting scheme for indentation of the values in the cells.&amp;nbsp; I want this formatting to apply to all displayed columns (NAME, COL1, COL2, COL3, COL4).&amp;nbsp; I want 3 levels of indentation: 1 where the number value is all the way to the left of the cell, another which is spaced a little more to the right, and another spaced a little more to the right from that.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=FINAL_Table
  STYLE(report)=[frame=box rules=cols]
     style(header)={borderbottomwidth=2pt borderbottomcolor=black};
column row NAME  COL1 COL2 COL3 COL4;


define row /order order =data noprint;
define Name/display style(column)={borderrightcolor=black borderrightwidth=3};
define COL1/display style(column)={borderrightcolor=black borderrightwidth=3};
define COL2/display style(column)={borderrightcolor=black borderrightwidth=3};
define COL3/display style(column)={borderrightcolor=black borderrightwidth=3};
define COL4/display style(column)={borderrightcolor=black borderrightwidth=3};

compute COL4;
      if row = 5 then do;
         do i = 3 to 6; 
            call define(i,'format','PERCENT8.1'); 
         end;
end; 
	  if row &amp;lt; 5 then do;
         do i = 3 to 6; 
            call define(i,'format','Comma12.0'); 
         end;
		 end;
      if row &amp;gt;5 then do;
         do i = 3 to 6; 
            call define(i,'format','DOLLAR12.2'); 
         end; 
		 end;
     
   endcomp;

run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 20 May 2020 19:01:18 GMT</pubDate>
    <dc:creator>RandoDando</dc:creator>
    <dc:date>2020-05-20T19:01:18Z</dc:date>
    <item>
      <title>Text Lines and Indentation in PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Text-Lines-and-Indentation-in-PROC-REPORT/m-p/649348#M194653</link>
      <description>&lt;P&gt;I have a data table which is already aggregated the way I want it for PROC REPORT.&amp;nbsp; I am only using PROC REPORT for the formatting and overall appearance of the report itself.&amp;nbsp; Below is my code.&amp;nbsp; Row is simply the row number in the table and is not outputted, Name is a descriptive text field, and the other fields are numeric values.&amp;nbsp; There are 35 rows of data in the input data set.&amp;nbsp; In the report,&amp;nbsp; &amp;nbsp;I want to add a Line of text after row 5, after row 12 and after row 33 (say: "GROUP A", "GROUP B", "GROUP C" respectively).&amp;nbsp; I want the lines of text to stretch across all columns.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to successfully format rows as either percents, dollars, or numeric comma formats.&amp;nbsp; However, I cannot find any formatting scheme for indentation of the values in the cells.&amp;nbsp; I want this formatting to apply to all displayed columns (NAME, COL1, COL2, COL3, COL4).&amp;nbsp; I want 3 levels of indentation: 1 where the number value is all the way to the left of the cell, another which is spaced a little more to the right, and another spaced a little more to the right from that.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=FINAL_Table
  STYLE(report)=[frame=box rules=cols]
     style(header)={borderbottomwidth=2pt borderbottomcolor=black};
column row NAME  COL1 COL2 COL3 COL4;


define row /order order =data noprint;
define Name/display style(column)={borderrightcolor=black borderrightwidth=3};
define COL1/display style(column)={borderrightcolor=black borderrightwidth=3};
define COL2/display style(column)={borderrightcolor=black borderrightwidth=3};
define COL3/display style(column)={borderrightcolor=black borderrightwidth=3};
define COL4/display style(column)={borderrightcolor=black borderrightwidth=3};

compute COL4;
      if row = 5 then do;
         do i = 3 to 6; 
            call define(i,'format','PERCENT8.1'); 
         end;
end; 
	  if row &amp;lt; 5 then do;
         do i = 3 to 6; 
            call define(i,'format','Comma12.0'); 
         end;
		 end;
      if row &amp;gt;5 then do;
         do i = 3 to 6; 
            call define(i,'format','DOLLAR12.2'); 
         end; 
		 end;
     
   endcomp;

run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 May 2020 19:01:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Text-Lines-and-Indentation-in-PROC-REPORT/m-p/649348#M194653</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-05-20T19:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Text Lines and Indentation in PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Text-Lines-and-Indentation-in-PROC-REPORT/m-p/649363#M194661</link>
      <description>&lt;P&gt;Use LEFT option in column definition, and&amp;nbsp;the PRETEXT= style attribute in the style.&amp;nbsp; The pretext will be hard spaces ("A0"x lead).&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;define COL1/display style(column)={borderrightcolor=black borderrightwidth=3} LEFT;
define COL2/display style(column)={borderrightcolor=black borderrightwidth=3 pretext="A0A0A0"x} LEFT;
define COL3/display style(column)={borderrightcolor=black borderrightwidth=3 pretext="A0A0A0A0A0A0"x} LEFT;
define COL4/display style(column)={borderrightcolor=black borderrightwidth=3 pretext="A0A0A0A0A0A0A0A0A0"x} LEFT;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also set the pretext conditionally in the compute block with CALL DEFINE(&lt;EM&gt;col,&amp;nbsp;&lt;/EM&gt;'STYLE', ...).&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;call define (4, 'style', 'style=[pretext="A0A0A0"x]');  * lead cell value with 3 hard spaces;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 May 2020 19:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Text-Lines-and-Indentation-in-PROC-REPORT/m-p/649363#M194661</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-05-20T19:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Text Lines and Indentation in PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Text-Lines-and-Indentation-in-PROC-REPORT/m-p/649368#M194663</link>
      <description>I want the indentation formatting to be by specific rows, not columns.&lt;BR /&gt;</description>
      <pubDate>Wed, 20 May 2020 19:53:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Text-Lines-and-Indentation-in-PROC-REPORT/m-p/649368#M194663</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-05-20T19:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: Text Lines and Indentation in PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Text-Lines-and-Indentation-in-PROC-REPORT/m-p/649379#M194669</link>
      <description>Use CALL DEFINE conditionally in the COMPUTE block.</description>
      <pubDate>Wed, 20 May 2020 20:22:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Text-Lines-and-Indentation-in-PROC-REPORT/m-p/649379#M194669</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-05-20T20:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Text Lines and Indentation in PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Text-Lines-and-Indentation-in-PROC-REPORT/m-p/649538#M194743</link>
      <description>That worked. Thanks!</description>
      <pubDate>Thu, 21 May 2020 12:00:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Text-Lines-and-Indentation-in-PROC-REPORT/m-p/649538#M194743</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-05-21T12:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Text Lines and Indentation in PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Text-Lines-and-Indentation-in-PROC-REPORT/m-p/649629#M194796</link>
      <description>&lt;P&gt;While the solution worked, upon closer inspection I see that the indentation for numeric columns (COL1 - COL4) is a lot wider than the indentation in the text column I have on the left side of the report for the same rows. For instance, if I request 1 space for the data on row 7, the text column (NAME) is in fact indented by 1 space, but the numeric values in the following columns for that row are indented further to the right.&amp;nbsp; &amp;nbsp;How can I make the indentation match that of the first column?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;compute COL4;	
if row in(7, 10, 11, 14, 31) then do;
         do i = 1 to 6; 
            call define (i, 'style', 'style=[pretext="A0"x]');  
         end;
		 end;

      if row in(8, 9, 15, 21, 22, 27, 33, 32) then do;
         do i = 1 to 6; 
            call define (i, 'style', 'style=[pretext="A0A0A0A0"x]'); 
         end;
end;

      if row in(16, 17, 18, 19, 20, 23, 24, 25, 26, 28, 29, 30) then do;
         do i = 1 to 6; 
            call define (i, 'style', 'style=[pretext="A0A0A0A0A0A0"x]'); 
end;
		 end;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2020 16:51:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Text-Lines-and-Indentation-in-PROC-REPORT/m-p/649629#M194796</guid>
      <dc:creator>RandoDando</dc:creator>
      <dc:date>2020-05-21T16:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: Text Lines and Indentation in PROC REPORT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Text-Lines-and-Indentation-in-PROC-REPORT/m-p/714368#M220540</link>
      <description>Did you find any solution?&lt;BR /&gt;Thanks in advance!</description>
      <pubDate>Tue, 26 Jan 2021 18:58:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Text-Lines-and-Indentation-in-PROC-REPORT/m-p/714368#M220540</guid>
      <dc:creator>RAVI2000</dc:creator>
      <dc:date>2021-01-26T18:58:14Z</dc:date>
    </item>
  </channel>
</rss>

