<?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 continue indent when text wraps in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/continue-indent-when-text-wraps/m-p/461354#M117352</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have an rtf table with&amp;nbsp;three levels of output indent values that need to look like this (2 spaces at each indent):&lt;/P&gt;
&lt;TABLE&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TD width="355"&gt;
&lt;P&gt;ATC Level 1 /&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="355"&gt;
&lt;P&gt;&amp;nbsp; ATC Level 2 /&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; Generic Drug Name&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One level of output looks like this.&amp;nbsp; I would like that last line of output to continue with the indent but it is wrapping back to the left.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="355"&gt;
&lt;P&gt;SENSORY ORGANS&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="355"&gt;
&lt;P&gt;&amp;nbsp; OPHTHALMOLOGICALS&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="355"&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ASCORBIC ACID;CUPRIC OXIDE;DL-ALPHA TOCOPHERYL ACETATE; XANTOFYL; ZEAXANTHIN;ZINC OXIDE&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;my code looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if ord=1 then do; &lt;BR /&gt; name =strip(ATC01TXT); &lt;BR /&gt; end;&lt;BR /&gt; else if ord=2 then do; &lt;BR /&gt; name ='&amp;nbsp; ' || strip(ATC02TXT); &lt;BR /&gt; end;&lt;BR /&gt; else if ord=3 then do;&lt;BR /&gt; name ='&amp;nbsp; &amp;nbsp; ' || strip(generic); &lt;BR /&gt; end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there something I can add in the datastep to continue the indent when the text wraps?&lt;/P&gt;</description>
    <pubDate>Thu, 10 May 2018 15:41:25 GMT</pubDate>
    <dc:creator>jenim514</dc:creator>
    <dc:date>2018-05-10T15:41:25Z</dc:date>
    <item>
      <title>continue indent when text wraps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/continue-indent-when-text-wraps/m-p/461354#M117352</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have an rtf table with&amp;nbsp;three levels of output indent values that need to look like this (2 spaces at each indent):&lt;/P&gt;
&lt;TABLE&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TD width="355"&gt;
&lt;P&gt;ATC Level 1 /&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="355"&gt;
&lt;P&gt;&amp;nbsp; ATC Level 2 /&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; Generic Drug Name&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One level of output looks like this.&amp;nbsp; I would like that last line of output to continue with the indent but it is wrapping back to the left.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="355"&gt;
&lt;P&gt;SENSORY ORGANS&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="355"&gt;
&lt;P&gt;&amp;nbsp; OPHTHALMOLOGICALS&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="355"&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ASCORBIC ACID;CUPRIC OXIDE;DL-ALPHA TOCOPHERYL ACETATE; XANTOFYL; ZEAXANTHIN;ZINC OXIDE&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;my code looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if ord=1 then do; &lt;BR /&gt; name =strip(ATC01TXT); &lt;BR /&gt; end;&lt;BR /&gt; else if ord=2 then do; &lt;BR /&gt; name ='&amp;nbsp; ' || strip(ATC02TXT); &lt;BR /&gt; end;&lt;BR /&gt; else if ord=3 then do;&lt;BR /&gt; name ='&amp;nbsp; &amp;nbsp; ' || strip(generic); &lt;BR /&gt; end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there something I can add in the datastep to continue the indent when the text wraps?&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 15:41:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/continue-indent-when-text-wraps/m-p/461354#M117352</guid>
      <dc:creator>jenim514</dc:creator>
      <dc:date>2018-05-10T15:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: continue indent when text wraps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/continue-indent-when-text-wraps/m-p/461357#M117354</link>
      <description>&lt;P&gt;What ods destination are you sending output to? You may have to include destination specific codes as part of the values or table building code.&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 15:49:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/continue-indent-when-text-wraps/m-p/461357#M117354</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-10T15:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: continue indent when text wraps</title>
      <link>https://communities.sas.com/t5/SAS-Programming/continue-indent-when-text-wraps/m-p/461396#M117367</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; When I use some "helper" variables to indicate which level to indent, the wrapping works as you explain. Here's the fake data I made, with some "helper" variables called TYPVAR and ORDVAR:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fake_data_to_wrap.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20439iEE43795C8BDDE509/image-size/large?v=v2&amp;amp;px=999" role="button" title="fake_data_to_wrap.png" alt="fake_data_to_wrap.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Indenting "spaces" doesn't really apply to a proportional font, so I used the LEFTMARGIN style override to force the indenting, based on the value of ORDVAR within each TYPVAR value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="results_using_leftmargin.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20442iA6699639EF86A139/image-size/large?v=v2&amp;amp;px=999" role="button" title="results_using_leftmargin.png" alt="results_using_leftmargin.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I set the overall width of the column to 3in to ensure that the longest line (line 3) would wrap, and then set the LEFTMARGIN attribute based on the value of ORDVAR.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Since you didn't say what destination you were interested in, I used RTF for this example. I used PROC REPORT to product a report table, since indenting in a dataset doesn't make sense.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Here's the full code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fakedata;
  length typvar 8 ordvar 8 lineinfo $500;
  infile datalines dlm=',' dsd;
  input typvar ordvar lineinfo $;
return;
datalines4;
1,1,"SENSORY ORGANS"
1,2,"OPHTHALMOLOGICALS"
1,3,"ASCORBIC ACID;CUPRIC OXIDE;DL-ALPHA TOCOPHERYL ACETATE; XANTOFYL; ZEAXANTHIN;ZINC OXIDE"
2,1,"First Line"
2,2,"Second Line"
2,3,"Third Line is very long; and needs to be indented too; and now that's all."
;;;;
run;

ods rtf file='c:\temp\showindent.rtf';
proc report data=fakedata;
   column typvar ordvar lineinfo;
   define typvar / group noprint;
   define ordvar / order noprint;
   define lineinfo / 'Information'
          style(column)={width=3in};
   compute lineinfo;
      if ordvar =1 then do;
	    call define(_col_,'style','style={fontweight=bold leftmargin=0in}');
	  end;
	  else if ordvar=2 then do;
	    call define(_col_,'style','style={fontweight=bold leftmargin=.125in}');
	  end;
	  else if ordvar = 3 then do;
	    call define(_col_,'style','style={fontweight=bold leftmargin=.25in}');
	  end;
   endcomp;
run;
ods rtf close;




&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 18:46:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/continue-indent-when-text-wraps/m-p/461396#M117367</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-05-10T18:46:36Z</dc:date>
    </item>
  </channel>
</rss>

