<?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: reading xml.gz along with xml reading filename in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/reading-xml-gz-along-with-xml-reading-filename/m-p/593630#M170393</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76464"&gt;@s_lassen&lt;/a&gt;&amp;nbsp;!!! This is what something similar I was looking for but without the clue that filerefs can be copied.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;</description>
    <pubDate>Thu, 03 Oct 2019 07:57:35 GMT</pubDate>
    <dc:creator>RealePrimavera</dc:creator>
    <dc:date>2019-10-03T07:57:35Z</dc:date>
    <item>
      <title>reading xml.gz along with xml reading filename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-xml-gz-along-with-xml-reading-filename/m-p/593297#M170249</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have multiple xml.gz files in a folder and I have a macro to read multiple xml files to have some output in SAS dataset. However, I need to explicitly and manually extract those xml.gz to xml files before runnning them in a macro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if there is an option where I can use gzip zip filename option along with xml filename option (SXLELIB). So, that I can directly read xml.gz files in the xml reading macro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;For e.g. if I can add this option:&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;filename fromzip ZIP "C:\Temp\Folder\data1.xml.gz" GZIP;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;to the below filename and libname statements of xml:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;filename SXLELIB "C:\Folder\data1.xml";&lt;BR /&gt;filename SXLEMAP "C:\XMLMap\xmlmap.map";&lt;BR /&gt;libname SXLELIB xmlv2 xmlmap=SXLEMAP access=READONLY;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What do you think? (I see lot of solutions for directly reading .gz files by filename gzip zip option but not sure if can be combined with xml reader filename).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you already for reading it and giving a thought (if you do) &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 11:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-xml-gz-along-with-xml-reading-filename/m-p/593297#M170249</guid>
      <dc:creator>RealePrimavera</dc:creator>
      <dc:date>2019-10-02T11:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: reading xml.gz along with xml reading filename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-xml-gz-along-with-xml-reading-filename/m-p/593341#M170256</link>
      <description>&lt;P&gt;I do not think you can combine the GZIP filename with the XML libname in a meaningful way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Meaning that you will have to extract the file from the gz archive before assigning it to a libname, e.g.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename fromzip ZIP "C:\Temp\Folder\data1.xml.gz" GZIP;   

filename tempxml temp;
data _null_;
  rc=fcopy('fromzip','tempxml');
  call symputx('temppath',pathname('tempxml'));
run;
&lt;SPAN&gt;filename SXLEMAP "C:\XMLMap\xmlmap.map";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;libname SXLELIB xml "&amp;amp;temppath" xmlmap=SXLEMAP access=READONLY;&lt;/SPAN&gt;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Oct 2019 12:32:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-xml-gz-along-with-xml-reading-filename/m-p/593341#M170256</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2019-10-02T12:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: reading xml.gz along with xml reading filename</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-xml-gz-along-with-xml-reading-filename/m-p/593630#M170393</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76464"&gt;@s_lassen&lt;/a&gt;&amp;nbsp;!!! This is what something similar I was looking for but without the clue that filerefs can be copied.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 07:57:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-xml-gz-along-with-xml-reading-filename/m-p/593630#M170393</guid>
      <dc:creator>RealePrimavera</dc:creator>
      <dc:date>2019-10-03T07:57:35Z</dc:date>
    </item>
  </channel>
</rss>

