<?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: Question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-reading-external-file/m-p/837258#M331037</link>
    <description>&lt;P&gt;Suggestion:&lt;/P&gt;
&lt;P&gt;Copy those lines from the text file. On the forum open a text box using the &amp;lt;/&amp;gt; icon and paste the example text.&lt;/P&gt;
&lt;P&gt;The main message windows will reformat text and I am afraid that pictures do not describe data files very well as there are characters that affect how data is read that may not appear in a picture.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, were there any messages in the Log about invalid data or reading issues like "Lost Card"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can't read the Sex for Mary Wong because when the columns 31-33 are read column 32 is the end of line character.&lt;/P&gt;
&lt;P&gt;With John Leung&amp;nbsp; is that when attempting to read columns 20-29 is that at column 26 the Input statement encounters the end of line (that arrow) OR some other character that cannot be treated as part of a number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you read an explicit column there must be a value there. It may be that your file is actually a delimited file using a TAB character. TABS often make people think values appear in specific columns because many values align sort of nicely. But can't tell, as I said with a picture though that indent before John Wong when the 19 is shifted one character the right different than the line above it in the first picture is indicative of Tab characters.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Oct 2022 19:26:56 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-10-06T19:26:56Z</dc:date>
    <item>
      <title>Problem reading external file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-reading-external-file/m-p/837222#M331026</link>
      <description>&lt;P&gt;Hi, I have a file named "list2.txt"&lt;/P&gt;
&lt;P&gt;And would like to read it into SAS.&lt;/P&gt;
&lt;P&gt;However, I don't understand why the gender for Mary Wong and the Profit for John Leung cannot be read successfully.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May anyone pls explain it to me?&lt;/P&gt;
&lt;P&gt;Many thanks!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code:&lt;/P&gt;
&lt;P&gt;data case5b;&lt;/P&gt;
&lt;P&gt;infile '~/MS3251_2022/Raw Data/list2.txt' missover;&lt;/P&gt;
&lt;P&gt;input age 1-3 name $ 5-19 profit 20-29 sex $ 31-33;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(list2.txt and output)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Arashi02_0-1665074656073.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75974i8C1A18E2C913D695/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Arashi02_0-1665074656073.png" alt="Arashi02_0-1665074656073.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 13:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-reading-external-file/m-p/837222#M331026</guid>
      <dc:creator>Arashi02</dc:creator>
      <dc:date>2022-10-07T13:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-reading-external-file/m-p/837258#M331037</link>
      <description>&lt;P&gt;Suggestion:&lt;/P&gt;
&lt;P&gt;Copy those lines from the text file. On the forum open a text box using the &amp;lt;/&amp;gt; icon and paste the example text.&lt;/P&gt;
&lt;P&gt;The main message windows will reformat text and I am afraid that pictures do not describe data files very well as there are characters that affect how data is read that may not appear in a picture.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, were there any messages in the Log about invalid data or reading issues like "Lost Card"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can't read the Sex for Mary Wong because when the columns 31-33 are read column 32 is the end of line character.&lt;/P&gt;
&lt;P&gt;With John Leung&amp;nbsp; is that when attempting to read columns 20-29 is that at column 26 the Input statement encounters the end of line (that arrow) OR some other character that cannot be treated as part of a number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you read an explicit column there must be a value there. It may be that your file is actually a delimited file using a TAB character. TABS often make people think values appear in specific columns because many values align sort of nicely. But can't tell, as I said with a picture though that indent before John Wong when the 19 is shifted one character the right different than the line above it in the first picture is indicative of Tab characters.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 19:26:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-reading-external-file/m-p/837258#M331037</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-06T19:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-reading-external-file/m-p/837318#M331046</link>
      <description>&lt;P&gt;Take look at what is in the text file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile '~/MS3251_2022/Raw Data/list2.txt' ;
  input;
  list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also &lt;STRONG&gt;do NOT use the ancient MISSOVER option&lt;/STRONG&gt;.&amp;nbsp; That will throw away values that are too short. Use the modern (only 30+ years old) TRUNCOVER option instead.&amp;nbsp; That will use the last value on the line even if it is shorter that what you are trying to input.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 05:59:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-reading-external-file/m-p/837318#M331046</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-07T05:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-reading-external-file/m-p/837320#M331048</link>
      <description>&lt;P&gt;Open the text file with a text editor (Notepad should do it, unless it's&amp;nbsp;&lt;EM&gt;really&lt;/EM&gt; big), then copy/paste the text (say, 10 lines, including the header) into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 06:24:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-reading-external-file/m-p/837320#M331048</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-10-07T06:24:27Z</dc:date>
    </item>
  </channel>
</rss>

