<?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 convert tabs, line feeds, etc. in a long text field (32767 bytes) to html line feed character &amp;lt;BR/&amp;gt; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130848#M26682</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To replace the a tab with a space you translate (or tranwrd) and you will not have any trouble as there will be no change in the length of the string.&amp;nbsp; VAR=TRANSLATE(VAR,' ','09'x) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To generate the &amp;lt;BR/&amp;gt; on the output to replace the linefeed you will could have issues using TRANWRD() function because the result could be longer than the maximum length of a string.&amp;nbsp; One way to prevent this is to process the variable character by character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do _n_=1 to length(var) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; _char_=substr(var,_n_,1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if _char_='0A'x then put '&amp;lt;BR/&amp;gt;' @;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else put _char_ $char1. @;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 May 2013 19:17:52 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2013-05-06T19:17:52Z</dc:date>
    <item>
      <title>How to convert tabs, line feeds, etc. in a long text field (32767 bytes) to html line feed character &lt;BR/&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130845#M26679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have a series of files that we need to export to tab delimited files each month.&amp;nbsp; The process is seamless using PROC EXPORT except for this one file that has the giant variable in it.&amp;nbsp; Because there are embedded tabs (non-printing) in the variable, (plus its length exceeds the LRECL allowed in PROC EXPORT), exported to a tab delimited file does not work.&amp;nbsp; Because this field will be displayed on a web site, we need to retain the functionality of actual line breaks, while removing the tabs so we can transfer the data.&amp;nbsp; So far, no luck with TRANWRD or COMPRESS - although you can use COMPRESS to remove ALL "space" characters, that also removes the blanks between works and doesn't give us the line breaks.&amp;nbsp; Any thoughts?&amp;nbsp; TIA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Louise&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 May 2013 18:59:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130845#M26679</guid>
      <dc:creator>louisehadden</dc:creator>
      <dc:date>2013-05-06T18:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert tabs, line feeds, etc. in a long text field (32767 bytes) to html line feed character &lt;BR/&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130846#M26680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure what you want,&amp;nbsp; but you can easily generate TAB delimited file using a DATA step.&lt;/P&gt;&lt;P&gt;For example if you do not need header line it is a simple as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file .... dlm='09'x dsd ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input (_all_) (:) ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you want to happen differently?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 May 2013 19:04:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130846#M26680</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-05-06T19:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert tabs, line feeds, etc. in a long text field (32767 bytes) to html line feed character &lt;BR/&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130847#M26681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this part working fine using a data step.&amp;nbsp; What I can't do is "fix" the long variable by replacing the embedded tabs with a space and replacing the embedded line feeds (both non printing characters) with an html line break &amp;lt;BR/&amp;gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 May 2013 19:06:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130847#M26681</guid>
      <dc:creator>louisehadden</dc:creator>
      <dc:date>2013-05-06T19:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert tabs, line feeds, etc. in a long text field (32767 bytes) to html line feed character &lt;BR/&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130848#M26682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To replace the a tab with a space you translate (or tranwrd) and you will not have any trouble as there will be no change in the length of the string.&amp;nbsp; VAR=TRANSLATE(VAR,' ','09'x) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To generate the &amp;lt;BR/&amp;gt; on the output to replace the linefeed you will could have issues using TRANWRD() function because the result could be longer than the maximum length of a string.&amp;nbsp; One way to prevent this is to process the variable character by character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do _n_=1 to length(var) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; _char_=substr(var,_n_,1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if _char_='0A'x then put '&amp;lt;BR/&amp;gt;' @;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else put _char_ $char1. @;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 May 2013 19:17:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130848#M26682</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-05-06T19:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert tabs, line feeds, etc. in a long text field (32767 bytes) to html line feed character &lt;BR/&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130849#M26683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, this is giving me a partial solution!&amp;nbsp; I still have problems with double quotes and double line feeds, but the end of the tunnel is in sight!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 May 2013 20:16:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130849#M26683</guid>
      <dc:creator>louisehadden</dc:creator>
      <dc:date>2013-05-06T20:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert tabs, line feeds, etc. in a long text field (32767 bytes) to html line feed character &lt;BR/&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130850#M26684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PROC EXPORT should honor the LRECL of a FILEREF but it does not.&amp;nbsp; If you run this, the generated code has LRECL=32767 on the FILE statement.&amp;nbsp; That sounds like the buzzing a a bug to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; out &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'~/lrecl.txt'&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;lrecl&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;&lt;STRONG&gt;47802&lt;/STRONG&gt;&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;export&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;outfile&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=out &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=sashelp.class &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;dbms&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=tab;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; background-color: #ffffff;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 May 2013 20:24:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130850#M26684</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-05-06T20:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert tabs, line feeds, etc. in a long text field (32767 bytes) to html line feed character &lt;BR/&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130851#M26685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Normally (at least in the SAS world) you would double the double quotes in the string when you are using double quotes around the string.&amp;nbsp; So you could add&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else if _char_='"' then put '""' @ ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;before the ELSE clause to handle that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure what multiple LF is about, but you could fix that with TRANWRD()&amp;nbsp; as it will only make the value shorter.&amp;nbsp; But it would miss when there is space or other characters between them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VAR = TRANWRD(VAR,'0A0A'x,'0A'x)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 May 2013 20:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130851#M26685</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-05-06T20:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert tabs, line feeds, etc. in a long text field (32767 bytes) to html line feed character &lt;BR/&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130852#M26686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I submitted this issue to tech support but it was pretty clear they both knew about it and weren't going to change it.&amp;nbsp; That issue is solved by using a data step which DOES support the longer file length.&amp;nbsp; My problem is the delimited requested (tabs) and the fact that the delimiter is embedded in that one long text field!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 May 2013 22:50:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130852#M26686</guid>
      <dc:creator>louisehadden</dc:creator>
      <dc:date>2013-05-06T22:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert tabs, line feeds, etc. in a long text field (32767 bytes) to html line feed character &lt;BR/&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130853#M26687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The field is created in an entry screen in some unknown (to me) software - there are definitely non-printing line feeds, tabs, and who knows what else in the field along with the double quotes.&amp;nbsp; We redact all PII from the text field before it gets put out using Perl regular expressions.&amp;nbsp; There may be a solution there...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 May 2013 22:52:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130853#M26687</guid>
      <dc:creator>louisehadden</dc:creator>
      <dc:date>2013-05-06T22:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert tabs, line feeds, etc. in a long text field (32767 bytes) to html line feed character &lt;BR/&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130854#M26688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or consider using Perl Regular Expression.&lt;/P&gt;&lt;P&gt;prxchange()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 01:59:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-tabs-line-feeds-etc-in-a-long-text-field-32767/m-p/130854#M26688</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-05-07T01:59:45Z</dc:date>
    </item>
  </channel>
</rss>

