<?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 Raw txt File in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Raw-txt-File/m-p/232308#M42342</link>
    <description>&lt;P&gt;Hi mates,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to read a raw datafile just like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Joe Smith&lt;/P&gt;
&lt;P&gt;20 M 35000 BS&lt;/P&gt;
&lt;P&gt;Jane Doe&lt;/P&gt;
&lt;P&gt;24 F 50000 MS&lt;/P&gt;
&lt;P&gt;Matt Brown&lt;/P&gt;
&lt;P&gt;30 M 65500 HS&lt;/P&gt;
&lt;P&gt;Mike Johnson&lt;/P&gt;
&lt;P&gt;55 M 85000 PhD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tryed the following code but doesn't work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
 infile "path/test.txt";
 length fname $6 lname $10 sex $1 education $3;
 informat lname $10. income 7.;
 input fname 1-6 @7 lname /
 age 1-3 sex +1 income @14 education;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The code is from this link:&amp;nbsp;&lt;A href="http://www.lexjansen.com/nesug/nesug08/ff/ff01.pdf" target="_blank"&gt;http://www.lexjansen.com/nesug/nesug08/ff/ff01.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need a way to tell the input statement when it needs to read the next line, how can i do that ? I forgot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Oct 2015 19:18:14 GMT</pubDate>
    <dc:creator>DartRodrigo</dc:creator>
    <dc:date>2015-10-29T19:18:14Z</dc:date>
    <item>
      <title>Raw txt File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Raw-txt-File/m-p/232308#M42342</link>
      <description>&lt;P&gt;Hi mates,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to read a raw datafile just like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Joe Smith&lt;/P&gt;
&lt;P&gt;20 M 35000 BS&lt;/P&gt;
&lt;P&gt;Jane Doe&lt;/P&gt;
&lt;P&gt;24 F 50000 MS&lt;/P&gt;
&lt;P&gt;Matt Brown&lt;/P&gt;
&lt;P&gt;30 M 65500 HS&lt;/P&gt;
&lt;P&gt;Mike Johnson&lt;/P&gt;
&lt;P&gt;55 M 85000 PhD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tryed the following code but doesn't work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
 infile "path/test.txt";
 length fname $6 lname $10 sex $1 education $3;
 informat lname $10. income 7.;
 input fname 1-6 @7 lname /
 age 1-3 sex +1 income @14 education;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The code is from this link:&amp;nbsp;&lt;A href="http://www.lexjansen.com/nesug/nesug08/ff/ff01.pdf" target="_blank"&gt;http://www.lexjansen.com/nesug/nesug08/ff/ff01.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need a way to tell the input statement when it needs to read the next line, how can i do that ? I forgot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 19:18:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Raw-txt-File/m-p/232308#M42342</guid>
      <dc:creator>DartRodrigo</dc:creator>
      <dc:date>2015-10-29T19:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Raw txt File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Raw-txt-File/m-p/232309#M42343</link>
      <description>&lt;P&gt;The documentation remembers&amp;nbsp;&lt;img id="womantongue" class="emoticon emoticon-womantongue" src="https://communities.sas.com/i/smilies/16x16_woman-tongue.png" alt="Woman Tongue" title="Woman Tongue" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a002001051.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a002001051.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 19:23:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Raw-txt-File/m-p/232309#M42343</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-10-29T19:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Raw txt File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Raw-txt-File/m-p/232315#M42344</link>
      <description>&lt;P&gt;Use list input:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
 length fname $6 lname $10 sex $1 education $3;
 input fname lname /
 age sex income education;
datalines;
Joe Smith
20 M 35000 BS
Jane Doe
24 F 50000 MS
Matt Brown
30 M 65500 HS
Mike Johnson
55 M 85000 PhD
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;although it might be safer to read the whole name since it might have more than two words:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new2;
 length name $24 sex $1 education $3;
 input name &amp;amp;/
 age sex income education;
datalines;
Joe Smith
20 M 35000 BS
Jane Doe
24 F 50000 MS
Matt Brown
30 M 65500 HS
Mike Johnson
55 M 85000 PhD
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Oct 2015 19:45:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Raw-txt-File/m-p/232315#M42344</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-10-29T19:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Raw txt File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Raw-txt-File/m-p/232337#M42351</link>
      <description>&lt;P&gt;Expect problems when you force reading fixed columns and your data may not:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; fname &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;-6&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;@&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;7&lt;/SPAN&gt; lname &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token operator"&gt;will &lt;STRONG&gt;always &lt;/STRONG&gt;read the first six columns for the first name but&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token operator"&gt;123456&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token operator"&gt;Joe Smith&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token operator"&gt;so first name likely ends up as "Joe Sm" and the last name starts with "ith" as the "i" is in the 7th column.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 21:50:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Raw-txt-File/m-p/232337#M42351</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-10-29T21:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Raw txt File</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Raw-txt-File/m-p/232438#M42365</link>
      <description>&lt;P&gt;PG,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What i need actually is to create a three positional input due the following txt file:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;F   015   3  20151029 019  0100             00000000000000 20151029 102004 20151029                     47,28     1530215000019
591 PAGAMENTO INCLU
019  0100             00000000000000 20151029 102155 20151029                    212,50     1530215000020
.   .
018  0023             00000000000000 20151029 103258 20151029                    538,85     1530215000021
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first line will start with the F in the column1, 015 in the column 2 and 3 in the column3, all the other values should match for the first row, but in the third row the "019" should be at the same position of "019" in the first line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To understant what i'm saying, the first textbox is how my raw file is in SAS, the second textbox bellow is represented on how the third row should begin:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;F   015   3  20151029 019  0100             00000000000000 20151029 102004 20151029                     47,28     1530215000019
591 PAGAMENTO INCLU
                      019  0100             00000000000000 20151029 102155 20151029                    212,50     1530215000020
.   .
                      018  0023             00000000000000 20151029 103258 20151029                    538,85     1530215000021
&lt;/PRE&gt;
&lt;P&gt;So what i want is to read the first and the second line and print the into the first line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The third row should begin to read or print the value at the same column of the "019" and put missing to the first 4 columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The final output i'm trying to make&amp;nbsp;is this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;F| 015| 3| 20151029   |   019 | 0100 | 00000000000000| 20151029 |102004| 20151029|   47,28     |1530215000019| 591| PAYMENT
 |    |  |            |   019 | 0100 | 00000000000000| 20151029 |102155| 20151029|  212,50     |1530215000020| 591| PAYMENT
 |    |  |            |   018 | 0023 | 00000012344534| 20151029 |103258| 20151029|  538,85     |1530215000021|    |
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But i'm having a lot trouble to make this.&lt;/P&gt;
&lt;P&gt;Can you help me ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2015 14:41:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Raw-txt-File/m-p/232438#M42365</guid>
      <dc:creator>DartRodrigo</dc:creator>
      <dc:date>2015-10-30T14:41:25Z</dc:date>
    </item>
  </channel>
</rss>

