<?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: Problem importing a txt-file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416896#M102382</link>
    <description>&lt;P&gt;&amp;nbsp;Try setting LRECL to a large number - with 360 variables you might be beyond the default length.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Nov 2017 21:32:02 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-11-28T21:32:02Z</dc:date>
    <item>
      <title>Problem importing a txt-file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416876#M102372</link>
      <description>&lt;P&gt;To whom it may concern,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been trying to import the attached .txt file into SAS using the code below. For some reason, I encounter a problem after var26&amp;nbsp;whereby some of the remaining variables in my input file either get set to blank or do not get picked up at all. Can someone please provide some insight?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data rates1;&lt;BR /&gt;&amp;nbsp;infile "/Pathname/InterestRates.txt" delimiter='09'x;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;input var1-var360;&lt;BR /&gt;&amp;nbsp;format var1-var360 best32.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc print data=rates1;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 20:49:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416876#M102372</guid>
      <dc:creator>maroulator</dc:creator>
      <dc:date>2017-11-28T20:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem importing a txt-file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416884#M102374</link>
      <description>Have you tried adding the MISSOVER or TRUNCOVER option to your INFILE statement?</description>
      <pubDate>Tue, 28 Nov 2017 21:05:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416884#M102374</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-28T21:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem importing a txt-file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416891#M102379</link>
      <description>&lt;P&gt;I have; my problem persists.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 21:14:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416891#M102379</guid>
      <dc:creator>maroulator</dc:creator>
      <dc:date>2017-11-28T21:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem importing a txt-file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416896#M102382</link>
      <description>&lt;P&gt;&amp;nbsp;Try setting LRECL to a large number - with 360 variables you might be beyond the default length.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 21:32:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416896#M102382</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-28T21:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem importing a txt-file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416898#M102383</link>
      <description>&lt;P&gt;I tried that earlier; the infile statement in the original version of my&amp;nbsp;code looked like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;infile '/Pathname/InterestRates.txt' dlm='&amp;nbsp; ' TRUNCOVER MISSOVER lrecl=32767;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem persists&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 21:44:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416898#M102383</guid>
      <dc:creator>maroulator</dc:creator>
      <dc:date>2017-11-28T21:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem importing a txt-file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416900#M102385</link>
      <description>&lt;P&gt;The beginning of the file has spaces between the values and then later it appears to have tabs instead.&lt;/P&gt;
&lt;P&gt;You can just tell SAS to use either as the delimiter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;12    data want ;
13      infile 'C:\Downloads\DataSample.txt' dsd dlm='2009'x truncover ;
14      input v1-v360 ;
15    run;

NOTE: The infile 'C:\Downloads\DataSample.txt' is:
      Filename=C:\Downloads\DataSample.txt,
      RECFM=V,LRECL=32767,File Size (bytes)=4275,
      Last Modified=28Nov2017:16:49:50,
      Create Time=28Nov2017:16:49:50

NOTE: 1 record was read from the infile 'C:\Downloads\DataSample.txt'.
&lt;/PRE&gt;
&lt;P&gt;Or skip the DSD and DLM options and just use the EXPANDTABS option to convert the tabs into spaces.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile 'C:\Downloads\DataSample.txt' expandtabs truncover ;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 22:27:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416900#M102385</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-11-28T22:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem importing a txt-file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416903#M102387</link>
      <description>&lt;P&gt;Hi Tom, thanks for the reply. Just to clarify, how did you notice the two different delimiters in the input file? Just by eye-balling it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2017 22:27:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416903#M102387</guid>
      <dc:creator>maroulator</dc:creator>
      <dc:date>2017-11-28T22:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem importing a txt-file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416904#M102388</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/34545"&gt;@maroulator&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi Tom, thanks for the reply. Just to clarify, how did you notice the two different delimiters in the input file? Just by eye-balling it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;SAS told me. It told me where to look and showed me what was there.&lt;/P&gt;
&lt;PRE&gt;NOTE: Invalid data for v26 in line 1 295-401.
NOTE: Invalid data for v52 in line 1 698-766.
NOTE: Invalid data for v167 in line 1 2126-2158.
NOTE: Invalid data for v168 in line 1 2160-2181.
NOTE: Invalid data for v233 in line 1 2942-2963.
RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+--
1         1.411895789 1.44330829 1.49552952 1.55391441 1.59009382 1.614501576 1.637530421 1.665363942 1.691
      98  646417 1.715162301 1.736882051 1.757064002 1.775726446 1.79324709 1.809712927 1.824861859 1.83894
     195  1566 1.852194997 1.864628077 1.876424783 1.887605005 1.898214444 1.908246467 1.91791298 1.9274829

     292  53 1.937397302.1.946735819.1.955412166.1.963517714.1.971163054.1.978439641.1.985382543.1.99200438
    ZONE  3323233333333303233333333303233333333303233333333303233333333303233333333303233333333303233333333
    NUMR  5301E93739730291E94673581991E95541216691E96351771491E97116305491E97843964191E98538254391E99200438

&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Nov 2017 22:29:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-importing-a-txt-file/m-p/416904#M102388</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-11-28T22:29:21Z</dc:date>
    </item>
  </channel>
</rss>

