<?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 PROC SQL Pass Through Facility for .XML in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Pass-Through-Facility-for-XML/m-p/257277#M57228</link>
    <description>&lt;P&gt;Hi, I am trying to use the PROC SQL pass through facility to import a .XML file. Below is an example of something I use for EXCEL files, is there a .XML equivalent?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
	connect to excel (path = "\\MyArea\My_File.xls");
		create table contents as
		select *
		from connection to excel (select * from [Contents$]);
	disconnect from excel;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The above code would pick up the tab called "Contents" and create a SAS data set call Contents.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 17 Mar 2016 13:33:00 GMT</pubDate>
    <dc:creator>craig159753</dc:creator>
    <dc:date>2016-03-17T13:33:00Z</dc:date>
    <item>
      <title>PROC SQL Pass Through Facility for .XML</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Pass-Through-Facility-for-XML/m-p/257277#M57228</link>
      <description>&lt;P&gt;Hi, I am trying to use the PROC SQL pass through facility to import a .XML file. Below is an example of something I use for EXCEL files, is there a .XML equivalent?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
	connect to excel (path = "\\MyArea\My_File.xls");
		create table contents as
		select *
		from connection to excel (select * from [Contents$]);
	disconnect from excel;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The above code would pick up the tab called "Contents" and create a SAS data set call Contents.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 13:33:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Pass-Through-Facility-for-XML/m-p/257277#M57228</guid>
      <dc:creator>craig159753</dc:creator>
      <dc:date>2016-03-17T13:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL Pass Through Facility for .XML</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Pass-Through-Facility-for-XML/m-p/257314#M57235</link>
      <description>&lt;P&gt;What version of SAS are you using?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And why do you need SQL Pass Through? Is the file in a Database?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The libname method is the suggested method.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 14:46:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Pass-Through-Facility-for-XML/m-p/257314#M57235</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-17T14:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL Pass Through Facility for .XML</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Pass-Through-Facility-for-XML/m-p/257315#M57236</link>
      <description>&lt;P&gt;As far as I can tell that is not using pass through. &amp;nbsp;It is using the libname excel technology. &amp;nbsp;What libname excel does is setup a SAS library reference to the file, and creates a dataset for each sheet it can find and process, a bit like a proc import for each sheet, with all of the problems associated with importing an Excel file. &amp;nbsp;It is not pass through. &amp;nbsp;Pass through is where a set of SQL statements is taken from SAS, and sent to another systems SQL processor, for example:&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; connect to oracle (..);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; execute by oracle (select * from abc);&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;The "select * from abc" is sent to Oracle's SQL parser, hence it can use functions and types in the oracle system, and not ones in the SAS system.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now your second question, regarding access to XML. &amp;nbsp;This is done by map files, you can use the free XMLMapper tool from SAS, but basically you need to provide a "spec" for the XML document, i.e. how the file is supposed to be read into SAS - remember an XML file could have multiple datasets! &amp;nbsp;Have a look here for example:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi29/119-29.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi29/119-29.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 14:47:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-Pass-Through-Facility-for-XML/m-p/257315#M57236</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-17T14:47:01Z</dc:date>
    </item>
  </channel>
</rss>

