<?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 Creating a library from web service based JSON data in Enterprise Guide in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-library-from-web-service-based-JSON-data-in/m-p/624061#M35518</link>
    <description>&lt;P&gt;Some of the information that we use is being moved from oracle tables to web services.&amp;nbsp; We accessed the oracle tables through servers&amp;gt;local&amp;gt;libraries that were set up with code that was run when we started SAS.&amp;nbsp; We are using EG version 7.3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At this point I am only trying to set up a library for a list of account numbers and parcel numbers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 55425 16109110079&lt;BR /&gt;2 55426 16109110078&lt;BR /&gt;3 55427 16104413031&lt;BR /&gt;4 55464 16109501001&lt;BR /&gt;5 55465 16109501001&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Running the following code will generate a data table and a report in the process flow. The first 5 lines of this table are above. (I am not a programmer and I have a partial understanding of what each step does. I put them together from examples and by trial and error)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename mymap temp;

filename resp temp;
filename hdrs temp;
filename parcels temp;
filename map temp;
 

data _null_;
infile datalines;
file mymap;
input;
put _infile_;
datalines;
{
  "DATASETS": [
    {
      "DSNAME": "sp_to_parcel",
      "TABLEPATH": "/root",
      "VARIABLES": [
        {
          "NAME": "ordinal_root",
          "TYPE": "ORDINAL",
          "PATH": "/root"
        },
        {

          "NAME": "ServicePoint",
          "TYPE": "CHARACTER",
          "PATH": "/root/ServicePoint"
        },
        {
          "NAME": "Parcel",
          "TYPE": "CHARACTER",
          "PATH": "/root/Parcel"
        }
      ]
    }
  ]
}
;
run;


proc http 

 url="https://isddev.blah.blah.com/SASWebServiceDemo/api/ServicePoint"
 method= "GET"
 out=resp;

headers
   "Authorization"="Bearer xxxxxx";

 run;

 libname parcels JSON fileref='resp' map=mymap;

data results_out;
set parcels.sp_to_parcel;
run;
proc datasets library=parcels; run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;If I add the code up to the libname statement into the code that runs when I start SAS it will create an entry for Library&amp;gt;Parcels&amp;gt; SP_TO_PARCEL but when I click on it I get the error "Source array was not long enough. Check srcindex and length, and the array's lower bounds"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&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="eg error message (2).png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36048i29EA1C314510E2EC/image-size/large?v=v2&amp;amp;px=999" role="button" title="eg error message (2).png" alt="eg error message (2).png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Feb 2020 01:09:28 GMT</pubDate>
    <dc:creator>Chris_M</dc:creator>
    <dc:date>2020-02-12T01:09:28Z</dc:date>
    <item>
      <title>Creating a library from web service based JSON data in Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-library-from-web-service-based-JSON-data-in/m-p/624061#M35518</link>
      <description>&lt;P&gt;Some of the information that we use is being moved from oracle tables to web services.&amp;nbsp; We accessed the oracle tables through servers&amp;gt;local&amp;gt;libraries that were set up with code that was run when we started SAS.&amp;nbsp; We are using EG version 7.3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At this point I am only trying to set up a library for a list of account numbers and parcel numbers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 55425 16109110079&lt;BR /&gt;2 55426 16109110078&lt;BR /&gt;3 55427 16104413031&lt;BR /&gt;4 55464 16109501001&lt;BR /&gt;5 55465 16109501001&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Running the following code will generate a data table and a report in the process flow. The first 5 lines of this table are above. (I am not a programmer and I have a partial understanding of what each step does. I put them together from examples and by trial and error)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename mymap temp;

filename resp temp;
filename hdrs temp;
filename parcels temp;
filename map temp;
 

data _null_;
infile datalines;
file mymap;
input;
put _infile_;
datalines;
{
  "DATASETS": [
    {
      "DSNAME": "sp_to_parcel",
      "TABLEPATH": "/root",
      "VARIABLES": [
        {
          "NAME": "ordinal_root",
          "TYPE": "ORDINAL",
          "PATH": "/root"
        },
        {

          "NAME": "ServicePoint",
          "TYPE": "CHARACTER",
          "PATH": "/root/ServicePoint"
        },
        {
          "NAME": "Parcel",
          "TYPE": "CHARACTER",
          "PATH": "/root/Parcel"
        }
      ]
    }
  ]
}
;
run;


proc http 

 url="https://isddev.blah.blah.com/SASWebServiceDemo/api/ServicePoint"
 method= "GET"
 out=resp;

headers
   "Authorization"="Bearer xxxxxx";

 run;

 libname parcels JSON fileref='resp' map=mymap;

data results_out;
set parcels.sp_to_parcel;
run;
proc datasets library=parcels; run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;If I add the code up to the libname statement into the code that runs when I start SAS it will create an entry for Library&amp;gt;Parcels&amp;gt; SP_TO_PARCEL but when I click on it I get the error "Source array was not long enough. Check srcindex and length, and the array's lower bounds"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&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="eg error message (2).png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36048i29EA1C314510E2EC/image-size/large?v=v2&amp;amp;px=999" role="button" title="eg error message (2).png" alt="eg error message (2).png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 01:09:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-library-from-web-service-based-JSON-data-in/m-p/624061#M35518</guid>
      <dc:creator>Chris_M</dc:creator>
      <dc:date>2020-02-12T01:09:28Z</dc:date>
    </item>
  </channel>
</rss>

