<?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: How To import .xlsx file in to sas using infile statment in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78519#M16989</link>
    <description>&lt;P&gt;&lt;EM&gt;Editor's note: we modified this popular topic reply to be more relevant for current readers.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You cannot INFILE an XLSX file in DATA step. &amp;nbsp;You need to use an engine that can read the data structure of an Excel spreadsheet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have SAS/ACCESS to PC Files, you can use PROC IMPORT DBMS=XLSX or LIBNAME XLSX to accomplish this. &amp;nbsp;This works on machines even where Excel is not installed (such as Linux). &amp;nbsp;Both of these methods work in SAS University Edition if you're using that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you&amp;nbsp;&lt;STRONG&gt;don't&lt;/STRONG&gt; have SAS/ACCESS to PC Files licensed/installed, and you&amp;nbsp;&lt;STRONG&gt;do&lt;/STRONG&gt; have Excel installed on a local Windows machine along with SAS, you can try to use DDE. &amp;nbsp;That's a method of using SAS to "talk to" Excel to exchange information about your data. &amp;nbsp;Note that DDE typically won't work when SAS is running on a remote server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More on DDE:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Read Koen Vyverman's excellent DDE papers (&lt;A href="http://www2.sas.com/proceedings/sugi27/p190-27.pdf" target="_self"&gt;here's one&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;2) Excel is not a text file, so INFILE'ing it as ASCII text won't yield much:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; %let ws = Sheet1 ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; %let r1 = 7&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; %let c1 = 2&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; %let r2 = 534 ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; %let c2 = 23&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; FileName XL&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DDE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Excel|&amp;amp;ws!r&amp;amp;r1.c&amp;amp;c1.:r&amp;amp;r2.c&amp;amp;c2."&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LRecL = 5000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NoTab&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; Data specs ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Infile XL&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DSD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pad&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DLM = "09"x&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Length Col1 - Col%eval( &amp;amp;c2. - &amp;amp;c1. - 1 ) $ 200 ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Input Col1 - Col%eval( &amp;amp;c2. - &amp;amp;c1. - 1 ) ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; Run ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;HTH,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kevin&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jul 2017 17:34:29 GMT</pubDate>
    <dc:creator>KevinViel</dc:creator>
    <dc:date>2017-07-26T17:34:29Z</dc:date>
    <item>
      <title>How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78509#M16979</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can any one help how can i import ".xlsx" file into SAS using "infile" Statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have trying with below code. but i can not able to import the file..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;infile 'C:\Desktop\WR213548\test.xlxs' MISSOVER DSD lrecl=32767 firstobs=2 ;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how can i get the .xlsx using "infile statement" and im not able to use the&lt;STRONG&gt; proc import&lt;/STRONG&gt; since i don`t have EXCEL installed in PC( or Server)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thanks in advance..&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Yaswanth J.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 17:23:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78509#M16979</guid>
      <dc:creator>yaswanthj</dc:creator>
      <dc:date>2017-07-26T17:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78510#M16980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please convert &lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Excel to Csv&lt;/STRONG&gt;&lt;/SPAN&gt; ...and try...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Allu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 11:34:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78510#M16980</guid>
      <dc:creator>allurai0412</dc:creator>
      <dc:date>2013-05-17T11:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78511#M16981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you getting an error ...?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 11:52:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78511#M16981</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-05-17T11:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78512#M16982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Getting below error...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: Physical file does not exist,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D:\Temp\yaswanth\Astellas_Codelists\WR213548\MedDRA_15.0_Map.xlsx.&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;WARNING: The data set LIB.MEDDRA160_MAPPINGS may be incomplete.&amp;nbsp; When this step was stopped there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; were 0 observations and 12 variables.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.06 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.04 seconds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 12:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78512#M16982</guid>
      <dc:creator>yaswanthj</dc:creator>
      <dc:date>2013-05-17T12:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78513#M16983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you running sas on a server or local machine?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does the install have access to the path of the file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 12:23:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78513#M16983</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-05-17T12:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78514#M16984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Im Running the job&amp;nbsp; in &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;local machine&lt;/SPAN&gt; and has &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;access to the path of the file..every thing got set up.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;can not able to access the the .xlsx file using infile statment&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 12:51:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78514#M16984</guid>
      <dc:creator>yaswanthj</dc:creator>
      <dc:date>2013-05-17T12:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78515#M16985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some queries&amp;nbsp; in your question..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) you have stated ..&lt;STRONG style="color: #ffcc00;"&gt;there is no EXCEL in pc....how&lt;/STRONG&gt; can we distnguish that the file type on your Drive is Excel ??/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)please go to file source and right click on properties....this will show the DBMS type (txt or xls or db or pdf)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)And the statment&amp;nbsp;&amp;nbsp; 'lrecl=32767' ....this means&lt;SPAN style="color: #ffcc00;"&gt; your are able open the file !!!!&lt;/SPAN&gt; and declaring the MAXIMUM Row&amp;nbsp; (record) length=32767???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Allu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 13:47:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78515#M16985</guid>
      <dc:creator>allurai0412</dc:creator>
      <dc:date>2013-05-17T13:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78516#M16986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Allu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. The client specified and provided me the EXcel(.xlsx) file.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Its saying unknown application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Previously my client provided CSV, so i used &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; 'lrecl=32767' over there. i did not changed that. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 14:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78516#M16986</guid>
      <dc:creator>yaswanthj</dc:creator>
      <dc:date>2013-05-17T14:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78517#M16987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What SAS components are installed and what version?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can run a proc setinit; run; to find this out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont know this for sure but you might have to have SAS/Access for PC files even for the infile statement. If you dont have this then your only option (I think) is to convert to a txt file either through excel or open office or google docs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would copy the path directly from the explorer to make sure there wasnt a small typo somewhere as well. On multiple occasions I have been hit by the realization that I had just typed the path wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 14:40:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78517#M16987</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-05-17T14:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78518#M16988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you do not have Excel then you should ask the client to resave the data as CSV file and resend.&lt;/P&gt;&lt;P&gt;You might try using Google documents or some other tool to convert the file yourself outside of SAS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 14:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78518#M16988</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-05-17T14:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78519#M16989</link>
      <description>&lt;P&gt;&lt;EM&gt;Editor's note: we modified this popular topic reply to be more relevant for current readers.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You cannot INFILE an XLSX file in DATA step. &amp;nbsp;You need to use an engine that can read the data structure of an Excel spreadsheet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have SAS/ACCESS to PC Files, you can use PROC IMPORT DBMS=XLSX or LIBNAME XLSX to accomplish this. &amp;nbsp;This works on machines even where Excel is not installed (such as Linux). &amp;nbsp;Both of these methods work in SAS University Edition if you're using that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you&amp;nbsp;&lt;STRONG&gt;don't&lt;/STRONG&gt; have SAS/ACCESS to PC Files licensed/installed, and you&amp;nbsp;&lt;STRONG&gt;do&lt;/STRONG&gt; have Excel installed on a local Windows machine along with SAS, you can try to use DDE. &amp;nbsp;That's a method of using SAS to "talk to" Excel to exchange information about your data. &amp;nbsp;Note that DDE typically won't work when SAS is running on a remote server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More on DDE:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Read Koen Vyverman's excellent DDE papers (&lt;A href="http://www2.sas.com/proceedings/sugi27/p190-27.pdf" target="_self"&gt;here's one&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;2) Excel is not a text file, so INFILE'ing it as ASCII text won't yield much:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; %let ws = Sheet1 ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; %let r1 = 7&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; %let c1 = 2&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; %let r2 = 534 ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; %let c2 = 23&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; FileName XL&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DDE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Excel|&amp;amp;ws!r&amp;amp;r1.c&amp;amp;c1.:r&amp;amp;r2.c&amp;amp;c2."&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LRecL = 5000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NoTab&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; Data specs ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Infile XL&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DSD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pad&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DLM = "09"x&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Length Col1 - Col%eval( &amp;amp;c2. - &amp;amp;c1. - 1 ) $ 200 ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Input Col1 - Col%eval( &amp;amp;c2. - &amp;amp;c1. - 1 ) ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; Run ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;HTH,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kevin&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 17:34:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78519#M16989</guid>
      <dc:creator>KevinViel</dc:creator>
      <dc:date>2017-07-26T17:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78520#M16990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, One challenge with XLSX files (like DOCX and PPTX files) is that it is a NEW Microsoft format. In fact, an .XLSX file is not 1 file, but is a zip archive of multiple related files. You can prove this to yourself by taking any simple XLSX file, copying it and then renaming the file extension of the copy to .ZIP, Windows will complain about doing this, but you can rename the file. Then, open the .zip file with WinZip or an unzipping program. You will see that the XLSX file is not just 1 file, but is a collection of related, mostly XML files.&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jun 2014 23:00:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78520#M16990</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-06-20T23:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78521#M16991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, Cyntia it is a zip with XML and the way you can proof that is reading using a zip-top. &lt;/P&gt;&lt;P&gt;The ms way are add-ons to those&amp;nbsp; &lt;SPAN style="line-height: 20px; font-size: 10pt;"&gt;&lt;A class="jive-link-external-small" href="https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office"&gt;https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office&lt;/A&gt;&lt;SPAN&gt; as ms did the most work. New? Not really the mentioned year is 2005 and with MS it came with 2007.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 20px; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 18px; font-size: 10pt;"&gt;The coloring and more are field attributes within those XML's. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 18px; font-size: 10pt;"&gt;It is strange SAS missed this all.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jun 2014 04:23:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78521#M16991</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-06-21T04:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78522#M16992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cynthia,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Thank you for the clarification.&amp;nbsp; How does this affect using DDE within SAS?&amp;nbsp; If I understand correctly, the SAS System acts a client "requesting" the "server" Excel to perform the task, for instance to insert a value into a cell or format the cell (format, border, font, shading, et cetera).&amp;nbsp; Naively, I would expect Excel to handle the various files correctly.&amp;nbsp; Unless I misunderstand, this is not editing the (zipped XML) files directly, but rather opening Excel and have it perform the actions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; One thing is for sure, I have to become more familiar with XML.&amp;nbsp; I appreciate the clarification from you and Jaap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jun 2014 14:28:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78522#M16992</guid>
      <dc:creator>KevinViel</dc:creator>
      <dc:date>2014-06-21T14:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78523#M16993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; I'm not much help. I avoid DDE as much as possible because usually my SAS is on a server that doesn't have Office and therefore, the whole DDE process is un-doable. And, DDE is older Microsoft technology. I just don't use it. And, although I can't use ODS to insert 1 value in 1 cell in an existing sheet, I can use ODS to impact the cell format, border, font shading, et cetera) of report output, so usually, I manage to get what I want with ODS.&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jun 2014 18:56:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78523#M16993</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-06-21T18:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78524#M16994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this link: &lt;A href="http://www.sascommunity.org/wiki/Reading_XLSX_Excel_files_with_SAS/BASE_macro_-_the_easy_way" title="http://www.sascommunity.org/wiki/Reading_XLSX_Excel_files_with_SAS/BASE_macro_-_the_easy_way"&gt;Reading XLSX Excel files with SAS/BASE macro - the easy way - sasCommunity&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jun 2014 20:54:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78524#M16994</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2014-06-21T20:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78525#M16995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe it is due to the typo?&lt;/P&gt;&lt;P&gt;I see a .xlxs extension, which should be a .xlsx extension...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2015 09:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/78525#M16995</guid>
      <dc:creator>gboor</dc:creator>
      <dc:date>2015-08-24T09:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: How To import .xlsx file in to sas using infile statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/317161#M69396</link>
      <description>&lt;P&gt;I use this for code for xls and xlsx files&lt;/P&gt;&lt;P&gt;&amp;amp;prjdir is a macro for the file path.&lt;/P&gt;&lt;P&gt;&amp;amp;file1 and &amp;amp;sheet1 are macros for the file name and sheet name you want to read&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename case DDE "Excel|&amp;amp;prjdir.[&amp;amp;file1.]&amp;amp;sheet2.!R&lt;EM&gt;&amp;lt;first row&amp;gt;&lt;/EM&gt;C&lt;EM&gt;&amp;lt;first column&amp;gt;&lt;/EM&gt;:R&lt;EM&gt;&amp;lt;last row&amp;gt;&lt;/EM&gt;C&lt;EM&gt;&amp;lt;last column&amp;gt;&lt;/EM&gt;" notab;&lt;BR /&gt;data want;&lt;BR /&gt;infile case dsd dlm='09'x missover pad lrecl=1500;&lt;BR /&gt;length &lt;EM&gt;&amp;lt;vars with lengths&amp;gt;&lt;/EM&gt;;&lt;BR /&gt;input &lt;EM&gt;&amp;lt;vars&amp;gt;&lt;/EM&gt;;&lt;BR /&gt;run;&lt;BR /&gt;filename case clear;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So a filled in example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%LET prjdir=C:\Desktop\WR213548\;&lt;/P&gt;&lt;P&gt;%LET file1=test;&lt;/P&gt;&lt;P&gt;%LET sheet1=sheet1;&lt;/P&gt;&lt;P&gt;filename case DDE "Excel|&amp;amp;prjdir.[&amp;amp;file1.]&amp;amp;sheet2.!R1C1:R1000C25" notab; *1000 rows 25 columns;&lt;BR /&gt;data want;&lt;BR /&gt;infile case dsd dlm='09'x missover pad lrecl=1500; *change lrecl to fit your full row length;&lt;BR /&gt;length var1-var25 $20.;&lt;BR /&gt;input var1-var25;&lt;BR /&gt;run;&lt;BR /&gt;filename case clear;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit as needed. &amp;nbsp;Make sure that you have your excel file open and enabled editing before running this or you'll get an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2016 22:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-import-xlsx-file-in-to-sas-using-infile-statment/m-p/317161#M69396</guid>
      <dc:creator>msteelman</dc:creator>
      <dc:date>2016-12-06T22:25:57Z</dc:date>
    </item>
  </channel>
</rss>

