<?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 Excel-data without ACCESS to PC Files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325795#M72499</link>
    <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;The PROC SETINIT output indicates that SAS/IML isn't licensed so the SAS interface to R is not an option. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;You do license the SAS Add-in for Microsoft Excel and SAS Integration Technologies so I think you can use a stored process to upload the data directly from Excel to the SAS server.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Create a stored process with this code:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%STPBEGIN; 
 
libname inxml xml; 
 
data work.mydata; 
set inxml.&amp;amp;_WEBIN_SASNAME; 
run; 

*  Optional - display output in Excel;

title 'Data Received from Excel'; 
proc print data=work.mydata; run; quit; 
 
%STPEND;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;During the registration process specify Stream and Package for &lt;STRONG&gt;Result capabilities&lt;/STRONG&gt;, and then these options to create a new input data source:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6784i353932B4D7678CC8/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="STPInstream.png" title="STPInstream.png" /&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;When you run the stored process using the SAS Add-in for Microsoft Office you are asked to select the data.&amp;nbsp; For example, select A1:C2:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6785iCE9DC14115657D43/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="AMOSelection.png" title="AMOSelection.png" /&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;The data is pushed to the SAS server, a temporary data set named WORK.MYDATA is created, and then the PROC PRINT output is displayed in Excel:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6786i165B8611AD95B841/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="AMOOutput.png" title="AMOOutput.png" /&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jan 2017 20:06:00 GMT</pubDate>
    <dc:creator>Vince_SAS</dc:creator>
    <dc:date>2017-01-18T20:06:00Z</dc:date>
    <item>
      <title>How to import Excel-data without ACCESS to PC Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325568#M72409</link>
      <description>&lt;P&gt;Is there a possibility to import xls/xlsx-files into SAS without having ACCESS to PC Files licensed? We have this need just sporadically so licensing ACCESS to PC Files&amp;nbsp;is basically not worth the expenses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Somewhere I read proc import with the option dbms=xls does not require ACCESS to PC Files. But I nonetheless get the error:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: DBMS type XLS not valid for import.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is there any other possibility or do I have to convert the excel files to csv?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We use SAS 9.04 M3.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 07:13:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325568#M72409</guid>
      <dc:creator>Alkibiades</dc:creator>
      <dc:date>2017-01-18T07:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to import Excel-data without ACCESS to PC Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325576#M72410</link>
      <description>&lt;P&gt;Write the data to a text-based format from Excel (csv) and import from that. Reading text files is a part of Base SAS and needs no additional licenses at all.&lt;/P&gt;
&lt;P&gt;This also has the great advantage that you can use a simple text editor to check what is written by Excel.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 07:54:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325576#M72410</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-18T07:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to import Excel-data without ACCESS to PC Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325582#M72416</link>
      <description>&lt;P&gt;Try DBMS = XLSX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, you can try using an ODBC instead assuming you have that licence.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 08:55:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325582#M72416</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-18T08:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to import Excel-data without ACCESS to PC Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325588#M72422</link>
      <description>&lt;P&gt;Sadly for the xlsx engine, ACCESS to PC Files is required. And no ODBC either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a list of our licensed products:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Product expiration dates:&lt;/P&gt;&lt;P&gt;---Base SAS Software 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS/GRAPH 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS/CONNECT 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS OLAP Server 30OCT2017&lt;/P&gt;&lt;P&gt;---MDDB Server common products 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS Integration Technologies 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS/Secure 168-bit 30OCT2017&lt;/P&gt;&lt;P&gt;---Unused OLAP Slot 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS/ACCESS Interface to Oracle 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS Grid Manager 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS Metadata Bridge for Microsoft Excel 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS Metadata Bridge for Oracle 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS Metadata Bridges for General Industry Standards 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS Workspace Server for Local Access 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS Workspace Server for Enterprise Access 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS Add-in for Microsoft Excel 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS Add-in for Microsoft Outlook 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS Add-in for Microsoft PowerPoint 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS Add-in for Microsoft Word 30OCT2017&lt;/P&gt;&lt;P&gt;---SAS Visual Analytics Services 30OCT2017&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 09:06:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325588#M72422</guid>
      <dc:creator>Alkibiades</dc:creator>
      <dc:date>2017-01-18T09:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to import Excel-data without ACCESS to PC Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325599#M72429</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;has the correct answer here. &amp;nbsp;Reliance on proprietary file formats is never a good idea. &amp;nbsp;Excel is neither a good data medium, nor is it open (no matter what they call it - Open Office). &amp;nbsp;Use CSV - plain text Comma delimited or XML will mean you can access your file on any computer, using more or less any software, and can import it spefically (i.e. you write a datastep to tell SAS exactly how to import that data - so avoiding the wolliness of proc importing spreadsheets) to any software. &amp;nbsp;Really, the only two benefits of Excel are the GUI which makes data entry easy (and of course colored cells and graphs to make management happy), and VBA which is a pretty powerfull inbuilt language. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 09:33:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325599#M72429</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-01-18T09:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to import Excel-data without ACCESS to PC Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325607#M72434</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;thanks for the reply, I suggested as much. The only point we use excel sheets is in fact indeed data entry. We let the departments maintain excel sheets to control scheduled programs which is easier for them. We will look into converting the xlsx files automatically on the server to csv so the users don't have to adjust.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to&amp;nbsp;you all very much for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 09:53:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325607#M72434</guid>
      <dc:creator>Alkibiades</dc:creator>
      <dc:date>2017-01-18T09:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to import Excel-data without ACCESS to PC Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325621#M72440</link>
      <description>&lt;P&gt;I would move that data entry away from Excel into a small webapp with SAS stored processes. That enables sensible input validation and central control.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 11:11:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325621#M72440</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-18T11:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to import Excel-data without ACCESS to PC Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325694#M72474</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;SAS Forum: How to import Excel-data without ACCESS to PC Files

