<?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: Vertical Concatenation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62290#M13558</link>
    <description>As I understand this, there are three ID variables and one text variable in the SAS dataset and you want a report, not another SAS dataset.  This may be easiest with a DATA step.  You will need to do some additional reading.  Look at something like this, assuming the data are already sorted.&lt;BR /&gt;
&lt;BR /&gt;
ODS HTML (add additional HTML parameters);&lt;BR /&gt;
&lt;BR /&gt;
DATA _NULL_;&lt;BR /&gt;
SET mydata;&lt;BR /&gt;
BY id1 id2 id3;&lt;BR /&gt;
FILE PRINT (additional parameters if needed);&lt;BR /&gt;
IF first.id3 THEN PUT id1 id2 id3 textvar;&lt;BR /&gt;
ELSE PUT textvar;&lt;BR /&gt;
IF last.id3 THEN PUT (additional pretty-print for readability);&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
ODS _ALL_ CLOSE;</description>
    <pubDate>Thu, 13 Jan 2011 14:35:38 GMT</pubDate>
    <dc:creator>Doc_Duke</dc:creator>
    <dc:date>2011-01-13T14:35:38Z</dc:date>
    <item>
      <title>Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62289#M13557</link>
      <description>I am trying to vertically concatenate all the txt messages in my SAS dataset by an id and 2 more columns into one msg.&lt;BR /&gt;
So if my table is initially like this:&lt;BR /&gt;
1 abc&lt;BR /&gt;
1 def&lt;BR /&gt;
2 efg&lt;BR /&gt;
2 ghi&lt;BR /&gt;
&lt;BR /&gt;
Then my output shd be like this, where 'abc' 'def' are in the same record but different lines, i need kind of a line break.&lt;BR /&gt;
1 abc&lt;BR /&gt;
  def&lt;BR /&gt;
2 efg&lt;BR /&gt;
ghi&lt;BR /&gt;
&lt;BR /&gt;
I read about vertical concatenation of matrices, but not aware of how to convert a sas dataset into a mtrix. Also, I want to provide some basic HTML formatting so that the text messages is readable.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!</description>
      <pubDate>Thu, 13 Jan 2011 13:44:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62289#M13557</guid>
      <dc:creator>SASNEWB</dc:creator>
      <dc:date>2011-01-13T13:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62290#M13558</link>
      <description>As I understand this, there are three ID variables and one text variable in the SAS dataset and you want a report, not another SAS dataset.  This may be easiest with a DATA step.  You will need to do some additional reading.  Look at something like this, assuming the data are already sorted.&lt;BR /&gt;
