<?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 read this .txt file into SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-this-txt-file-into-SAS/m-p/358159#M274366</link>
    <description>&lt;P&gt;The obvious question here is, of course: what are you planning to do with SAS code in a dataset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reading just text into a dataset is simple:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data textdata;
infile "textfile" truncover;
input textline $100.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;After that step has run, check for maximum length of textline. If that is equal to the defined length, increase the format in the input statement; if length exceeds 254, als set a corresponding lrecl in the infile statement. Once you find that max(length(textline)) is smaller than the defined length, you can be sure that all text is read.&lt;/P&gt;
&lt;P&gt;With large length values and nobs &amp;gt; several thousand, use the compress=yes option on the dataset.&lt;/P&gt;</description>
    <pubDate>Fri, 12 May 2017 06:49:23 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-05-12T06:49:23Z</dc:date>
    <item>
      <title>how to read this .txt file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-this-txt-file-into-SAS/m-p/358097#M274364</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a .txt file abc.txt:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;/*Program name newcode.sas*/&lt;BR /&gt;/*This SAS program will print sashelp.class*/&lt;BR /&gt;proc print data=sashelp.class;&lt;BR /&gt;run;&lt;BR /&gt;data a;&lt;BR /&gt;"set sashelp.class;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How I can read it in to SAS dataset?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 02:56:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-this-txt-file-into-SAS/m-p/358097#M274364</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2017-05-12T02:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to read this .txt file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-this-txt-file-into-SAS/m-p/358101#M274365</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10531"&gt;@GeorgeSAS&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think this is related to your last question. Lookup %include&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 03:00:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-this-txt-file-into-SAS/m-p/358101#M274365</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-05-12T03:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to read this .txt file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-this-txt-file-into-SAS/m-p/358159#M274366</link>
      <description>&lt;P&gt;The obvious question here is, of course: what are you planning to do with SAS code in a dataset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reading just text into a dataset is simple:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data textdata;
infile "textfile" truncover;
input textline $100.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;After that step has run, check for maximum length of textline. If that is equal to the defined length, increase the format in the input statement; if length exceeds 254, als set a corresponding lrecl in the infile statement. Once you find that max(length(textline)) is smaller than the defined length, you can be sure that all text is read.&lt;/P&gt;
&lt;P&gt;With large length values and nobs &amp;gt; several thousand, use the compress=yes option on the dataset.&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 06:49:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-this-txt-file-into-SAS/m-p/358159#M274366</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-12T06:49:23Z</dc:date>
    </item>
  </channel>
</rss>

