<?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: Json String Parse in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Json-String-Parse/m-p/808979#M318999</link>
    <description>&lt;P&gt;The following macro will give you the tools to load a JSON file into a LUA table.&amp;nbsp; Variables in LUA have no max-length (limited only by memory) so you can perform any processing you need there (using proc lua) before dropping back to SAS.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://core.sasjs.io/ml__json_8sas_source.html" target="_blank"&gt;https://core.sasjs.io/ml__json_8sas_source.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Apr 2022 08:51:55 GMT</pubDate>
    <dc:creator>AllanBowe</dc:creator>
    <dc:date>2022-04-21T08:51:55Z</dc:date>
    <item>
      <title>Json String Parse</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Json-String-Parse/m-p/808792#M318909</link>
      <description>&lt;P&gt;How to parse json string which has more than 32767 characters in SAS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sample of json string (Response key):&lt;/P&gt;&lt;PRE class=""&gt;&lt;CODE class=""&gt;&lt;SPAN class=""&gt;{"message"="1000 records found","status"="200","Respone"="[{\"name\":\"Jhon\",\"age\":22,\"class\":\"mca\"},{\"name\":\"Victor\",\"age\":22,\"class\":\"mca\"}]"}&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;above sample json has been parsed in python using json.loads() function can anyone suggest the alternative in sas&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 12:07:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Json-String-Parse/m-p/808792#M318909</guid>
      <dc:creator>bashique</dc:creator>
      <dc:date>2022-04-20T12:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Json String Parse</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Json-String-Parse/m-p/808808#M318916</link>
      <description>You can not use JSON engine of LIBNAME?&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Apr 2022 12:59:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Json-String-Parse/m-p/808808#M318916</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-04-20T12:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Json String Parse</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Json-String-Parse/m-p/808809#M318917</link>
      <description>&lt;P&gt;Also you could use data step to parse JSON file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
infile 'c:\temp\have.json' recfm=n dlm='{[,]}';
input have : $2000.;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Apr 2022 13:05:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Json-String-Parse/m-p/808809#M318917</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-04-20T13:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Json String Parse</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Json-String-Parse/m-p/808964#M318996</link>
      <description>I have used JSON libname but the problem i am facing is when i have a large json string under "Response" key, only 32767 characters are getting stored in the variable and hence unable to parse</description>
      <pubDate>Thu, 21 Apr 2022 04:16:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Json-String-Parse/m-p/808964#M318996</guid>
      <dc:creator>bashique</dc:creator>
      <dc:date>2022-04-21T04:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Json String Parse</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Json-String-Parse/m-p/808979#M318999</link>
      <description>&lt;P&gt;The following macro will give you the tools to load a JSON file into a LUA table.&amp;nbsp; Variables in LUA have no max-length (limited only by memory) so you can perform any processing you need there (using proc lua) before dropping back to SAS.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://core.sasjs.io/ml__json_8sas_source.html" target="_blank"&gt;https://core.sasjs.io/ml__json_8sas_source.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 08:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Json-String-Parse/m-p/808979#M318999</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2022-04-21T08:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Json String Parse</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Json-String-Parse/m-p/808980#M319000</link>
      <description>Hi AllanBowe, can you please specify the usage of LUA in ternm of sas code?</description>
      <pubDate>Thu, 21 Apr 2022 09:02:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Json-String-Parse/m-p/808980#M319000</guid>
      <dc:creator>bashique</dc:creator>
      <dc:date>2022-04-21T09:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Json String Parse</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Json-String-Parse/m-p/808994#M319006</link>
      <description>&lt;P&gt;Sure, here you go:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename fref1 "/path/to/json.file";

/* compile the lua JSON module */
%ml_json()

/* create LUA code  */
data _null_;
  file "/path/to/file.lua";
  put '
    infile = io.open (sas.symget("fpath1"), "r")
    io.input(infile)
    local resp=json.decode(io.read())
    -- grab an element from the LUA table
    local logloc=resp["logLocation"]
    io.close(infile)
  ';
run;

/* execute LUA */
%inc "/path/to/file.lua";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 10:24:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Json-String-Parse/m-p/808994#M319006</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2022-04-21T10:24:18Z</dc:date>
    </item>
  </channel>
</rss>

