<?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 reading .xls into SAS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/reading-xls-into-SAS/m-p/171278#M44205</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Does anyone knows how to read the &lt;STRONG&gt;.XLS&lt;/STRONG&gt; file using proc import method when the excel file has two headers and not one.&amp;nbsp; If the file contain only one header SAS 9.3 is perfectly able to read it, but unfortunately with two&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Headers it fails every time.&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;example: &lt;STRONG&gt;This&lt;/STRONG&gt; &lt;STRONG&gt;works&lt;/STRONG&gt; if the excel sheet has only one header,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;%macro inp(dat,dsn);&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; proc import datafile="/project/myfiles/data/&amp;amp;dat"&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; out=&amp;amp;dsn&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; dbms=xls replace;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; DATAROW=2;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; getnames=yes;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; run;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; I tried everything(below) that I knew for two headers file,but SAS 9.3 can not read it.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;First &lt;SPAN style="font-size: 13.3333330154419px;"&gt;failed&lt;/SPAN&gt;Trial, &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;%macro inp(dat,dsn);&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; proc import datafile="/project/myfiles/data/&amp;amp;dat"&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; out=&amp;amp;dsn&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; dbms=xls replace;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; DATAROW=3;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; getnames=yes;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; run;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;Second failed Trial,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;%macro inp(dat,dsn);&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; proc import datafile="/project/myfiles/data/&amp;amp;dat"&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; out=&amp;amp;dsn&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; dbms=xls replace;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;&amp;nbsp; startrow=2;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; DATAROW=3;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; getnames=yes;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; run;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;Second failed Trial,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;%macro inp(dat,dsn);&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; proc import datafile="/project/myfiles/data/&amp;amp;dat"&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; out=&amp;amp;dsn&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; dbms=xls replace;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;&amp;nbsp; startrow=2;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; DATAROW=3;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; &lt;STRONG&gt;getnames=NO&lt;/STRONG&gt;;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; run;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;if Anyone can share their experience with this , if had one, it will be definitely appreciated.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Verleger&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Feb 2015 19:30:54 GMT</pubDate>
    <dc:creator>verleger</dc:creator>
    <dc:date>2015-02-16T19:30:54Z</dc:date>
    <item>
      <title>reading .xls into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/reading-xls-into-SAS/m-p/171278#M44205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Does anyone knows how to read the &lt;STRONG&gt;.XLS&lt;/STRONG&gt; file using proc import method when the excel file has two headers and not one.&amp;nbsp; If the file contain only one header SAS 9.3 is perfectly able to read it, but unfortunately with two&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Headers it fails every time.&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;example: &lt;STRONG&gt;This&lt;/STRONG&gt; &lt;STRONG&gt;works&lt;/STRONG&gt; if the excel sheet has only one header,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;%macro inp(dat,dsn);&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; proc import datafile="/project/myfiles/data/&amp;amp;dat"&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; out=&amp;amp;dsn&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; dbms=xls replace;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; DATAROW=2;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; getnames=yes;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; run;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; I tried everything(below) that I knew for two headers file,but SAS 9.3 can not read it.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;First &lt;SPAN style="font-size: 13.3333330154419px;"&gt;failed&lt;/SPAN&gt;Trial, &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;%macro inp(dat,dsn);&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; proc import datafile="/project/myfiles/data/&amp;amp;dat"&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; out=&amp;amp;dsn&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; dbms=xls replace;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; DATAROW=3;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; getnames=yes;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; run;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;Second failed Trial,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;%macro inp(dat,dsn);&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; proc import datafile="/project/myfiles/data/&amp;amp;dat"&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; out=&amp;amp;dsn&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; dbms=xls replace;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;&amp;nbsp; startrow=2;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; DATAROW=3;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; getnames=yes;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; run;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;Second failed Trial,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;%macro inp(dat,dsn);&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; proc import datafile="/project/myfiles/data/&amp;amp;dat"&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; out=&amp;amp;dsn&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; dbms=xls replace;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;&amp;nbsp; startrow=2;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; DATAROW=3;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&amp;nbsp; &lt;STRONG&gt;getnames=NO&lt;/STRONG&gt;;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt; run;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;if Anyone can share their experience with this , if had one, it will be definitely appreciated.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Verleger&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 19:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/reading-xls-into-SAS/m-p/171278#M44205</guid>
      <dc:creator>verleger</dc:creator>
      <dc:date>2015-02-16T19:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: reading .xls into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/reading-xls-into-SAS/m-p/171279#M44206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should be able to use both rows for names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acpcref/63184/HTML/default/viewer.htm#a003103761.htm" title="http://support.sas.com/documentation/cdl/en/acpcref/63184/HTML/default/viewer.htm#a003103761.htm"&gt;SAS/ACCESS(R) 9.2 Interface to PC Files: Reference, Second Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc import datafile="&amp;amp;fname" dbms=xls out=test4 replace;&lt;/P&gt;&lt;P&gt;&amp;nbsp; startrow=3 ; namerow=1; endnamerow=2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 21:19:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/reading-xls-into-SAS/m-p/171279#M44206</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-02-16T21:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: reading .xls into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/reading-xls-into-SAS/m-p/171280#M44207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom for your Input.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But unfortunately those methods do not work with SAS 9.3 version and also I have Office 2010 which I am not sure if it contributes to the failure as being compatible or not.&lt;/P&gt;&lt;P&gt;I believe those method such as namerow or endnamerow will be only useful with earlier version of SAS.&lt;/P&gt;&lt;P&gt;IF there was a way that I could&amp;nbsp; skip the first row and only read the second row as my column names and third row as start of data , then that will do it also for me. but for now SAS 9.3 refuses&lt;/P&gt;&lt;P&gt;to accept my second row as column names and my data starting at third row.&amp;nbsp; Just trying to tell SAS that my first row is garbage ! do not read it. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 23:35:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/reading-xls-into-SAS/m-p/171280#M44207</guid>
      <dc:creator>verleger</dc:creator>
      <dc:date>2015-02-16T23:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: reading .xls into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/reading-xls-into-SAS/m-p/171281#M44208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works fine for me with 9.3 on Unix.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let wdir=%sysfunc(pathname(work));&lt;/P&gt;&lt;P&gt;data test ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input (x y z) ($) ;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;a b c&lt;/P&gt;&lt;P&gt;1 2 3&lt;/P&gt;&lt;P&gt;;;;;&lt;/P&gt;&lt;P&gt;proc export data=test outfile="&amp;amp;wdir/test.xls"&lt;/P&gt;&lt;P&gt;&amp;nbsp; dbms=xls replace ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc import datafile="&amp;amp;wdir/test.xls" out=test1&lt;/P&gt;&lt;P&gt;&amp;nbsp; dbms=xls replace ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc import datafile="&amp;amp;wdir/test.xls" out=test2&lt;/P&gt;&lt;P&gt;&amp;nbsp; dbms=xls replace ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; namerow=2; startrow=3;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt; set test1 ;&lt;/P&gt;&lt;P&gt; put (_all_) (=);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt; set test2;&lt;/P&gt;&lt;P&gt; put (_all_) (=);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2015 00:43:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/reading-xls-into-SAS/m-p/171281#M44208</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-02-17T00:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: reading .xls into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/reading-xls-into-SAS/m-p/171282#M44209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try RANGE=&amp;nbsp; option with proc import + excel .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2015 05:02:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/reading-xls-into-SAS/m-p/171282#M44209</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-02-17T05:02:23Z</dc:date>
    </item>
  </channel>
</rss>

