BookmarkSubscribeRSS Feed
Chris_M
Calcite | Level 5

Some of the information that we use is being moved from oracle tables to web services.  We accessed the oracle tables through servers>local>libraries that were set up with code that was run when we started SAS.  We are using EG version 7.3.

 

At this point I am only trying to set up a library for a list of account numbers and parcel numbers:

 

1 55425 16109110079
2 55426 16109110078
3 55427 16104413031
4 55464 16109501001
5 55465 16109501001

 

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) 

 

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;


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>Parcels> 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"

 

Thanks in advance for your help

 

Chris

 

eg error message (2).png

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 0 replies
  • 388 views
  • 0 likes
  • 1 in conversation