<?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 Reading a zipped JSON into SAS dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-zipped-JSON-into-SAS-dataset/m-p/822092#M324588</link>
    <description>&lt;P&gt;I am attempting to read a JSON.gz file into SAS. I first tried using the JSON libname engine but I believe since the file is zipped it is having trouble, so I am now attempting to access the zip file first using the ZIP functionality in SAS, but am unsure if I can then use use the JSON engine after that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a file stored on disk and I start with the following.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;filename inzip ZIP '/data/file.json.gz';&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This seems to run successfully, but I am unable to reference the filename inzip using the json libname engine, I have tried several ways but in general I'm trying to reference the filename within the libname statement like below which I realize is wrong. Is there a way to do this better or a correction to what I'm attempting? Any help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;libname myfiles json '/data/inzip';

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 07 Jul 2022 16:19:48 GMT</pubDate>
    <dc:creator>A_SAS_Man</dc:creator>
    <dc:date>2022-07-07T16:19:48Z</dc:date>
    <item>
      <title>Reading a zipped JSON into SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-zipped-JSON-into-SAS-dataset/m-p/822092#M324588</link>
      <description>&lt;P&gt;I am attempting to read a JSON.gz file into SAS. I first tried using the JSON libname engine but I believe since the file is zipped it is having trouble, so I am now attempting to access the zip file first using the ZIP functionality in SAS, but am unsure if I can then use use the JSON engine after that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a file stored on disk and I start with the following.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;filename inzip ZIP '/data/file.json.gz';&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This seems to run successfully, but I am unable to reference the filename inzip using the json libname engine, I have tried several ways but in general I'm trying to reference the filename within the libname statement like below which I realize is wrong. Is there a way to do this better or a correction to what I'm attempting? Any help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;libname myfiles json '/data/inzip';

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Jul 2022 16:19:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-zipped-JSON-into-SAS-dataset/m-p/822092#M324588</guid>
      <dc:creator>A_SAS_Man</dc:creator>
      <dc:date>2022-07-07T16:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a zipped JSON into SAS dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-zipped-JSON-into-SAS-dataset/m-p/822098#M324591</link>
      <description>&lt;P&gt;You can just use the same name for the FILEREF and the LIBREF.&amp;nbsp; At least that works for normal files.&amp;nbsp; But test it as many other SAS tools (like PROC IMPORT) do not work right when the fileref is using a complex engine like ZIP.&lt;/P&gt;
&lt;P&gt;Also to read a GZIP file you need to add the GZIP keyword. Otherwise the ZIP engine is expecting an actual ZIP file and not a GZIP file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename myfiles ZIP '/data/file.json.gz' GZIP;
libname myfiles json ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 16:43:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-zipped-JSON-into-SAS-dataset/m-p/822098#M324591</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-07-07T16:43:58Z</dc:date>
    </item>
  </channel>
</rss>

