<?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 Reading a Txt file that is all one line of consistant data. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247407#M46388</link>
    <description>&lt;P&gt;Hello there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm a little stuck and was sondering if someone had a solution to my problem. Im on version 9.3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a text file that contains account numbers. These account numbers are all 16 digits long but are all in one row in the text file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My question is, is there a way to create an observation for each of the 16 digit account numbers&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so 1234567887654321&lt;SPAN&gt;1234567887654321&lt;/SPAN&gt;&lt;SPAN&gt;1234567887654321&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;would become&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1234567887654321&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1234567887654321&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1234567887654321&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Many thanks in advance for any help&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Feb 2016 11:00:30 GMT</pubDate>
    <dc:creator>Stretlow</dc:creator>
    <dc:date>2016-02-02T11:00:30Z</dc:date>
    <item>
      <title>Reading a Txt file that is all one line of consistant data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247407#M46388</link>
      <description>&lt;P&gt;Hello there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm a little stuck and was sondering if someone had a solution to my problem. Im on version 9.3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a text file that contains account numbers. These account numbers are all 16 digits long but are all in one row in the text file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My question is, is there a way to create an observation for each of the 16 digit account numbers&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so 1234567887654321&lt;SPAN&gt;1234567887654321&lt;/SPAN&gt;&lt;SPAN&gt;1234567887654321&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;would become&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1234567887654321&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1234567887654321&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1234567887654321&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Many thanks in advance for any help&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 11:00:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247407#M46388</guid>
      <dc:creator>Stretlow</dc:creator>
      <dc:date>2016-02-02T11:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a Txt file that is all one line of consistant data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247409#M46389</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want (keep=accountid);
infile 'path' lrecl=32000;
length line_in $ 32000;
input;
line_in = _infile_;
i = 1;
do until i &amp;gt; length(line_in)
  accountid = substr(line_in,i,16);
  output;
  i = i + 16;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now, if you have no records at all (the file being one quasi-infinite stream):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile 'path' lrecl=16 recfm=f;
input accountid $16.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Feb 2016 11:37:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247409#M46389</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-02T11:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a Txt file that is all one line of consistant data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247410#M46390</link>
      <description>&lt;P&gt;Well, you can read the file one character at a time, then an if statement to check length:&lt;/P&gt;
&lt;PRE&gt;data want (drop=chr);
  length id $16;
  retain id;
  infile "s:\temp\rob\tmp.txt" recfm=n;
  input chr $char1.;
  id=cats(id,chr);
  if lengthn(id)=16 then do;
    output;
    id="";
  end;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Feb 2016 11:39:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247410#M46390</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-02-02T11:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a Txt file that is all one line of consistant data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247413#M46391</link>
      <description>data want;&lt;BR /&gt;infile 'path' lrecl=16 recfm=f;&lt;BR /&gt;input accountid $16.;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;this worked except I had to remove &lt;BR /&gt;lrecl=16 recfm=f;&lt;BR /&gt;&lt;BR /&gt;otherwise it didnt keep 16 for each record (some were 15)</description>
      <pubDate>Tue, 02 Feb 2016 11:50:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247413#M46391</guid>
      <dc:creator>Stretlow</dc:creator>
      <dc:date>2016-02-02T11:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a Txt file that is all one line of consistant data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247415#M46392</link>
      <description>&lt;P&gt;Thank you for your swift responses on this, its appreciated&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 11:52:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247415#M46392</guid>
      <dc:creator>Stretlow</dc:creator>
      <dc:date>2016-02-02T11:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a Txt file that is all one line of consistant data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247419#M46394</link>
      <description>&lt;P&gt;Show the log messages from both with and without LRECL and RECFM.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Seems to me that you may have record separaters that you are not aware and or other file qualities that you don't know.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 11:59:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247419#M46394</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-02-02T11:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a Txt file that is all one line of consistant data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247434#M46399</link>
      <description>&lt;P&gt;In this case, I would take a more in-depth look at the file with a tool that shows all bytes (hexedit, hexdump or anything similar). It seems that you do have something that SAS treats as line separators.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 12:31:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247434#M46399</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-02T12:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a Txt file that is all one line of consistant data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247465#M46416</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;In this case, I would take a more in-depth look at the file with a tool that shows all bytes (hexedit, hexdump or anything similar). It seems that you do have something that SAS treats as line separators.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;SAS has tools for that too. &amp;nbsp;One being the LIST; statement.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 14:13:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-Txt-file-that-is-all-one-line-of-consistant-data/m-p/247465#M46416</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-02-02T14:13:33Z</dc:date>
    </item>
  </channel>
</rss>

