<?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: Have trouble reading in fixed-space data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Have-trouble-reading-in-fixed-space-data/m-p/575266#M162684</link>
    <description>Excel files can't be read with indole &amp;amp; input. You need either proc import or a libname statement. &lt;BR /&gt;If your file just ends with xlsx but is a normal text-file (you can open it with notepad) then reading it with infile &amp;amp; input is possible. You should just look up the input statement in the docs. Hint: specify start and end for each variable as you did for id.</description>
    <pubDate>Mon, 22 Jul 2019 05:44:48 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2019-07-22T05:44:48Z</dc:date>
    <item>
      <title>Have trouble reading in fixed-space data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Have-trouble-reading-in-fixed-space-data/m-p/575262#M162682</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Updated]&lt;/P&gt;&lt;P&gt;Thank you very much for all your helps.&lt;/P&gt;&lt;P&gt;after saving to CSV file. It worked.&lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc import datafile="&amp;amp;dirdata.umaru.csv" out=umaru dbms=csv&lt;BR /&gt;            replace;&lt;BR /&gt;     delimiter=',';&lt;BR /&gt;     getnames=yes;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc print data=umaru;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been a while not use SAS but I am not so sure of this.&lt;/P&gt;&lt;P&gt;The data is like this:&lt;/P&gt;&lt;P&gt;The biggest column for "id" is 3 integers&lt;/P&gt;&lt;P&gt;for variable "&lt;CODE class=" language-sas"&gt;back" the biggest space is 6.&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I used was:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data umaru;
  INFILE "&amp;amp;dirdata.umaru.xlsx" dlm="," dsd;
  INPUT id 1-3 age  beck 7. ivhx 14-15  ndrugtx 16-17  race 18-19 treat 20-21 site 22-23  dfree 24-25;
  run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;A appreciated all the advice. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;id	age	beck	ivhx	ndrugtx	race	treat	site	dfree
1	39	9	3	1	0	1	0	0
2	33	34	2	8	0	1	0	0
3	33	10	3	3	0	1	0	0&lt;/CODE&gt;&lt;/PRE&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>Tue, 23 Jul 2019 02:57:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Have-trouble-reading-in-fixed-space-data/m-p/575262#M162682</guid>
      <dc:creator>jc3992</dc:creator>
      <dc:date>2019-07-23T02:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Have trouble reading in fixed-space data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Have-trouble-reading-in-fixed-space-data/m-p/575266#M162684</link>
      <description>Excel files can't be read with indole &amp;amp; input. You need either proc import or a libname statement. &lt;BR /&gt;If your file just ends with xlsx but is a normal text-file (you can open it with notepad) then reading it with infile &amp;amp; input is possible. You should just look up the input statement in the docs. Hint: specify start and end for each variable as you did for id.</description>
      <pubDate>Mon, 22 Jul 2019 05:44:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Have-trouble-reading-in-fixed-space-data/m-p/575266#M162684</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-07-22T05:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Have trouble reading in fixed-space data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Have-trouble-reading-in-fixed-space-data/m-p/575404#M162754</link>
      <description>&lt;P&gt;Or save the XLSX as CSV and use a delimited input.&lt;/P&gt;
&lt;P&gt;It is hard to get fixed column text out of Excel but easy to get delimited: go to file&amp;gt;Save As&amp;gt; select CSV&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 15:03:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Have-trouble-reading-in-fixed-space-data/m-p/575404#M162754</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-07-22T15:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: Have trouble reading in fixed-space data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Have-trouble-reading-in-fixed-space-data/m-p/575422#M162763</link>
      <description>XLSX files are not fixed space data, it's data stored in a proprietary format. Have you tried using PROC IMPORT?</description>
      <pubDate>Mon, 22 Jul 2019 15:54:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Have-trouble-reading-in-fixed-space-data/m-p/575422#M162763</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-22T15:54:39Z</dc:date>
    </item>
  </channel>
</rss>

