<?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: how to split text in different lines in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-text-in-different-lines/m-p/858364#M339139</link>
    <description>&lt;P&gt;You would need to store line feeds (or carriage return/line feed) in your variable which is almost never a good idea.&lt;/P&gt;
&lt;P&gt;If this is about printing your data to a file or creating a report then use a data step put or a procedure like Proc Report to create the layout you want.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input x $ y $ z $;
  datalines;
aa bb cc
;

data _null_;
  file print;
  set have;
  put 
      @1 x +(-1) '/' 
    / @3 y +(-1) '/'
    / @5 z
    ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1676074693104.png" style="width: 175px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80322i6C8B866366A709E7/image-dimensions/175x120?v=v2" width="175" height="120" role="button" title="Patrick_0-1676074693104.png" alt="Patrick_0-1676074693104.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 11 Feb 2023 00:19:50 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2023-02-11T00:19:50Z</dc:date>
    <item>
      <title>how to split text in different lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-text-in-different-lines/m-p/858344#M339133</link>
      <description>&lt;P&gt;Hi expert, I wanted split my text into several lines.&amp;nbsp;&amp;nbsp;For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;input x $ y $ z $;&lt;BR /&gt;datalines;&lt;BR /&gt;aa bb cc&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set want;&lt;BR /&gt;want=strip(x)||'/'||strip(y)||'/'||strip(z);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;it comes out :&amp;nbsp;aa/bb/cc&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but I want:&lt;/P&gt;
&lt;P&gt;aa/&lt;/P&gt;
&lt;P&gt;&amp;nbsp; bb/&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; cc&lt;/P&gt;
&lt;P&gt;line 2 has 2 leading space compared to line 1, line 3 has 4 leading space compared to line1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 21:05:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-text-in-different-lines/m-p/858344#M339133</guid>
      <dc:creator>lulu3</dc:creator>
      <dc:date>2023-02-10T21:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to split text in different lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-text-in-different-lines/m-p/858345#M339134</link>
      <description>&lt;P&gt;Where do you intend to use this? Depending on the type of document you may not get consistent behavior so you need to tell us what sort of file this output should be for.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 21:08:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-text-in-different-lines/m-p/858345#M339134</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-02-10T21:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to split text in different lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-split-text-in-different-lines/m-p/858364#M339139</link>
      <description>&lt;P&gt;You would need to store line feeds (or carriage return/line feed) in your variable which is almost never a good idea.&lt;/P&gt;
&lt;P&gt;If this is about printing your data to a file or creating a report then use a data step put or a procedure like Proc Report to create the layout you want.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input x $ y $ z $;
  datalines;
aa bb cc
;

data _null_;
  file print;
  set have;
  put 
      @1 x +(-1) '/' 
    / @3 y +(-1) '/'
    / @5 z
    ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1676074693104.png" style="width: 175px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80322i6C8B866366A709E7/image-dimensions/175x120?v=v2" width="175" height="120" role="button" title="Patrick_0-1676074693104.png" alt="Patrick_0-1676074693104.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2023 00:19:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-split-text-in-different-lines/m-p/858364#M339139</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-02-11T00:19:50Z</dc:date>
    </item>
  </channel>
</rss>

