<?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 API on SAS EG 8.3 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/JSON-API-on-SAS-EG-8-3/m-p/829572#M327769</link>
    <description>&lt;P&gt;Thank you Koen, I was able to use method="GET" after inputting the proxy info.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I'm still not able to use method="POST", not sure if this has to do with proxy as well.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 21 Aug 2022 15:35:00 GMT</pubDate>
    <dc:creator>rawagah</dc:creator>
    <dc:date>2022-08-21T15:35:00Z</dc:date>
    <item>
      <title>JSON API on SAS EG 8.3</title>
      <link>https://communities.sas.com/t5/SAS-Programming/JSON-API-on-SAS-EG-8-3/m-p/829568#M327767</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am just trying to test parsing a JSON on SAS EG 8.3 (SAS 9.4) but I am getting an error that I haven't found a solution for. I appreciate the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;filename resp temp;
 
/* Neat service from Open Notify project */
proc http 
 url="http://api.open-notify.org/astros.json"
/* method= "POST"*/
 out=resp;
run;
 
/* Assign a JSON library to the HTTP response */
libname space JSON fileref=resp;
 
/* Print result, dropping automatic ordinal metadata */
title "Who is in space right now? (as of &amp;amp;sysdate)";
proc print data=space.people (drop=ordinal:);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And this is the error I get:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;1                                                          The SAS System                              17:36 Sunday, August 21, 2022

1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='Program';
4          %LET _CLIENTPROCESSFLOWNAME='Process Flow';
5          %LET _CLIENTPROJECTPATH='';
6          %LET _CLIENTPROJECTPATHHOST='';
7          %LET _CLIENTPROJECTNAME='';
8          %LET _SASPROGRAMFILE='';
9          %LET _SASPROGRAMFILEHOST='';
10         
11         ODS _ALL_ CLOSE;
12         OPTIONS DEV=PNG;
13         GOPTIONS XPIXELS=0 YPIXELS=0;
14         %macro HTML5AccessibleGraphSupported;
15             %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) &amp;gt;= 0 %then ACCESSIBLE_GRAPH;
16         %mend;
17         FILENAME EGSR TEMP;
18         ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR
19             STYLE=HTMLBlue
20             NOGTITLE
21             NOGFOOTNOTE
22             GPATH=&amp;amp;sasworklocation
23             ENCODING=UTF8
24             options(rolap="on")
25         ;
NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
26         
27         filename resp temp;
28         
29         /* Neat service from Open Notify project */


30         proc http
31          url="http://api.open-notify.org/astros.json"
32         /* method= "POST"*/
33          out=resp;
34         run;

ERROR: The tcpSockRead call failed. The system error is 'The connection was reset by a peer.'.
ERROR: The tcpSockRead call failed. The system error is 'The connection was reset by a peer.'.
ERROR: Connection has been closed.
NOTE: PROCEDURE HTTP used (Total process time):
      real time           0.49 seconds
      cpu time            0.01 seconds
      
NOTE: The SAS System stopped processing this step because of errors.
35         
36         /* Assign a JSON library to the HTTP response */
37         libname space JSON fileref=resp;
NOTE: JSON data is only read once.  To read the JSON again, reassign the JSON LIBNAME.
ERROR: Physical file does not exist, F:\SASWork\_TD27192_BJHQPSAS01_\#LN00071.
ERROR: Error in the LIBNAME statement.
38         
39         /* Print result, dropping automatic ordinal metadata */
40         title "Who is in space right now? (as of &amp;amp;sysdate)";


41         proc print data=space.people (drop=ordinal:);
2                                                          The SAS System                              17:36 Sunday, August 21, 2022

ERROR: Libref SPACE is not assigned.
42         run;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      
43         
44         %LET _CLIENTTASKLABEL=;
45         %LET _CLIENTPROCESSFLOWNAME=;
46         %LET _CLIENTPROJECTPATH=;
47         %LET _CLIENTPROJECTPATHHOST=;
48         %LET _CLIENTPROJECTNAME=;
49         %LET _SASPROGRAMFILE=;
50         %LET _SASPROGRAMFILEHOST=;
51         
52         ;*';*";*/;quit;run;
53         ODS _ALL_ CLOSE;
54         
55         
56         QUIT; RUN;
57         &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 21 Aug 2022 14:52:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/JSON-API-on-SAS-EG-8-3/m-p/829568#M327767</guid>
      <dc:creator>rawagah</dc:creator>
      <dc:date>2022-08-21T14:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: JSON API on SAS EG 8.3</title>
      <link>https://communities.sas.com/t5/SAS-Programming/JSON-API-on-SAS-EG-8-3/m-p/829571#M327768</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could it be that&amp;nbsp;&lt;SPAN class="cs91D5A158"&gt;the machine that is trying to access the API requires a proxy in order to access the web? &lt;BR /&gt;You may want to ask a systems administrator if that is the case.&lt;BR /&gt;If so, you can use the proxyhost / port arguments on the PROC HTTP statement. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="cs91D5A158"&gt;Here is a 2019 paper the PROC HTTP developer has wrote, which may prove helpful:&lt;BR /&gt;&lt;BR /&gt;Paper SAS3232-2019&lt;BR /&gt;The ABCs of PROC HTTP&lt;BR /&gt;Joseph Henry, SAS Institute Inc., Cary, NC&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="cs95E872D0"&gt;&lt;SPAN class="csE50A1DED"&gt;&lt;SPAN&gt;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3232-2019.pdf" target="_blank"&gt;https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3232-2019.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Koen&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Aug 2022 15:18:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/JSON-API-on-SAS-EG-8-3/m-p/829571#M327768</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-08-21T15:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: JSON API on SAS EG 8.3</title>
      <link>https://communities.sas.com/t5/SAS-Programming/JSON-API-on-SAS-EG-8-3/m-p/829572#M327769</link>
      <description>&lt;P&gt;Thank you Koen, I was able to use method="GET" after inputting the proxy info.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I'm still not able to use method="POST", not sure if this has to do with proxy as well.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Aug 2022 15:35:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/JSON-API-on-SAS-EG-8-3/m-p/829572#M327769</guid>
      <dc:creator>rawagah</dc:creator>
      <dc:date>2022-08-21T15:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: JSON API on SAS EG 8.3</title>
      <link>https://communities.sas.com/t5/SAS-Programming/JSON-API-on-SAS-EG-8-3/m-p/829581#M327775</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/293311"&gt;@rawagah&lt;/a&gt;&amp;nbsp;Is this POST attempt using the same service (which is a GET call by nature)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try a generic test using the free httpbin.org service, which I wrote &lt;A href="https://blogs.sas.com/content/sasdummy/2018/01/23/check-json-and-http/" target="_self"&gt;about in this article&lt;/A&gt;. This service allows you to try all of the various HTTP verbs to see how they work with your code.&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;filename resp temp;
proc http
 url="https://httpbin.org/post"
 method="POST" 
 /* proxyhost= proxyport= if needed*/
 out=resp;
run;

%put HTTP Status code = &amp;amp;SYS_PROCHTTP_STATUS_CODE. : &amp;amp;SYS_PROCHTTP_STATUS_PHRASE.; 
 
data _null_;
 rc = jsonpp('resp','log');
run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Aug 2022 18:34:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/JSON-API-on-SAS-EG-8-3/m-p/829581#M327775</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2022-08-21T18:34:34Z</dc:date>
    </item>
  </channel>
</rss>

