<?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: Reading a .dat file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-dat-file/m-p/620715#M182441</link>
    <description>What does the log show?&lt;BR /&gt;Second of all, in NotePad++ you can show invisible characters, can you show a screenshot with that turned on?&lt;BR /&gt;&lt;BR /&gt;data tv.alco;&lt;BR /&gt;infile  "/folders/myfolders/Trial/alcohol.dat" firstobs= 22 dlm='09'x dsd;&lt;BR /&gt;input   Region $	Alcohol	Tobacco ;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Does the above work?</description>
    <pubDate>Tue, 28 Jan 2020 23:58:44 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-01-28T23:58:44Z</dc:date>
    <item>
      <title>Reading a .dat file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-dat-file/m-p/620713#M182439</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to read a .dat file into SAS. Have done this before using the DATA step, but for some reason, it am unable to read this particular file. Opened it with a text file, and the data looks like a tab-delimited, so tried using PROC IMPORT. That didn't work either.&amp;nbsp; Attaching a screenshot of the data file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data screen shot:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (87).png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35683i0159567A3FE00333/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot (87).png" alt="Screenshot (87).png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA step code snippet:&lt;/P&gt;&lt;PRE&gt;data tv.alco;
infile  "/folders/myfolders/Trial/alcohol.dat" firstobs= 22;
input   Region $	Alcohol	Tobacco ;
run;&lt;/PRE&gt;&lt;P&gt;PROC IMPORT snippet:&lt;/P&gt;&lt;PRE&gt;proc import datafile="/folders/myfolders/Trial/alcohol.dat"
out = tv.alco dbms=dlm replace ;
delimiter= '09'x ;startrow=22;
run;&lt;/PRE&gt;&lt;P&gt;Any help is appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2020 23:32:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-dat-file/m-p/620713#M182439</guid>
      <dc:creator>tejasvutu</dc:creator>
      <dc:date>2020-01-28T23:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a .dat file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-dat-file/m-p/620715#M182441</link>
      <description>What does the log show?&lt;BR /&gt;Second of all, in NotePad++ you can show invisible characters, can you show a screenshot with that turned on?&lt;BR /&gt;&lt;BR /&gt;data tv.alco;&lt;BR /&gt;infile  "/folders/myfolders/Trial/alcohol.dat" firstobs= 22 dlm='09'x dsd;&lt;BR /&gt;input   Region $	Alcohol	Tobacco ;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Does the above work?</description>
      <pubDate>Tue, 28 Jan 2020 23:58:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-dat-file/m-p/620715#M182441</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-01-28T23:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a .dat file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-dat-file/m-p/620738#M182449</link>
      <description>&lt;P&gt;Thanks! That worked. Also got to learn about the DSD option.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The log in case of the DATA step is below. Basically a bunch of invalid reads from the file.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snip2.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35689iE1C647AF074E1A26/image-size/large?v=v2&amp;amp;px=999" role="button" title="snip2.PNG" alt="snip2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The Notepad++ screenshot with all the hidden characters:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snip.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35690iC1CABF7A6733EF53/image-size/medium?v=v2&amp;amp;px=400" role="button" title="snip.PNG" alt="snip.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 03:00:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-dat-file/m-p/620738#M182449</guid>
      <dc:creator>tejasvutu</dc:creator>
      <dc:date>2020-01-29T03:00:25Z</dc:date>
    </item>
  </channel>
</rss>