&lt;BR /&gt;
ODS HTML (add additional HTML parameters);&lt;BR /&gt;
&lt;BR /&gt;
DATA _NULL_;&lt;BR /&gt;
SET mydata;&lt;BR /&gt;
BY id1 id2 id3;&lt;BR /&gt;
FILE PRINT (additional parameters if needed);&lt;BR /&gt;
IF first.id3 THEN PUT id1 id2 id3 textvar;&lt;BR /&gt;
ELSE PUT textvar;&lt;BR /&gt;
IF last.id3 THEN PUT (additional pretty-print for readability);&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
ODS _ALL_ CLOSE;</description>
      <pubDate>Thu, 13 Jan 2011 14:35:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62290#M13558</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-01-13T14:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62291#M13559</link>
      <description>Hi:&lt;BR /&gt;
  You might use a DATA step, but I think that, for a report (since you can't put line breaks or carriage returns in a dataset), PROC REPORT will do quite nicely. Especially if you use the JOURNAL style, which removes interior table lines, it will look like 'def' is stacked vertically under 'abc'.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
data mydata;&lt;BR /&gt;
  infile datalines;&lt;BR /&gt;
  input id txt $;&lt;BR /&gt;
return;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 abc&lt;BR /&gt;
1 def&lt;BR /&gt;
2 efg&lt;BR /&gt;
2 ghi&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
               &lt;BR /&gt;
ods listing;&lt;BR /&gt;
ods html file='c:\temp\output\use_order.html' style=journal;&lt;BR /&gt;
             &lt;BR /&gt;
proc report data=mydata nowd;&lt;BR /&gt;
  column id txt;&lt;BR /&gt;
  define id / order;&lt;BR /&gt;
  define txt / display;&lt;BR /&gt;
run;&lt;BR /&gt;
                &lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 13 Jan 2011 15:06:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62291#M13559</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-01-13T15:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62292#M13560</link>
      <description>Sorry I forgot to mention that after vertical concatenation , SAS dataset will be uploaded back to a teradata table. So I guess I need some basic formatting that will be supported by a tbale.</description>
      <pubDate>Thu, 13 Jan 2011 15:46:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62292#M13560</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-13T15:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62293#M13561</link>
      <description>If you want to concatenate all the txt values for an id, html encoded and delimited by "&amp;lt;br/&amp;gt;" then a simple data step would do. Just give the allTxt variable a long enough length:&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;/*&amp;nbsp;test&amp;nbsp;data&amp;nbsp;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;data&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;one;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;id&amp;nbsp;txt&amp;nbsp;$;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&amp;nbsp;a&amp;lt;c&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&amp;nbsp;def&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&amp;nbsp;efg&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&amp;nbsp;ghi&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;run&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;/*&amp;nbsp;transpose&amp;nbsp;to&amp;nbsp;wide&amp;nbsp;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;proc&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;transpose&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;=one&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;=wide(drop=_:)&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;prefix&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;=txt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;id;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;txt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;run&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;/*&amp;nbsp;concatenate&amp;nbsp;txt&amp;nbsp;fiels&amp;nbsp;delimited&amp;nbsp;by&amp;nbsp;"&amp;lt;br/&amp;gt;",&amp;nbsp;htmlencoded&amp;nbsp;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;data&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;two;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;wide;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;allTxt&amp;nbsp;$&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#008080;font-family:Courier New;font-size:10pt;"&gt;1000&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;allTxt&amp;nbsp;=&amp;nbsp;catx(&lt;/SPAN&gt;&lt;SPAN style="color:#800080;font-family:Courier New;font-size:10pt;"&gt;"#br#"&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;,&amp;nbsp;of&amp;nbsp;txt:);&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;allTxt&amp;nbsp;=&amp;nbsp;htmlencode(allTxt);&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;allTxt&amp;nbsp;=&amp;nbsp;tranwrd(allTxt,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#800080;font-family:Courier New;font-size:10pt;"&gt;"#br#"&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#800080;font-family:Courier New;font-size:10pt;"&gt;"&amp;lt;br/&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;keep&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;id&amp;nbsp;allTxt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;run&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;/*&amp;nbsp;check&amp;nbsp;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;proc&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;print&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;=two&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#0000FF;font-family:Courier New;font-size:10pt;"&gt;noobs&lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;B&gt;&lt;SPAN style="color:#000080;font-family:Courier New;font-size:10pt;"&gt;run&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;/*&amp;nbsp;on&amp;nbsp;lst&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;allTxt&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a&amp;amp;lt;c&amp;lt;br/&amp;gt;def&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;efg&amp;lt;br/&amp;gt;ghi&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;
&lt;P style="padding:0"&gt;&lt;SPAN style="color:#008000;font-family:Courier New;font-size:10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2011 16:22:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62293#M13561</guid>
      <dc:creator>chang_y_chung_hotmail_com</dc:creator>
      <dc:date>2011-01-13T16:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62294#M13562</link>
      <description>This works perfectly for vertical concatenation.Thanks a lot!&lt;BR /&gt;
 However when I said HTML, I meant some basic formatting. Eg. if there are 2 txt messages that get concatenated, then i would like to have them on separate lines. &lt;BR /&gt;
&lt;BR /&gt;
Any pointers are appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Thank you!</description>
      <pubDate>Fri, 14 Jan 2011 03:56:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62294#M13562</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-14T03:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62295#M13563</link>
      <description>Also I would like to have a column 'TYPE. As per this type, can we have a Heading line before the messages in that TYPE.&lt;BR /&gt;
&lt;BR /&gt;
Example:&lt;BR /&gt;
&lt;BR /&gt;
ID Type        Txt&lt;BR /&gt;
1   Class      ABC is my class&lt;BR /&gt;
1   Teacher   DEF is my teacher&lt;BR /&gt;
&lt;BR /&gt;
Output should look like:&lt;BR /&gt;
ID xt&lt;BR /&gt;
1  Class:&lt;BR /&gt;
    ABC is my class&lt;BR /&gt;
    Teacher:&lt;BR /&gt;
    DEF is my teacher&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
Thank you!</description>
      <pubDate>Fri, 14 Jan 2011 04:14:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62295#M13563</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-14T04:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62296#M13564</link>
      <description>Hi.&lt;BR /&gt;
Just as Cynthia mentioned before.&lt;BR /&gt;
Let me show your Power of Proc report.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data temp;&lt;BR /&gt;
input ID $ Type $ Txt &amp;amp; $20.;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 Class ABC is my class&lt;BR /&gt;
1 Teacher DEF is my teacher&lt;BR /&gt;
2 cClass aABC is my class&lt;BR /&gt;
2 tTeacher dDEF is my teacher&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
ods html file='c:\test.html' style=sasweb ;&lt;BR /&gt;
proc report data=temp nowd  out=out;&lt;BR /&gt;
column id type txt;&lt;BR /&gt;
 define id /order noprint;&lt;BR /&gt;
 define type /order noprint;&lt;BR /&gt;
 define txt /order noprint;&lt;BR /&gt;
compute id;&lt;BR /&gt;
 if id eq lag(id) then len=4 ;&lt;BR /&gt;
  else len=0;&lt;BR /&gt;
endcomp;&lt;BR /&gt;
compute before /style={just=left};&lt;BR /&gt;
 line  'ID   '   'xT';&lt;BR /&gt;
endcomp;&lt;BR /&gt;
compute after txt/style={just=left};&lt;BR /&gt;
 line id $varying. len  type $10.;&lt;BR /&gt;
 line txt $20.;&lt;BR /&gt;
endcomp; &lt;BR /&gt;
run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Fri, 14 Jan 2011 07:28:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62296#M13564</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-01-14T07:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62297#M13565</link>
      <description>Appreciate your help on creating a proc.&lt;BR /&gt;
However when I look at the OUT dataset, it looks like this and I will be loading this dataset back to Teardata.&lt;BR /&gt;
ID	Type	Txt&lt;BR /&gt;
		&lt;BR /&gt;
1	Class	ABC is my class&lt;BR /&gt;
1	Class	ABC is my class&lt;BR /&gt;
1	Teacher	DEF is my teacher&lt;BR /&gt;
1	Teacher	DEF is my teacher&lt;BR /&gt;
2	cClass	aABC is my class&lt;BR /&gt;
2	cClass	aABC is my class&lt;BR /&gt;
2	tTeacher	dDEF is my teacher&lt;BR /&gt;
2	tTeacher	dDEF is my teacher&lt;BR /&gt;
&lt;BR /&gt;
The OUT dataset shd really look like this:&lt;BR /&gt;
ID		Txt&lt;BR /&gt;
		&lt;BR /&gt;
1		Class&lt;BR /&gt;
                                ABC is my class&lt;BR /&gt;
		Teacher &lt;BR /&gt;
                                DEF is my teacher&lt;BR /&gt;
2		cClass&lt;BR /&gt;
                                aABC is my class&lt;BR /&gt;
                                tTeacher &lt;BR /&gt;
		dDEF is my teacher&lt;BR /&gt;
&lt;BR /&gt;
Basically I need to consolidate all Class data together and Teacher data tigether under each ID with a heading (CLass/Teacher) to identify the data.Also the line breaks, so that all data is not on one line.&lt;BR /&gt;
&lt;BR /&gt;
Thank you!!</description>
      <pubDate>Fri, 14 Jan 2011 15:34:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62297#M13565</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-14T15:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62298#M13566</link>
      <description>Hi.&lt;BR /&gt;
Do you mean in the dataset?But you have two variable id and txt,then&lt;BR /&gt;
'ABC is my class' will be id or txt?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data temp;&lt;BR /&gt;
input ID $ Type $ Txt &amp;amp; $20.;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 Class ABC is my class&lt;BR /&gt;
1 Teacher DEF is my teacher&lt;BR /&gt;
2 cClass aABC is my class&lt;BR /&gt;
2 tTeacher dDEF is my teacher&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
data temp;&lt;BR /&gt;
 set temp;&lt;BR /&gt;
 _txt=txt;&lt;BR /&gt;
 txt=type; if id eq lag(id) then call missing(id);&lt;BR /&gt;
 output;&lt;BR /&gt;
 txt=_txt; call missing(id);&lt;BR /&gt;
 output;&lt;BR /&gt;
 drop _txt type;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Mon, 17 Jan 2011 03:43:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62298#M13566</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-01-17T03:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62299#M13567</link>
      <description>Thank you for your reponse.&lt;BR /&gt;
My result however created separate records for the Type variable too.So I am ending up with 4 records per id when I would like to see all these 4 records merged together but on separate lines.How do I merge them because I do not see the ID for 3 records out of the 4?&lt;BR /&gt;
I need to upload this result dataset back to teradata as it looks.&lt;BR /&gt;
 &lt;BR /&gt;
Id    Txt&lt;BR /&gt;
1   Class  &lt;BR /&gt;
     ABC is my class &lt;BR /&gt;
     Teacher &lt;BR /&gt;
     Teacher DEF is my teacher &lt;BR /&gt;
2    Class   &lt;BR /&gt;
      aABC is my class &lt;BR /&gt;
       tTeacher  &lt;BR /&gt;
       dDEF is my teacher&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thank you!</description>
      <pubDate>Tue, 18 Jan 2011 15:29:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62299#M13567</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-18T15:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62300#M13568</link>
      <description>Please share your exact SAS code, pasted from your SAS log with all code lines revealed.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 18 Jan 2011 15:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62300#M13568</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2011-01-18T15:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62301#M13569</link>
      <description>80   rsubmit;&lt;BR /&gt;
NOTE: Remote submit to PRSAS1 commencing.&lt;BR /&gt;
&lt;BR /&gt;
470  data prod.CS;&lt;BR /&gt;
471  set prod.CS_mrg;&lt;BR /&gt;
472  _txt=allTxt;&lt;BR /&gt;
473  allTxt=type;&lt;BR /&gt;
474  if ID eq lag(ID) then call missing(ID);&lt;BR /&gt;
475  output;&lt;BR /&gt;
476  allTxt=_txt;&lt;BR /&gt;
477  call missing(ID);&lt;BR /&gt;
478  output;&lt;BR /&gt;
479  drop _txt type;&lt;BR /&gt;
480  run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: There were 2 observations read from the data set prod.CS_MRG.&lt;BR /&gt;
NOTE: The data set prod.CS has 4 observations and 2 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.01 seconds&lt;BR /&gt;
      cpu time            0.00 seconds&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Remote submit to PRSAS1 complete.&lt;BR /&gt;
&lt;BR /&gt;
This is how my input data looks:&lt;BR /&gt;
Id Type           Alltxt&lt;BR /&gt;
1  Class         ABC is my Class&lt;BR /&gt;
1  Teacher      DEF is my teacher.&lt;BR /&gt;
&lt;BR /&gt;
And my current output has 4 separate records which I would like to be merged per Id:&lt;BR /&gt;
Id            Alltxt&lt;BR /&gt;
1             Class&lt;BR /&gt;
              ABC is my Class&lt;BR /&gt;
              Teacher      &lt;BR /&gt;
               DEF is my teacher.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thank you!!!</description>
      <pubDate>Tue, 18 Jan 2011 17:08:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62301#M13569</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-18T17:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62302#M13570</link>
      <description>you can generate these output separately.&lt;BR /&gt;
you say 'merge' is to mean horizontal merge or vertical merge?&lt;BR /&gt;
&lt;BR /&gt;
If it is horizontal merge ,you can use ' count+1' statement to make a merge variable.&lt;BR /&gt;
If it is vertical merge, you can use ' data all; set a b c d ; run;' to union all datasets.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Wed, 19 Jan 2011 03:12:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62302#M13570</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-01-19T03:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62303#M13571</link>
      <description>ID Type Txt&lt;BR /&gt;
&lt;BR /&gt;
1 Class ABC is my class&lt;BR /&gt;
1 Class ABC is my class&lt;BR /&gt;
1 Teacher DEF is my teacher&lt;BR /&gt;
1 Teacher DEF is my teacher&lt;BR /&gt;
2 cClass aABC is my class&lt;BR /&gt;
2 cClass aABC is my class&lt;BR /&gt;
2 tTeacher dDEF is my teacher&lt;BR /&gt;
2 tTeacher dDEF is my teacher&lt;BR /&gt;
&lt;BR /&gt;
The OUT dataset shd really look like this. I want to merge the records by id. &lt;BR /&gt;
So if there are 4 records for ID 1, they should vertically concatenate into one. &lt;BR /&gt;
And my SAS code which I printed above, does not create the ID , when ideally it should, so that the merge on d would be easier.&lt;BR /&gt;
ID Txt&lt;BR /&gt;
&lt;BR /&gt;
1 Class&lt;BR /&gt;
ABC is my class&lt;BR /&gt;
Teacher &lt;BR /&gt;
DEF is my teacher&lt;BR /&gt;
2 cClass&lt;BR /&gt;
aABC is my class&lt;BR /&gt;
tTeacher &lt;BR /&gt;
dDEF is my teacher</description>
      <pubDate>Wed, 19 Jan 2011 14:58:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62303#M13571</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-19T14:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62304#M13572</link>
      <description>Hi:&lt;BR /&gt;
  Here's what I understand.&lt;BR /&gt;
1) you have original data that is multiple observations per "ID"&lt;BR /&gt;
2) the observations fall into multiple "types" for each ID. The "types" you have shown us are "Class" and "Teacher"&lt;BR /&gt;
3) each observation has column/field called TXT, which is an explanatory text string&lt;BR /&gt;
 &lt;BR /&gt;
  Here's what I don't understand. You keep referring to an output &lt;B&gt;DATASET&lt;/B&gt; as though it was possible for a SAS  &lt;B&gt;DATASET&lt;/B&gt; to contain a carriage control or line feed. A SAS  &lt;B&gt;DATASET&lt;/B&gt; is a proprietary structure of rows and columns, and as such, does not contain line feeds or carriage returns, such as you implied in your first post, when you said:&lt;BR /&gt;
 &lt;B&gt;&lt;BR /&gt;
"Then my output shd be like this, where 'abc' 'def' are in the same record but different lines, i need kind of a line break."&lt;/B&gt;&lt;BR /&gt;
[pre]&lt;BR /&gt;
1 abc&lt;BR /&gt;
  def&lt;BR /&gt;
2 efg&lt;BR /&gt;
  ghi&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
If SAS were going to store your data into a SAS DATASET structure, it would either be something like this where each value of TXT for ID would become a numbered variable:&lt;BR /&gt;
[pre]&lt;BR /&gt;
ID  TXT1    TXT2&lt;BR /&gt;
 1   abc     def&lt;BR /&gt;
 2   efg     ghi&lt;BR /&gt;
[/pre]&lt;BR /&gt;
OR like this, where your program "concatenated" all the individual values for TXT together into one long variable, possibly with a delimiter of some kind between each individual value for TXT (shown below as the | character):&lt;BR /&gt;
[/pre]&lt;BR /&gt;
ID     AllText&lt;BR /&gt;
 1   abc | def&lt;BR /&gt;
 2   efg | ghi&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
There is no "kind of line feed" in a SAS DATASET. If, on the other hand, you created a REPORT (such as with PROC REPORT), then you could line up 'def' underneath 'abc' for one value of ID. Or, you could write a custom DATA step program that would structure your output REPORT that way.&lt;BR /&gt;
 &lt;BR /&gt;
But then, in another post, you said: &lt;B&gt;&lt;BR /&gt;
"Sorry I forgot to mention that after vertical concatenation, SAS dataset will be uploaded back to a teradata table. So I guess I need some basic formatting that will be supported by a table."&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
Ah, OK...the SAS dataset will be uploaded back to a Teradata table -- so either you are going to use SAS/Access for Teradata in order to move SAS data into Teradata form or you are going to use????&lt;BR /&gt;
 &lt;BR /&gt;
When you said "I guess I need some basic formatting that will be supported by a (Teradata) table" -- my question to you is -- do you know what kind of formatting that would be???&lt;BR /&gt;
&lt;BR /&gt;
On this web site:&lt;BR /&gt;
&lt;A href="http://teradatau.courses.teradata.com/learning/BLADE_MS/legacy/35502_IntrotoTD_DEMO/wbt-glossary.htm" target="_blank"&gt;http://teradatau.courses.teradata.com/learning/BLADE_MS/legacy/35502_IntrotoTD_DEMO/wbt-glossary.htm&lt;/A&gt;&lt;BR /&gt;
  &lt;BR /&gt;
it says that:&lt;BR /&gt;
"Each Teradata Database table is stored in a set of subtables. There is one table for each kind of data, including:&lt;BR /&gt;
----Table headers &lt;BR /&gt;
----Primary data &lt;BR /&gt;
----Fallback data  &lt;BR /&gt;
----Secondary Indexes &lt;BR /&gt;
----Fallback Secondary Indexes "&lt;BR /&gt;
&lt;BR /&gt;
So I don't still understand whether you are creating a REPORT or loading DATA.&lt;BR /&gt;
 &lt;BR /&gt;
Then, later, in response to chang_y_chung's solution, you said:&lt;B&gt;&lt;BR /&gt;
"This works perfectly for vertical concatenation.Thanks a lot!&lt;BR /&gt;
However when I said HTML, I meant some basic formatting. Eg. if there are 2 txt messages that get concatenated, then i would like to have them on separate lines."&lt;/B&gt;&lt;BR /&gt;
    &lt;BR /&gt;
Here's the thing, though -- "basic formatting" doesn't exist in a vacuum. Basic formatting with HTML tags, implies that the HTML tags will be &lt;U&gt;rendered&lt;/U&gt; by an application that knows what the HTML tags mean. The &amp;lt;BR&amp;gt; tag would ONLY "work" when a browser or some software that recognized the &amp;lt;BR&amp;gt; tag inserted the break &lt;U&gt;when RENDERING the underlying HTML.&lt;/U&gt;&lt;BR /&gt;
 &lt;BR /&gt;
So it seems to me that, at one point, you had a solution, one which inserted an HTML &amp;amp;LT;BR&amp;amp;GT; tag into your concatenated text strings (using PROC TRANSPOSE and then concatenating what came from PROC TRANSPOSE).&lt;BR /&gt;
                             &lt;BR /&gt;
  HTML is "basic formatting" -- do you know whether Teradata tables can actually contain HTML??? Clearly, a text variable in a SAS dataset could conceivably contain HTML tags -- but when you look at the SAS dataset, you will see the "unrendered" HTML tags.&lt;BR /&gt;
&lt;BR /&gt;
How are you trying to view this output that has a &amp;lt;BR&amp;gt; tag embedded in it??? In a browser??? In Teradata??? Or in SAS??? SAS will NEVER show a &amp;lt;BR&amp;gt; tag as a "line feed" equivalent -- when the &amp;lt;BR&amp;gt; tag is "embedded" in the data. You would have to look at the DATA inside a browser - -to look at your data inside a browser, you would need to create an HTML report from the data.&lt;BR /&gt;
                                                      &lt;BR /&gt;
If I modify the Chang's program just a bit -- at the very end -- if you look in the SAS dataset, you will see the &amp;lt;BR/&amp;gt; tag. If you look at the ODS HTML output report file: c:\temp\look_in_browser.html, however, you will see the equivalent of the "line feed" -- because the BROWSER knows what to do with the HTML &amp;lt;BR&amp;gt; tag.&lt;BR /&gt;
 &lt;BR /&gt;
I believe you already have the answer to your original question, but you will NEVER see the "line feed" inside the SAS dataset.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
/* test data */&lt;BR /&gt;
   data one;&lt;BR /&gt;
     input id txt $;&lt;BR /&gt;
   cards;&lt;BR /&gt;
   1 abc &lt;BR /&gt;
   1 def&lt;BR /&gt;
   2 efg&lt;BR /&gt;
   2 ghi&lt;BR /&gt;
   ;&lt;BR /&gt;
   run;&lt;BR /&gt;
                                        &lt;BR /&gt;
   /* transpose to wide */&lt;BR /&gt;
   proc transpose data=one out=wide(drop=_:) prefix=txt;&lt;BR /&gt;
     by id;&lt;BR /&gt;
     var txt;&lt;BR /&gt;
   run;&lt;BR /&gt;
                                &lt;BR /&gt;
   /* concatenate txt fiels delimited by "&amp;lt;br/&amp;gt;", htmlencoded */&lt;BR /&gt;
   data two;&lt;BR /&gt;
       set wide;&lt;BR /&gt;
       length allTxt $1000;&lt;BR /&gt;
       allTxt = catx("#br#", of txt:);&lt;BR /&gt;
       allTxt = htmlencode(allTxt);&lt;BR /&gt;
       allTxt = tranwrd(allTxt, "#br#", "&amp;lt;br/&amp;gt;");&lt;BR /&gt;
       keep id allTxt;&lt;BR /&gt;
   run;&lt;BR /&gt;
                                  &lt;BR /&gt;
   /* check in LISTING and check in the browser */&lt;BR /&gt;
   /* in LISTING, you will see &amp;lt;br/&amp;gt; in the HTML, you will see the "line feed" */&lt;BR /&gt;
   /* But, in the DATASET, you will ALWAYS see the &amp;lt;br/&amp;gt; tag */&lt;BR /&gt;
                    &lt;BR /&gt;
  ** need PROTECTSPECIALCHARS=OFF so the BREAK tag is respected as a BREAK tag;&lt;BR /&gt;
   ods html file='c:\temp\look_in_browser.html' style=sasweb;&lt;BR /&gt;
   proc print data=two noobs&lt;BR /&gt;
        style(column)={protectspecialchars=off};&lt;BR /&gt;
   run;&lt;BR /&gt;
   ods html close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Wed, 19 Jan 2011 18:15:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62304#M13572</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-01-19T18:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62305#M13573</link>
      <description>You are right Cynthia. For a line break what I need is just &lt;BR /&gt; and that should work.This is one last piece I need to address.&lt;BR /&gt;
I used the code for line break as well as for adding a heading.  I have my output looking like this:&lt;BR /&gt;
Id   Txt&lt;BR /&gt;
1  Class   &lt;BR /&gt;
    ABC is my class&lt;BR /&gt;
    Teacher &lt;BR /&gt;
    DEF is my teacher&lt;BR /&gt;
&lt;BR /&gt;
So I was thinking of using a MERGE BY to merge all these 4 separate records into one. But for that I need to have ID on each of these 4 records and currently the ID is missing in the last 3. The code that actually adds the heading is given below. Can you help me change this code so that I get an ID in every record so taht merging would be easier?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data temp;&lt;BR /&gt;
input ID $ Type $ Txt &amp;amp; $20.;&lt;BR /&gt;
cards;1 Class ABC is my class1 Teacher DEF is my teacher2 cClass aABC is my class2 tTeacher dDEF is my teacher;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data temp; &lt;BR /&gt;
set temp;&lt;BR /&gt;
 _txt=txt;&lt;BR /&gt;
 txt=type;&lt;BR /&gt;
 if id eq lag(id) then call missing(id); &lt;BR /&gt;
output; txt=_txt; &lt;BR /&gt;
call missing(id); &lt;BR /&gt;
output; drop _txt type;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Thank you!</description>
      <pubDate>Thu, 20 Jan 2011 21:41:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62305#M13573</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-20T21:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62306#M13574</link>
      <description>Hi:&lt;BR /&gt;
  It is very hard to read your posting. I suspect that you used &amp;lt;br/&amp;gt; or some other HTML tags in your code that made subsequent formatting look bad. &lt;BR /&gt;
&lt;BR /&gt;
  This is a useful forum posting:&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=27609毙" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=27609毙&lt;/A&gt;  about how,  to use the [pre] and the [/pre] tags around your code in order to avoid having it become virtually unreadable.&lt;BR /&gt;
&lt;BR /&gt;
  I do think, however, that you are confusing OUTPUT and INPUT. INPUT data is what you read -into- a SAS dataset, then you do some analysis or graphing with the SAS dataset and then you create OUTPUT--either an OUTPUT dataset or an OUTPUT report.&lt;BR /&gt;
&lt;BR /&gt;
  My original understanding was that your INPUT data looked like any of these previous examples you have posted:&lt;BR /&gt;
Initial INPUT on Jan 13:&lt;BR /&gt;
[pre]&lt;BR /&gt;
1 abc&lt;BR /&gt;
1 def&lt;BR /&gt;
2 efg&lt;BR /&gt;
2 ghi&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                 &lt;BR /&gt;
Initial desired OUTPUT on Jan 13:&lt;BR /&gt;
[pre]&lt;BR /&gt;
1 abc&lt;BR /&gt;
   def&lt;BR /&gt;
2 efg&lt;BR /&gt;
   ghi&lt;BR /&gt;
[/pre]&lt;BR /&gt;
          &lt;BR /&gt;
Then, you posted slightly different input data on Jan 13, Jan 14, Jan 19 and now, today, you say that you have INPUT that, to me, looks very like the OUTPUT you said you wanted.&lt;BR /&gt;
&lt;BR /&gt;
The way I read your post, you said that (I cleaned up the line breaks)&lt;BR /&gt;
" I have my &lt;B&gt;&lt;U&gt;output&lt;/U&gt;&lt;/B&gt; looking like this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
  Id   Txt&lt;BR /&gt;
  1  Class   &lt;BR /&gt;
      ABC is my class&lt;BR /&gt;
  Teacher &lt;BR /&gt;
      DEF is my teacher&lt;BR /&gt;
[/pre]&lt;BR /&gt;
               &lt;BR /&gt;
And then your post continues with: &lt;BR /&gt;
  "I was thinking of using a MERGE BY to merge all these 4 separate records into one. But for that I need to have ID on each of these 4 records and currently the ID is missing in the last 3."     &lt;BR /&gt;
&lt;BR /&gt;
To which I respond, HUH???? What happened to your original INPUT data that you showed us where ID was on every row in the original INPUT dataset -- back on Jan 13 or 14?????  Why would you use your OUTPUT to do any type of MERGE at all???&lt;BR /&gt;
&lt;BR /&gt;
I am so confused by what you have, what your INPUT really looks like, how you're reading that INPUT data and what OUTPUT you want.&lt;BR /&gt;
&lt;BR /&gt;
Now you want to merge the OUTPUT back into a form that looks like the original INPUT you showed us on Jan 13??? I am thoroughly confused.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 20 Jan 2011 23:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62306#M13574</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-01-20T23:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62307#M13575</link>
      <description>Let me explain again. I tried to simplify the data wherever possible earlier.My I/P data looks like this and there are many otehr columns but they do not matter for my O/P.In my I/P shown below all the 4 are separate records.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Id  Type          Txt&lt;BR /&gt;
1   Class        ABC is my Class &lt;BR /&gt;
1   Class        I like my class&lt;BR /&gt;
1  Teacher       DEF is my teacher&lt;BR /&gt;
1   Teacher      DEF is my teacher&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
There could be multiple rows for each of the TYPE's but I have shown only 2 per TYPE for simplicity. &lt;BR /&gt;
When I say I need my O/P as below, I mean one record per ID, with a heading to differentiate between the various TYPE's.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
ID    Text &lt;BR /&gt;
1     Class &lt;BR /&gt;        ----&amp;gt;HEading&lt;BR /&gt;
      ABC is my class &lt;BR /&gt;  &lt;BR /&gt;
      I like my class &lt;BR /&gt;&lt;BR /&gt;
      Teacher   &lt;BR /&gt;        ---&amp;gt; Another heading &lt;BR /&gt;
      DEF is my teacher &lt;BR /&gt;&lt;BR /&gt;
      I like my teacher  &lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;
I first did a transpose on my I/P by ID and Txt AND var as Txt. Then I used Then i used the  allTxt = catx("&lt;BR /&gt;", of txt:). And then I used the code below to get a heading for each type. &lt;BR /&gt;
data temp;&lt;BR /&gt;
set temp;&lt;BR /&gt;
_txt = txt;&lt;BR /&gt;
txt = type;&lt;BR /&gt;
if id eq lag(id) then call missing(id);&lt;BR /&gt;
output;&lt;BR /&gt;
txt = _txt;&lt;BR /&gt;
call misiing(id);&lt;BR /&gt;
output;&lt;BR /&gt;
drop _txt type;&lt;BR /&gt;
run; &lt;BR /&gt;
&lt;BR /&gt;
Now what I have achieved till now is given below, which are 4 separate records and I would like to merge them into one. &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Id   Text&lt;BR /&gt;
1    Class     ----&amp;gt; HEading is a separate record.&lt;BR /&gt;
     Abc is my class&lt;BR /&gt; I like my class -&amp;gt;2'nd record&lt;BR /&gt;
     Teacher -----&amp;gt; Anotehr heading a 3'rd record&lt;BR /&gt;
     DEF is my teacher&lt;BR /&gt;I like my teacher-&amp;gt; 4'th record&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Here the id is not populated in the last 3 records. Now if I have to merge BY id , I would need the id in all records. So can I make a change to the code I posted above so that I get an ID in my output for every record.&lt;BR /&gt;
&lt;BR /&gt;
 Thank you!&lt;BR /&gt;
I have no idea why my post looks like this!!

Message was edited by: sasnewbee</description>
      <pubDate>Fri, 21 Jan 2011 03:04:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62307#M13575</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-21T03:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Vertical Concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62308#M13576</link>
      <description>Hi.&lt;BR /&gt;
&amp;gt;However the ID is not populate in the last 3 records.&lt;BR /&gt;
&lt;BR /&gt;
If you want these id, can remove 'call missing' statement.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data temp;&lt;BR /&gt;
input ID $ Type $ Txt &amp;amp; $20.;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 Class ABC is my class&lt;BR /&gt;
1 Teacher DEF is my teacher&lt;BR /&gt;
2 cClass aABC is my class&lt;BR /&gt;
2 tTeacher dDEF is my teacher&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
data temp;&lt;BR /&gt;
 set temp;&lt;BR /&gt;
 _txt=txt;&lt;BR /&gt;
 txt=type; &lt;BR /&gt;
 output;&lt;BR /&gt;
 txt=_txt;&lt;BR /&gt;
 output;&lt;BR /&gt;
 drop _txt type;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Fri, 21 Jan 2011 03:26:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Vertical-Concatenation/m-p/62308#M13576</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-01-21T03:26:14Z</dc:date>
    </item>
  </channel>
</rss>

