<?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: Lrecl and Extra Pipeline in SAS output in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/398760#M25634</link>
    <description>&lt;P&gt;Although &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32246"&gt;@ChrisBrooks&lt;/a&gt;&amp;nbsp;gives you the solution, for your information here's a useful tip.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When SAS sees a very long character string, the possibility has arisen that you've forgotten an end "quote", so it throws that warning. It has nothing to do with your output file, it's just because of your long heading row string. You can get rid of it by surrounding your code with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options&amp;nbsp; noquotelenmax;&lt;BR /&gt;options&amp;nbsp; quotelenmax;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
    <pubDate>Tue, 26 Sep 2017 10:33:20 GMT</pubDate>
    <dc:creator>TomKari</dc:creator>
    <dc:date>2017-09-26T10:33:20Z</dc:date>
    <item>
      <title>Lrecl and Extra Pipeline in SAS output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/398750#M25631</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 2 questions from the code below. I am trying to produce output into textfile with pipeline delimeter. The output does not match with my expectation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My sample code is as per below:&lt;/P&gt;
&lt;P&gt;　&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;try;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt; &lt;FONT color="#008080" face="Courier New" size="3"&gt;acc.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;amp;try &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;nobs&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=j &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=eod;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;file&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"C:\TRY\&amp;amp;out_rpt..txt"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;lrecl&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;300&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;dlm&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'|'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; _n_ = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; @&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;'VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|VAR1|system|VAR1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; @&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; VAR1 &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;VAR1&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; _n_=j &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; @&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;'TOTAL ACCOUNT : | '&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; j &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'|'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;I encounter 1 warning stating that &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;WARNING: The quoted string currently being processed has become more than 262 characters long. You might have unbalanced quotation&lt;/P&gt;
&lt;P&gt;marks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1)After I already specify LRECL = 300, why does the warning appear?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) The output from above code shows that, there is extra pipeline after total obs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Total Account : | 10 ||&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance to whoever&amp;nbsp;that willing to help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 09:19:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/398750#M25631</guid>
      <dc:creator>Hhh111</dc:creator>
      <dc:date>2017-09-26T09:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Lrecl and Extra Pipeline in SAS output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/398755#M25633</link>
      <description>&lt;P&gt;To be honest I think you're just making life hard for yourself by using a data step here - Proc Export is much simpler&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc export data=sashelp.class
   outfile='/folders/myshortcuts/Dropbox/class.ppe'
   dbms=dlm; 
   delimiter='|';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Sep 2017 09:50:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/398755#M25633</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-09-26T09:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Lrecl and Extra Pipeline in SAS output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/398760#M25634</link>
      <description>&lt;P&gt;Although &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32246"&gt;@ChrisBrooks&lt;/a&gt;&amp;nbsp;gives you the solution, for your information here's a useful tip.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When SAS sees a very long character string, the possibility has arisen that you've forgotten an end "quote", so it throws that warning. It has nothing to do with your output file, it's just because of your long heading row string. You can get rid of it by surrounding your code with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options&amp;nbsp; noquotelenmax;&lt;BR /&gt;options&amp;nbsp; quotelenmax;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 10:33:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/398760#M25634</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-09-26T10:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Lrecl and Extra Pipeline in SAS output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/398779#M25635</link>
      <description>&lt;P&gt;For question 2: SAS automatically adds a delimiter after a variable in the put list, so you get an extra delimiter.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 12:49:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/398779#M25635</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-09-26T12:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Lrecl and Extra Pipeline in SAS output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/399043#M25651</link>
      <description>&lt;P&gt;Yes, Proc export will be easier. However, because I have&amp;nbsp;to hardcode things at the footer, so thats why I write the code that way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe I need to use proc export for the beginning part. And for the footer, I just write and use function MOD to append in the existing output. Is that possible?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, thanks for the suggestion!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 06:26:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/399043#M25651</guid>
      <dc:creator>Hhh111</dc:creator>
      <dc:date>2017-09-27T06:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Lrecl and Extra Pipeline in SAS output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/399055#M25653</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45239"&gt;@Hhh111&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Yes, Proc export will be easier. However, because I have&amp;nbsp;to hardcode things at the footer, so thats why I write the code that way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe I need to use proc export for the beginning part. And for the footer, I just write and use function MOD to append in the existing output. Is that possible?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes. Create a file reference first, use that in proc export for the output file, and then use it in a data step with mod. Text from the data step will be appended. After all, we're dealing with a plain text file here, so appending is no problem.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 07:35:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/399055#M25653</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-09-27T07:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Lrecl and Extra Pipeline in SAS output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/399376#M25675</link>
      <description>&lt;P&gt;Thanks for the input sir. The output looking good now. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 02:22:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/399376#M25675</guid>
      <dc:creator>Hhh111</dc:creator>
      <dc:date>2017-09-28T02:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Lrecl and Extra Pipeline in SAS output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/399377#M25676</link>
      <description>&lt;P&gt;Thanks. I already add that in my code.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 02:23:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/399377#M25676</guid>
      <dc:creator>Hhh111</dc:creator>
      <dc:date>2017-09-28T02:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Lrecl and Extra Pipeline in SAS output</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/399400#M25677</link>
      <description>&lt;P&gt;You can get PROC EXPORT to write the main file and just add the footer.&lt;/P&gt;
&lt;P&gt;But that can be tricky if you wnat the variables in a different order than they exist in the dataset.&lt;/P&gt;
&lt;P&gt;Why not let SAS write the variable names instead of putting them into a string?&amp;nbsp; Then you don't need to worry that it might be longer than 262 characters.&amp;nbsp; It is easy to use PROC TRANSPOSE to generate a dataset with one record per variable name.&amp;nbsp; Note that your list of variable names could even use SAS variable list features like VAR3-VAR5 as shorthand for VAR3 VAR4 VAR5.&amp;nbsp; Note that 300 seems like an pretty short length to set for your LRECL for outputting an unknown number of variables. Better to set it larger than you really need. 32K is reasonable default, but the FILE statement will support 1000000 or larger depending on your hardware.&amp;nbsp; Really not much penalty for setting it too large as SAS will only write the number of characters it needs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let varlist=VAR1 VAR3-VAR8 VAR234 ;
%let dsn=acc.&amp;amp;try ;

proc transpose data=&amp;amp;dsn (obs=0) out=names ;
  var &amp;amp;varlist;
run;

data _null_;
   set names ;
   file "C:\TRY\&amp;amp;out_rpt..txt" lrecl=32767 dlm='|' dsd ;
   put _name_ @ ;
run;
data _null_;
   set &amp;amp;dsn end=eof ;
   file "C:\TRY\&amp;amp;out_rpt..txt" lrecl=32767 dlm='|' dsd MOD ;
   put (&amp;amp;varlist) (+0) ;
   if eof then put 'TOTAL ACCOUNT : |' _n_ ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 04:45:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lrecl-and-Extra-Pipeline-in-SAS-output/m-p/399400#M25677</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-09-28T04:45:19Z</dc:date>
    </item>
  </channel>
</rss>

