<?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 create a text file with fixed length in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311129#M67157</link>
    <description>&lt;P&gt;See the example here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/faq/write_fixedformat.htm" target="_blank"&gt;http://www.ats.ucla.edu/stat/sas/faq/write_fixedformat.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Determining the locations (@#) is based on length which can be obtained from dictionary tables or proc contents.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 12 Nov 2016 04:31:42 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-11-12T04:31:42Z</dc:date>
    <item>
      <title>How to create a text file with fixed length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311118#M67153</link>
      <description>&lt;P&gt;Hi I have 3 SAS datasets, each having 75 variables.&amp;nbsp; I need to create them in text file with fixed lengths.&amp;nbsp; What is the best&amp;nbsp;way to do that?&lt;/P&gt;
&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2016 03:44:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311118#M67153</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2016-11-12T03:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a text file with fixed length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311125#M67155</link>
      <description>&lt;P&gt;A customized data step.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use use the info from sashelp.vcolumns (length/type/format) to help generate the info required for the code...or even the code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2016 04:24:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311125#M67155</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-12T04:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a text file with fixed length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311128#M67156</link>
      <description>&lt;P&gt;Thank you Reeza,&amp;nbsp; but how do I now integrate this into a code?&lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2016 04:29:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311128#M67156</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2016-11-12T04:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a text file with fixed length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311129#M67157</link>
      <description>&lt;P&gt;See the example here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/faq/write_fixedformat.htm" target="_blank"&gt;http://www.ats.ucla.edu/stat/sas/faq/write_fixedformat.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Determining the locations (@#) is based on length which can be obtained from dictionary tables or proc contents.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2016 04:31:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311129#M67157</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-12T04:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a text file with fixed length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311138#M67160</link>
      <description>&lt;P&gt;What do you mean by fixed length. Can you post an example ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename x 'c:\temp\x.csv' ;
data _null_;
set sashelp.class;
 file x ;
 length temp $ 40;
 temp=catx(',',of _all_);
 len=40;
 put temp $varying40. len;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5808iA101226DE6D38A72/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="x.png" title="x.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2016 06:26:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311138#M67160</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-12T06:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a text file with fixed length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311149#M67164</link>
      <description>&lt;P&gt;PUT statement default behaviour for a list of variables would place single blanks (default delimiter) between vars.&lt;BR /&gt;Consider the brevity of:&lt;BR /&gt;FILE "YOUR FILE.CSV" DSD LRECL=1000 ;&lt;BR /&gt;PUT (_ALL_)( : ) ;&lt;BR /&gt;One way to achieve fixed layout would be to specify the formats with widths for each variable in the PUT.&lt;BR /&gt;It makes a fine example for use of the dictionary.columns metadata.&lt;BR /&gt;Just one question ... what default format/width would you wish for numeric values with no defined format?&lt;BR /&gt;The default BEST12. provides floating point notation for large numeric values.....&lt;BR /&gt;Once the required choices of width are clarified, a bit of SQL and a simple data step could be written by a student.&lt;BR /&gt;In a fixed layout, delimiters would not be needed, but might reduce any importer's need for proper definition of the column layout.&lt;BR /&gt;I believe the fixed positions layout would probably be faster to import than traditional csv ... (less cpu time, but more expensive in disk space and i/o) but any benefit will only become apparent for very large data.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2016 08:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311149#M67164</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2016-11-12T08:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a text file with fixed length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311155#M67166</link>
      <description>&lt;P&gt;I have no idea.. it's a request from someone that it must be fixed length.&amp;nbsp; So here's what I did:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;filename&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; out_pipe &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"P:\Data\new_bo1.txt"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;_null_&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; pdrive.new_bor1;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;file&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; out_pipe; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;put&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"|"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; ACEAmount&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"|"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; ACEDate.....&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;run;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2016 13:31:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311155#M67166</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2016-11-12T13:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a text file with fixed length</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311170#M67173</link>
      <description>&lt;P&gt;Use formatted output&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put
  x1 $10.
  x2 $20.
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will result in lines of length 30.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Nov 2016 15:25:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-text-file-with-fixed-length/m-p/311170#M67173</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-12T15:25:12Z</dc:date>
    </item>
  </channel>
</rss>

