<?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 Help with PROC HTTP call POST method in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-PROC-HTTP-call-POST-method/m-p/564203#M158232</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am still noob with Proc http commands, Could someone please help translate this R code into sas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30078iB4FEFE05FF51CF73/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I have following However, I am not sure where to tell sas that this is "addresses" and where to mention f="pjson" &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename json_in temp;
data _null_;
file json_in;
put '{"records":[
{"attributes":{"OBJECTID":1,"Address":"500&amp;nbsp;NE Multnomah St" , "City":"Portland", "State":"Oregon","ZIP_Code":"97232"}}
]}';
run;
data _null_;
	infile json_in;
	input;
	put _infile_;
Run;

filename resp_fl temp;
proc http url='https://server.cloud.xx.org/kpmapsinternal/rest/services/KP_GIS_Tools/USA_Geocoding_Service/GeocodeServer/geocodeAddresses'
method='POST'
out=resp_fl
 ct="application/json"  
 in=json_in
 ;
Run;
data _null_;
	infile resp_fl;
	input;
	put _infile_;
Run;

filename resp_fl clear; 
filename json_in clear;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 06 Jun 2019 16:45:58 GMT</pubDate>
    <dc:creator>smijoss1</dc:creator>
    <dc:date>2019-06-06T16:45:58Z</dc:date>
    <item>
      <title>Help with PROC HTTP call POST method</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-PROC-HTTP-call-POST-method/m-p/564203#M158232</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am still noob with Proc http commands, Could someone please help translate this R code into sas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30078iB4FEFE05FF51CF73/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I have following However, I am not sure where to tell sas that this is "addresses" and where to mention f="pjson" &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename json_in temp;
data _null_;
file json_in;
put '{"records":[
{"attributes":{"OBJECTID":1,"Address":"500&amp;nbsp;NE Multnomah St" , "City":"Portland", "State":"Oregon","ZIP_Code":"97232"}}
]}';
run;
data _null_;
	infile json_in;
	input;
	put _infile_;
Run;

filename resp_fl temp;
proc http url='https://server.cloud.xx.org/kpmapsinternal/rest/services/KP_GIS_Tools/USA_Geocoding_Service/GeocodeServer/geocodeAddresses'
method='POST'
out=resp_fl
 ct="application/json"  
 in=json_in
 ;
Run;
data _null_;
	infile resp_fl;
	input;
	put _infile_;
Run;

filename resp_fl clear; 
filename json_in clear;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Jun 2019 16:45:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-PROC-HTTP-call-POST-method/m-p/564203#M158232</guid>
      <dc:creator>smijoss1</dc:creator>
      <dc:date>2019-06-06T16:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help with PROC HTTP call POST method</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-PROC-HTTP-call-POST-method/m-p/564558#M158375</link>
      <description>&lt;P&gt;Nevermind ... i first figured our how to get it work in CURL as its lot easier and then reengineered my way to sas&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
options nosource mprint;
%macro test;

	filename json_in temp;
	data _null_;
	file json_in;
	put "category=&amp;amp;sourceCountry=&amp;amp;outSR=&amp;amp;f=pjson&amp;amp;addresses={""records"":[{""attributes"":{""OBJECTID"":1,""Address"":""500&amp;nbsp;NE Multnomah St"",""City"":""Portland"",""State"":""Oregon"",""ZIP_Code"":""97232""}},
	{""attributes"":{""OBJECTID"":2,""Address"":""937&amp;nbsp;E Mariposa St"",""City"":""Portland"",""State"":""CA"",""ZIP_Code"":""91016""}}]}";
	run;


	%PUT ************* USING CURL ************; 
	filename test pipe "curl -i -X POST --data ""@%sysfunc(pathname(json_in))"" https://serverHostNm.cloud.xx.org/xxmapsinternal/rest/services/GIS_Tools/USA_Geocoding_Service/GeocodeServer/geocodeAddresses?";

	data _null_;
		infile test;
		input;
		put _infile_;
	Run;

	filename test clear;

	%PUT *************USING SAS ************; 

	filename resp_fl temp;
	filename hdrout temp;
	proc http url='https://serverHostNm.cloud.xx.org/xxmapsinternal/rest/services/GIS_Tools/USA_Geocoding_Service/GeocodeServer/geocodeAddresses?'
	method='POST'
	out=resp_fl
	/* ct="text/plain;charset=UTF-8"  */
	 in=json_in
	headerout=hdrout ;
	/*headers 'Content-Type' = 'application/json'*/
	 ;
	Run;
	data _null_;
		infile resp_fl;
		input;
		put _infile_;
	Run;
	filename resp_fl clear;
	filename hdrout clear;

%mend;
%test;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Jun 2019 19:35:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-PROC-HTTP-call-POST-method/m-p/564558#M158375</guid>
      <dc:creator>smijoss1</dc:creator>
      <dc:date>2019-06-07T19:35:06Z</dc:date>
    </item>
  </channel>
</rss>

