<?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: DS2 and libname xlsx in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/467104#M119223</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15378"&gt;@AndersBergquist&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;I have write a demographic prognos program and use Excel as interface to data which I had to change.&lt;/P&gt;
&lt;P&gt;/Anders&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;For using Excel as an interface to SAS tables: The SAS Add-In to Microsoft Office (SAS AMO) could&amp;nbsp;make this really simple for you.&lt;/P&gt;
&lt;P&gt;SAS AMO comes with offerings like SAS Office Analytics.&lt;/P&gt;</description>
    <pubDate>Sat, 02 Jun 2018 10:08:23 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2018-06-02T10:08:23Z</dc:date>
    <item>
      <title>DS2 and libname xlsx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/466753#M119144</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Can I got a confirmation that proc ds2 does can not access an libname xlsx?&lt;/P&gt;
&lt;P&gt;This code will not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;libname mydata xlsx 'myxlfile.xlsx';&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;proc ds2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; data work.mydata;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set mydata.xlssheet;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; enddata;&lt;/P&gt;
&lt;P&gt;run;quit;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 06:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/466753#M119144</guid>
      <dc:creator>AndersBergquist</dc:creator>
      <dc:date>2018-06-01T06:30:36Z</dc:date>
    </item>
    <item>
      <title>DS2 and libname xlsx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/466754#M119146</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Can I got a confirmation that proc ds2 does can not access an libname xlsx?&lt;/P&gt;
&lt;P&gt;This code will not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mydata xlsx 'myxlfile.xlsx';
run;

proc ds2;
       data work.mydata;
        set mydata.xlssheet;
   enddata;
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 06:33:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/466754#M119146</guid>
      <dc:creator>AndersBergquist</dc:creator>
      <dc:date>2018-06-01T06:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: DS2 and libname xlsx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/466759#M119147</link>
      <description>&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=proc&amp;amp;docsetVersion=9.4&amp;amp;docsetTarget=p05tdglkbczcp1n1ijbhzakb1cet.htm&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=proc&amp;amp;docsetVersion=9.4&amp;amp;docsetTarget=p05tdglkbczcp1n1ijbhzakb1cet.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;When you use PROC DS2, you can submit DS2 language statements to SAS servers and DBMS data sources that are available with SAS 9.4&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="xis-nobr"&gt;SAS/ACCESS&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;engines. In addition,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="xis-codeFocus"&gt;beginning with SAS 9.4M5&lt;/SPAN&gt;&lt;SPAN&gt;, if you have SAS Viya, you can submit DS2 language statements to the CAS server." - keyword here is the SAS/ACCESS engines.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Not sure why you would want to read in an Excel file (yep could have stopped there) in DS2 anyways, a simple change to your code should work fine:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;libname mydata xlsx 'myxlfile.xlsx';

proc copy in=mydata out=work;
run;

libname mydata clear;

proc ds2;
  ...
run;quit;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 07:35:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/466759#M119147</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-01T07:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: DS2 and libname xlsx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/466767#M119149</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;I have write a demographic prognos program and use Excel as interface to data which I had to change.&lt;/P&gt;
&lt;P&gt;/Anders&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 07:58:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/466767#M119149</guid>
      <dc:creator>AndersBergquist</dc:creator>
      <dc:date>2018-06-01T07:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: DS2 and libname xlsx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/466787#M119152</link>
      <description>&lt;P&gt;When something "does not work", ALWAYS post the log.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 09:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/466787#M119152</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-01T09:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: DS2 and libname xlsx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/467104#M119223</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15378"&gt;@AndersBergquist&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;I have write a demographic prognos program and use Excel as interface to data which I had to change.&lt;/P&gt;
&lt;P&gt;/Anders&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;For using Excel as an interface to SAS tables: The SAS Add-In to Microsoft Office (SAS AMO) could&amp;nbsp;make this really simple for you.&lt;/P&gt;
&lt;P&gt;SAS AMO comes with offerings like SAS Office Analytics.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jun 2018 10:08:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/467104#M119223</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-06-02T10:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: DS2 and libname xlsx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/467307#M119286</link>
      <description>&lt;P&gt;Code;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname myxl xlsx "C:\Dokument\Befolkningspronos\Manuell_justering\projektParametrar.xlsx";
run;
data flyttrikser_data;
	set myxl.flyttrisker;
run;
proc ds2;
	data flyttrisker_ds2;
		method run();
			set myxl.flyttrisker;
		end;
	enddata;

run;quit;

proc ds2;
	data _null_;
		method run();
			sqlexec('select * into work.flyttrikser_fsql from myxl.flyttrisker');
		end;
	enddata ;
run;quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;log:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;30         libname myxl xlsx "C:\Dokument\Befolkningspronos\Manuell_justering\projektParametrar.xlsx";
NOTE: Libref MYXL was successfully assigned as follows: 
      Engine:        XLSX 
      Physical Name: C:\Dokument\Befolkningspronos\Manuell_justering\projektParametrar.xlsx
31         run;
32         data flyttrikser_data;
33         	set myxl.flyttrisker;
34         run;

NOTE: The import data set has 12928 observations and 8 variables.
NOTE: There were 12928 observations read from the data set MYXL.flyttrisker.
NOTE: The data set WORK.FLYTTRIKSER_DATA has 12928 observations and 8 variables.
NOTE: DATA statement used (Total process time):
      real time           1.73 seconds
      cpu time            1.68 seconds
      

35         proc ds2;
36         	data flyttrisker_ds2;
37         		method run();
38         			set myxl.flyttrisker;
39         		end;
40         	enddata;
41         
42         run;
42       !     quit;
ERROR: Compilation error.
ERROR: BASE driver, schema name MYXL was not found for this connection
ERROR: Table "MYXL.FLYTTRISKER" does not exist or cannot be accessed
ERROR: Line 38: Unable to prepare SELECT statement for table flyttrisker (rc=0x80fff802U).
NOTE: PROC DS2 has set option NOEXEC and will continue to prepare statements.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE DS2 used (Total process time):
      real time           1.40 seconds
      cpu time            0.34 seconds
      
43         


44         proc ds2;
45         	data _null_;
46         		method run();
47         			sqlexec('select * into work.flyttrikser_fsql from myxl.flyttrisker');
48         		end;
49         	enddata ;
50         run;
50       !     quit;
ERROR: BASE driver, schema name MYXL was not found for this connection
ERROR: Table "MYXL.FLYTTRISKER" does not exist or cannot be accessed
ERROR: Failed to prepare SQL statement: select * into work.flyttrikser_fsql from myxl.flyttrisker
NOTE: Execution succeeded. No rows affected.

NOTE: PROCEDURE DS2 used (Total process time):
      real time           0.12 seconds
2                                                          The SAS System                                 08:38 Monday, June 4, 2018

      cpu time            0.10 seconds
      
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My question: Is the result by design or have I done an error?&lt;/P&gt;
&lt;P&gt;/Anders&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 06:55:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/467307#M119286</guid>
      <dc:creator>AndersBergquist</dc:creator>
      <dc:date>2018-06-04T06:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: DS2 and libname xlsx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/467308#M119287</link>
      <description>&lt;P&gt;I know about AMO but it works not on a SAS Workstation licens.&lt;/P&gt;
&lt;P&gt;I consider useing AMO on an other set up with OA-server.&lt;/P&gt;
&lt;P&gt;/Anders&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 06:56:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DS2-and-libname-xlsx/m-p/467308#M119287</guid>
      <dc:creator>AndersBergquist</dc:creator>
      <dc:date>2018-06-04T06:56:53Z</dc:date>
    </item>
  </channel>
</rss>

