<?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: How to Parse JSONS in PROC HTTP Outputs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Parse-JSONS-in-PROC-HTTP-Outputs/m-p/772392#M245256</link>
    <description>&lt;P&gt;If you're more comfortable with Python then this blog should interest you: &lt;A href="https://blogs.sas.com/content/sgf/2019/06/04/using-python-functions-inside-sas-programs/" target="_self"&gt;SAS or Python? Why not use both?&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Oct 2021 09:54:59 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2021-10-06T09:54:59Z</dc:date>
    <item>
      <title>How to Parse JSONS in PROC HTTP Outputs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Parse-JSONS-in-PROC-HTTP-Outputs/m-p/772288#M245210</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been scouring now for a couple hours the posts and have yet to find anything that works. I am currently pushing to an API parameters which then gives me a JSON presigned URL and will then use that URL to upload a file. I am struggling because I am not the best at SAS and am struggling to know where my issues lie. I am able to get to the proc http post, and think the JSON file containing the presigned url from aws is in the resp variable because I am able to see it in the log. The format of the JSON file is as follows&lt;/P&gt;&lt;P&gt;{"presigned_url": "https:blahblah", "uuid": "blah", "file": "blah", "var4":"blah"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that is my current issue as I cant go from this JSON into putting just the url into my next PROC HTTP request.&lt;/P&gt;&lt;P&gt;For reference in python I do all of that in one line&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;signed_url&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;json&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;loads&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;response&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;content&lt;/SPAN&gt;&lt;SPAN&gt;)[&lt;/SPAN&gt;&lt;SPAN&gt;'presigned_url'&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename in temp;
data _null_;  
	file in;
	put "value=key&amp;amp;"
		"value2=key2&amp;amp;"
		"value3=key3&amp;amp;"
run;

filename resp temp;

proc http
	method="POST"
	url="api.com"
	ct="application/x-www-form-urlencoded"
	in= in
	out= resp
	proxyhost="x"
	proxyport=1;
run;

libname lib JSON fileref=resp;

filename rest temp;
filename input "fileToUpload.data";

proc http 
   method="PUT" 
   url=lib.contents.presigned_url 
   in= input
   out=rest
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 20:49:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Parse-JSONS-in-PROC-HTTP-Outputs/m-p/772288#M245210</guid>
      <dc:creator>jakemyers2</dc:creator>
      <dc:date>2021-10-05T20:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to Parse JSONS in PROC HTTP Outputs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Parse-JSONS-in-PROC-HTTP-Outputs/m-p/772392#M245256</link>
      <description>&lt;P&gt;If you're more comfortable with Python then this blog should interest you: &lt;A href="https://blogs.sas.com/content/sgf/2019/06/04/using-python-functions-inside-sas-programs/" target="_self"&gt;SAS or Python? Why not use both?&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 09:54:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Parse-JSONS-in-PROC-HTTP-Outputs/m-p/772392#M245256</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-10-06T09:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to Parse JSONS in PROC HTTP Outputs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Parse-JSONS-in-PROC-HTTP-Outputs/m-p/772454#M245277</link>
      <description>I am more comfortable in python but due to the nature of the project it has to be done in SAS.</description>
      <pubDate>Wed, 06 Oct 2021 15:11:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Parse-JSONS-in-PROC-HTTP-Outputs/m-p/772454#M245277</guid>
      <dc:creator>jakemyers2</dc:creator>
      <dc:date>2021-10-06T15:11:48Z</dc:date>
    </item>
  </channel>
</rss>

