<?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 Lua and RESTful APIs in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Lua-and-RESTful-APIs/m-p/897823#M82980</link>
    <description>&lt;P&gt;I'm testing "Proc Lua" to produce a simpler program, which performs multiple "RESTful" requests, based on a listing.&lt;/P&gt;
&lt;P&gt;As a result, this generates much simpler code than if you had used Macro programming. As in the example below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc lua ;
submit;
  local dsid = sas.open("work.stg_organograma_sefaz")
  for row in sas.rows(dsid) do
    local guid = row.guid
	local sigla = row.sgl_sigla
	local resp_json = "'/SASDATA_PRD/usuarios/GETEC/SIC/apiOrganograma/unidade/resp_" .. sigla .. ".json'"
	local api_url = "'https://api.organograma.es.gov.br/unidades/" .. guid .. "'"
	sas.submit[[&lt;BR /&gt;
filename resp @resp_json@;
proc http
url=@api_url@
method="GET"
out=resp
OAUTH_BEARER="&amp;amp;token_access";
run;
filename resp clear;
	]]&lt;BR /&gt;
  end
  sas.close(dsid)

endsubmit;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to explore this feature further, and the next step would be to use LUA modules to process URLs and JSON.&lt;/P&gt;
&lt;P&gt;Therefore, I would like to know suggestions for the best LUA modules for this objective.&lt;/P&gt;
&lt;P&gt;I am currently using the following paper as a reference:&amp;nbsp;&amp;nbsp;&lt;A href="https://www.lexjansen.com/phuse/2021/ad/PRE_AD06.pdf" target="_blank"&gt;PRE_AD06.pdf (lexjansen.com)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Oct 2023 14:41:43 GMT</pubDate>
    <dc:creator>dcmacedo</dc:creator>
    <dc:date>2023-10-09T14:41:43Z</dc:date>
    <item>
      <title>Proc Lua and RESTful APIs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Lua-and-RESTful-APIs/m-p/897823#M82980</link>
      <description>&lt;P&gt;I'm testing "Proc Lua" to produce a simpler program, which performs multiple "RESTful" requests, based on a listing.&lt;/P&gt;
&lt;P&gt;As a result, this generates much simpler code than if you had used Macro programming. As in the example below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc lua ;
submit;
  local dsid = sas.open("work.stg_organograma_sefaz")
  for row in sas.rows(dsid) do
    local guid = row.guid
	local sigla = row.sgl_sigla
	local resp_json = "'/SASDATA_PRD/usuarios/GETEC/SIC/apiOrganograma/unidade/resp_" .. sigla .. ".json'"
	local api_url = "'https://api.organograma.es.gov.br/unidades/" .. guid .. "'"
	sas.submit[[&lt;BR /&gt;
filename resp @resp_json@;
proc http
url=@api_url@
method="GET"
out=resp
OAUTH_BEARER="&amp;amp;token_access";
run;
filename resp clear;
	]]&lt;BR /&gt;
  end
  sas.close(dsid)

endsubmit;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to explore this feature further, and the next step would be to use LUA modules to process URLs and JSON.&lt;/P&gt;
&lt;P&gt;Therefore, I would like to know suggestions for the best LUA modules for this objective.&lt;/P&gt;
&lt;P&gt;I am currently using the following paper as a reference:&amp;nbsp;&amp;nbsp;&lt;A href="https://www.lexjansen.com/phuse/2021/ad/PRE_AD06.pdf" target="_blank"&gt;PRE_AD06.pdf (lexjansen.com)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 14:41:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Lua-and-RESTful-APIs/m-p/897823#M82980</guid>
      <dc:creator>dcmacedo</dc:creator>
      <dc:date>2023-10-09T14:41:43Z</dc:date>
    </item>
  </channel>
</rss>

