<?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 infile error in sas9.4 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/infile-error-in-sas9-4/m-p/464465#M70506</link>
    <description>&lt;P&gt;This is my TXT file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;342082109&lt;BR /&gt;Amanie Edmon Dabit&lt;BR /&gt;eco&lt;BR /&gt;267615672&lt;BR /&gt;Jill Maret Daryan&lt;BR /&gt;phy male&amp;nbsp;&lt;BR /&gt;229872244&lt;BR /&gt;Edward lawre Dunlap&lt;/P&gt;&lt;P&gt;female&amp;nbsp;&lt;BR /&gt;429155167&lt;BR /&gt;Mark Jonathan Avery&lt;BR /&gt;phy male&lt;BR /&gt;585628122&lt;BR /&gt;Elea Christi Silver&lt;BR /&gt;eco&lt;BR /&gt;285915791&lt;BR /&gt;Noel Kennin Arnold&lt;BR /&gt;edu female&lt;BR /&gt;490922411&lt;BR /&gt;Christopher Emerson&lt;BR /&gt;law male&amp;nbsp;&lt;BR /&gt;576639096&lt;BR /&gt;Sonya Jane Taylor&lt;BR /&gt;law male&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;&lt;/P&gt;&lt;P&gt;and this is my code ;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data hw2.grade1_personal ;&lt;BR /&gt;infile 'filespecification.txt' firstobs=11 dlm='' missover ;&lt;BR /&gt;input #1 SSN 9.&lt;BR /&gt;#2 First $ 1-13 Middle $ 14-25 Last $ 26-35&lt;BR /&gt;#3 Major $ 7. Gender $ 8. ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought it was perfect for import data into sas data set ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but last observation always failed to fill the variable "" Last ""&amp;nbsp; the blue one .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="asdasd.PNG" style="width: 480px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20728iD302B3A0CA4F1D9F/image-size/large?v=v2&amp;amp;px=999" role="button" title="asdasd.PNG" alt="asdasd.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know why this problem happen ?&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;</description>
    <pubDate>Wed, 23 May 2018 17:18:45 GMT</pubDate>
    <dc:creator>LeeSeongWoo_</dc:creator>
    <dc:date>2018-05-23T17:18:45Z</dc:date>
    <item>
      <title>infile error in sas9.4</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/infile-error-in-sas9-4/m-p/464465#M70506</link>
      <description>&lt;P&gt;This is my TXT file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;342082109&lt;BR /&gt;Amanie Edmon Dabit&lt;BR /&gt;eco&lt;BR /&gt;267615672&lt;BR /&gt;Jill Maret Daryan&lt;BR /&gt;phy male&amp;nbsp;&lt;BR /&gt;229872244&lt;BR /&gt;Edward lawre Dunlap&lt;/P&gt;&lt;P&gt;female&amp;nbsp;&lt;BR /&gt;429155167&lt;BR /&gt;Mark Jonathan Avery&lt;BR /&gt;phy male&lt;BR /&gt;585628122&lt;BR /&gt;Elea Christi Silver&lt;BR /&gt;eco&lt;BR /&gt;285915791&lt;BR /&gt;Noel Kennin Arnold&lt;BR /&gt;edu female&lt;BR /&gt;490922411&lt;BR /&gt;Christopher Emerson&lt;BR /&gt;law male&amp;nbsp;&lt;BR /&gt;576639096&lt;BR /&gt;Sonya Jane Taylor&lt;BR /&gt;law male&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;&lt;/P&gt;&lt;P&gt;and this is my code ;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data hw2.grade1_personal ;&lt;BR /&gt;infile 'filespecification.txt' firstobs=11 dlm='' missover ;&lt;BR /&gt;input #1 SSN 9.&lt;BR /&gt;#2 First $ 1-13 Middle $ 14-25 Last $ 26-35&lt;BR /&gt;#3 Major $ 7. Gender $ 8. ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought it was perfect for import data into sas data set ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but last observation always failed to fill the variable "" Last ""&amp;nbsp; the blue one .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="asdasd.PNG" style="width: 480px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20728iD302B3A0CA4F1D9F/image-size/large?v=v2&amp;amp;px=999" role="button" title="asdasd.PNG" alt="asdasd.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know why this problem happen ?&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;</description>
      <pubDate>Wed, 23 May 2018 17:18:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/infile-error-in-sas9-4/m-p/464465#M70506</guid>
      <dc:creator>LeeSeongWoo_</dc:creator>
      <dc:date>2018-05-23T17:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: infile error in sas9.4</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/infile-error-in-sas9-4/m-p/464469#M70507</link>
      <description>&lt;P&gt;dlm , missover option ....&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 17:20:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/infile-error-in-sas9-4/m-p/464469#M70507</guid>
      <dc:creator>LeeSeongWoo_</dc:creator>
      <dc:date>2018-05-23T17:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: infile error in sas9.4</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/infile-error-in-sas9-4/m-p/464487#M70508</link>
      <description>&lt;P&gt;I think that you need to post your code and example data into a code box so that the windows on the forum do not reformat anything.&lt;/P&gt;
&lt;P&gt;As currently shown the data and code would not produce the result shown.&lt;/P&gt;
&lt;P&gt;When you specify columns to read from such as with&lt;/P&gt;
&lt;PRE&gt;#2 First $ 1-13&lt;/PRE&gt;
&lt;P&gt;with the shown data columns 1- 13 for the record you worry about are&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sonya Jane T&lt;/P&gt;
&lt;P&gt;and that would be the value of the first name.&lt;/P&gt;
&lt;P&gt;If your data is actually space delimited then do not specify columns to read from.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest trying something that looks like:&lt;/P&gt;
&lt;PRE&gt;data hw2.grade1_personal ;
   infile 'filespecification.txt' firstobs=11 dlm='' missover ;
   informat ssn 9. first $13. middle $11. last $10.
            major $7. gender $8.;
   input #1 SSN 
         #2 First Middle   Last 
         #3 Major  Gender 
   ;
run;&lt;/PRE&gt;
&lt;P&gt;The informats will tell SAS the maximum expected length and the variable type (normally SSN should be character but that's another issue). then the Delimiter is actually used to separate the values. If you have multiple spaces between words then you may want to use the option DSD to treat multiple spaces as single delimiter.&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;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 17:47:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/infile-error-in-sas9-4/m-p/464487#M70508</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-23T17:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: infile error in sas9.4</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/infile-error-in-sas9-4/m-p/464644#M70523</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;The informats will tell SAS the maximum expected length and the variable type&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Actually an INFORMAT is instructions to SAS on how to convert text to values.&amp;nbsp; It is only when the first reference to a variable in the data step occurs in the INFORMAT statement that it has any impact on the variable type or length. If you want to define the variable type and length it is better to use LENGTH or ATTRIB statements which are intended to be used to make those definitions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Note that the informats you have used in that example actually do not give SAS any help in knowing how to convert the text in the input stream into the values to be stored. SAS already knows how to read character values and numbers.&lt;/SPAN&gt;&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;</description>
      <pubDate>Thu, 24 May 2018 06:08:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/infile-error-in-sas9-4/m-p/464644#M70523</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-05-24T06:08:44Z</dc:date>
    </item>
  </channel>
</rss>