If you have the IML interface to R you can easily recode my solution.

Python and Perl can also read sas7bdat and write to excel.

inspired by
https://goo.gl/HuxBtO
https://communities.sas.com/t5/Base-SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325568


HAVE SAS DATASET
================

Up to 40 obs from sd1.class total obs=6

Obs    NAME                 AGE

 1     Alfred                14
 2     Alice                 13
 3     Barbara               13
 4     Carol                 14
 5     Henry                 14
 6     James                 12


WANT (EXCEL SHEET)

Sheet HAVE

 +-------------------------+
 |      |    A      |   B  |
 +------+------------------+
 |      |           |      |
 |    1 |   NAME    |   AGE|
 |    2 |   Alfred  |   14 |
 |    3 |   Alice   |   13 |
 |    4 |   Barbara |   13 |
 |    5 |   Carol   |   14 |
 |    6 |   Henry   |   14 |
 +------------------+------+

SOLUTION WORKING CODE ( CAN RECODE IN IML INTERFACE TO R)

  R  writeWorksheet(wb,have,sheet="have");

FULL SOLUTION
==============

* CREATE SOME DATA;
options validvarname=upcase;
libname sd1 "d:/sd1";
data sd1.class;
  set sashelp.class(keep=name age obs=6);
run;quit;

%utl_submit_r64('
library(haven);
library(XLConnect);
have&amp;lt;-read_sas("d:/sd1/class.sas7bdat");
wb &amp;lt;- loadWorkbook("d:/xls/classout.xlsx",create = TRUE);
createSheet(wb, name="have");
writeWorksheet(wb,have,sheet="have");
saveWorkbook(wb);
run;quit;
');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Jan 2017 14:55:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325694#M72474</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2017-01-18T14:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to import Excel-data without ACCESS to PC Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325708#M72483</link>
      <description>&lt;P&gt;Some other advantages with the CSV approach as suggested by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;are consistency between datasets. You set the properties for variables such as type, length and formats. Proc Import is a guessing engine and can result in variables changing from numeric to text or vice versa when importing different content with the same layout. Also the lengths of character variables are almost gauranteed to differ. Which can complicate analysis across two or more of these files imported.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data step approach also allows many types of data checking at read time to see if your data entry is following rules.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of my favorite things for fields that should have only certain values is to use custom informats to read the data and create error messages if the values appear out of the listed ones.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 15:35:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325708#M72483</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-18T15:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to import Excel-data without ACCESS to PC Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325795#M72499</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;The PROC SETINIT output indicates that SAS/IML isn't licensed so the SAS interface to R is not an option. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;You do license the SAS Add-in for Microsoft Excel and SAS Integration Technologies so I think you can use a stored process to upload the data directly from Excel to the SAS server.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Create a stored process with this code:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%STPBEGIN; 
 
libname inxml xml; 
 
data work.mydata; 
set inxml.&amp;amp;_WEBIN_SASNAME; 
run; 

*  Optional - display output in Excel;

title 'Data Received from Excel'; 
proc print data=work.mydata; run; quit; 
 
%STPEND;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;During the registration process specify Stream and Package for &lt;STRONG&gt;Result capabilities&lt;/STRONG&gt;, and then these options to create a new input data source:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6784i353932B4D7678CC8/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="STPInstream.png" title="STPInstream.png" /&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;When you run the stored process using the SAS Add-in for Microsoft Office you are asked to select the data.&amp;nbsp; For example, select A1:C2:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6785iCE9DC14115657D43/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="AMOSelection.png" title="AMOSelection.png" /&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;The data is pushed to the SAS server, a temporary data set named WORK.MYDATA is created, and then the PROC PRINT output is displayed in Excel:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6786i165B8611AD95B841/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="AMOOutput.png" title="AMOOutput.png" /&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 20:06:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-Excel-data-without-ACCESS-to-PC-Files/m-p/325795#M72499</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2017-01-18T20:06:00Z</dc:date>
    </item>
  </channel>
</rss>

